Public Sub FillCountNonDRDOVR(ByVal nrod As Integer, ByVal cevt As String, ByVal ngo As Integer) Dim cmd = New SqlCommand("sp_CountBBNonDRDOVR") cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add("@rodeoid", SqlDbType.Int).Value = nrod cmd.Parameters.Add("@eventcd", SqlDbType.Char, 2).Value = cevt cmd.Parameters.Add("@goround", SqlDbType.Int).Value = ngo FillDataTable(cmd) End Sub
I have tried several different iterations of the above code but can not seem to get the correct syntax to put the above code in the following form:
Using cmd using as new SqlCommmand
...
End Using
TIA for any help.
Public Sub FillCountNonDRDOVR(ByVal nrod As Integer, ByVal cevt As String, ByVal ngo As Integer) Using cmd As New SqlCommand cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "dbo.sp_CountBBNonDRDOVR" cmd.Parameters.AddWithValue("@rodeoid", nrod).SqlDbType = SqlDbType.Int cmd.Parameters.AddWithValue("@eventcd", cevt).SqlDbType = SqlDbType.Char cmd.Parameters.AddWithValue("@goround", ngo).SqlDbType = SqlDbType.Int Me.FillDataTable(cmd) End Using End Sub