Okay i am growing weary of staring. I keep getting incorrect syntax near 'usp_bldgs_c' I cannot figure out what that is. Please help!
Code:
Private Sub AddNewRecord(ByVal bldgdesc As String)
Dim conString As String = Utilities.GetConnectionString("AssetInventory")
Dim conInventory As SqlConnection = New SqlConnection(conString)
Dim cmdStoredProc As SqlCommand
cmdStoredProc = New SqlCommand("usp_bldgs_c", conInventory)
cmdStoredProc.Parameters.AddWithValue("@bldg_desc", bldgdesc)
conInventory.Open()
cmdStoredProc.ExecuteNonQuery()
conInventory.Close()
BindBldg(bldgdesc)
End Sub 'AddNewRecord
08-22-2007, 07:04 PM
Phil Weber
Try setting cmdStoredProc's .CommandType property to CommandType.StoredProcedure.
I did this and it worked wonderfully, however now I am doing the UpdateRecord and it's saying the same thing
Code:
Private Sub UpdateRecord(ByVal bldgid As Integer, ByVal bldgdesc As String)
Dim conString As String = Utilities.GetConnectionString("AssetInventory")
Dim conInventory As SqlConnection = New SqlConnection(conString)
Dim cmdStoredProc As SqlCommand
Private Sub UpdateRecord(ByVal bldgid As Integer, ByVal bldgdesc As String)
Dim conString As String = Utilities.GetConnectionString("AssetInventory")
Dim conInventory As SqlConnection = New SqlConnection(conString)
Dim cmdStoredProc As new SqlCommand