G
Guest
I have a quick connection from a newbie.
I am trying to run a stored procedure but I get the following error:
Could not find stored procedure. I know it is there so what am I doing
wrong? Thank you in advance.
My code is as follows:
Dim cn As SqlClient.SqlConnection
Dim cmd As SqlClient.SqlCommand
cn = New SqlClient.SqlConnection("Server=******; Database=*****;
uid=****; pwd=******")
cn.Open()
If cn.State = ConnectionState.Open Then
cmd = New SqlClient.SqlCommand("CreelScheduleInfo1")
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
Dim p As New SqlClient.SqlParameter("@LakeCode",
SqlDbType.VarChar, 50, "115")
p.Value = True
cmd.Parameters.Add(p)
cmd.ExecuteNonQuery()
cn.Close()
End If
I am trying to run a stored procedure but I get the following error:
Could not find stored procedure. I know it is there so what am I doing
wrong? Thank you in advance.
My code is as follows:
Dim cn As SqlClient.SqlConnection
Dim cmd As SqlClient.SqlCommand
cn = New SqlClient.SqlConnection("Server=******; Database=*****;
uid=****; pwd=******")
cn.Open()
If cn.State = ConnectionState.Open Then
cmd = New SqlClient.SqlCommand("CreelScheduleInfo1")
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
Dim p As New SqlClient.SqlParameter("@LakeCode",
SqlDbType.VarChar, 50, "115")
p.Value = True
cmd.Parameters.Add(p)
cmd.ExecuteNonQuery()
cn.Close()
End If