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.StoredProcedur e
.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")
Dim spName As String
Dim spSearch As String
Dim Row As Integer
odaRate.SelectCommand = New OleDb.OleDbCommand
With odaRate.SelectCommand
.CommandType = CommandType.StoredProcedur
.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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.