VB.NET and the SQLAdapter UPDATE command problem [RESOLVED]
I am trying to use VB.NET to update a record in my database. I am using the below code:
Code:
Dim RowsAffected As Integer = 0
SqlConnection1.Open()
With SqlUpdateCommand1
.Parameters("@Company_ID").Value = "COMPID"
.Parameters("@Company_Name").Value = "COMPNAME"
.Parameters("@Contract").Value = "CONTRACT"
.Parameters("@Original_ID").Value = 2
End With
SqlUpdateCommand1.ExecuteNonQuery()
SqlConnection1.Close()
When it gets to the SqlUpdateCommand1.ExecuteNonQuery() it crashes out and says:
Quote:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
The SQL Update statement it should be attempting to execute is below:
Quote:
UPDATE TEST SET Company_ID = @Company_ID, Contract = @Contract, Company_Name = @Company_Name WHERE (ID = @Original_ID); SELECT ID, Company_ID, Contract, Company_Name FROM TEST WHERE (ID = @ID)
Does anyone know what this problem could be or how to fix it? From my understanding I am doing everything correctly and that error means absolutely nothing to me (gives NO detail).