I am confused about how to pass parameters to a stored procedure. The stored procedure is written in sql server 2005 and the code is in vb.net.
I have included the sub that I am working on. I know that my use of parameters is wrong. Can someone explain what I should do?
Code:Public Sub AddRecipe() Using myDBconnection As New SqlConnection(setConnstring) Using SQLcmd As New SqlCommand() SQLcmd.Connection = myDBconnection SQLcmd.CommandType = CommandType.StoredProcedure SQLcmd.CommandText = "CreateRecipe" SQLcmd.Parameters.Add("Name", NVarChar) End Using End Using End Sub




Reply With Quote