Данный код вызывает хранимую процедуру с параметрами на Visual Basic.NET
Imports System.Data.SqlClient
Imports System.Data
...
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Try
With con
.ConnectionString = ConfigurationManager.ConnectionStrings("dbConnectionString").ConnectionString
.Open()
End With
With cmd
.Connection = con
.CommandText = "StoredProcedureName"
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@ParamA", SqlDbType.NVarChar, 0).Value = "..."
.Parameters.Add("@ParamB", SqlDbType.Int).Value = 1
.ExecuteNonQuery()
End With
Catch ex As Exception
' обработка ошибок
Finally
cmd.Dispose()
con.Close()
End Try