Link to home
Start Free TrialLog in
Avatar of michaelbuller
michaelbuller

asked on

Access stored procedure to sql server equivalent

My stored procedure looks like this in vb.net 2003 ... what would the equiv look like in if I were using sql server...
Dim spName As String
        Dim spSearch As String
        Dim Row As Integer

        odaRate.SelectCommand = New OleDb.OleDbCommand
        With odaRate.SelectCommand
            .CommandType = CommandType.StoredProcedure
            .Parameters.Add("spZip", OleDbType.VarChar, 10).Value = mskOZip.ClipText
            .CommandText = "spZipSearch"
            .Connection = cnnRate
        End With
        dsRate.Clear()
        Try
            odaRate.Fill(dsRate, "Zip")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        Me.dtgTest.DataSource = dsRate.Tables("Zip")
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alternatively you could connect to SQL Server using the OleDb data objects rather than the native Sql objects; in which case you wouldn't have to change anything.