Calling a Stored Procedure

jlcruzAME

Member
Joined
Oct 18, 2012
Messages
21
Programming Experience
1-3
Below is the code I currently have in place for calling a stored procedure:

VB.NET:
        Dim SQLCon As New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)        If Not SQLCon.State = ConnectionState.Open Then
            SQLCon.Open()
        End If
        Dim cmd As New SqlCommand
        cmd.Connection = SQLCon
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "s_MarkWOComplete"
        With cmd.Parameters
            .AddWithValue("@CrewID", Me.labelcrewid.Text)
            .AddWithValue("@CompletedDate", Me.Label2.Text)
        End With
        SQLCon.Close()

The stored procedure it is trying to run updates entries with a certain criteria, then updates anything else that didn't have that criteria a different way. Currently though it is not working when I click on the button on the site that should run it. Can anyone take a look at this code and tell me if anything is wrong? If needed I can supply the stored procedure code as well.

Thanks in advance.
 
Top Bottom