S
sck10
Hello,
I have a stored procedure that requires 3 parameters. How do you add
multiple parameters for a SqlConnection?
Thanks, Steven
Public strConn = "Data Source=MyServer;Initial Catalog=MyDatabase;User
Id=MyUser;Password=MyPwd;"
Dim cnnSearch As SqlConnection = New SqlConnection(strConn)
Dim cmdRegion As SqlCommand = New SqlCommand("SalesByCategory", cnnSearch)
cmdRegion.CommandType = CommandType.StoredProcedure
Dim myParm As SqlParameter = cmdRegion.Parameters.Add("@CategoryName",
SqlDbType.VarChar, 15)
myParm.Value = "NorthAmerica"
cnnSearch.Open()
Dim myReader As SqlDataReader = cmdRegion.ExecuteReader()
I have a stored procedure that requires 3 parameters. How do you add
multiple parameters for a SqlConnection?
Thanks, Steven
Public strConn = "Data Source=MyServer;Initial Catalog=MyDatabase;User
Id=MyUser;Password=MyPwd;"
Dim cnnSearch As SqlConnection = New SqlConnection(strConn)
Dim cmdRegion As SqlCommand = New SqlCommand("SalesByCategory", cnnSearch)
cmdRegion.CommandType = CommandType.StoredProcedure
Dim myParm As SqlParameter = cmdRegion.Parameters.Add("@CategoryName",
SqlDbType.VarChar, 15)
myParm.Value = "NorthAmerica"
cnnSearch.Open()
Dim myReader As SqlDataReader = cmdRegion.ExecuteReader()