[solved]problem updating db table after delete row(s) from dbgrid
I have a dbGrid that has databinding to a table RESULT in mssql db, i have these lines of code for removing selected record from table RESULT:
the first line works fine, which means that no problem with deleting a row in the dbgrid, but when the second line of code is executed, which is meant to update the changes to RESULT table in db, it gives sql error. here are the update sql:
plz help
I have a dbGrid that has databinding to a table RESULT in mssql db, i have these lines of code for removing selected record from table RESULT:
VB.NET:
DsCompareResults.Tables("RESULT").Rows(Me.BindingContext(DsCompareResults, "RESULT").Position).Delete()
SqlDataAdapterCompareResults.Update(DsCompareResults, "RESULT")
VB.NET:
UPDATE RESULT
SET STARTTIME = ?, ENDTIME = ?, TOTALMARKS = ?, GRADE = ?, TID =, UID =, STARTDATE =, ENDDATE =
WHERE (RID = ?) AND (UID = ? OR
? IS NULL AND UID IS NULL) AND (STARTDATE = ? OR
? IS NULL AND STARTDATE IS NULL) AND (STARTTIME = ? OR
? IS NULL AND STARTTIME IS NULL) AND (ENDDATE = ? OR
? IS NULL AND ENDDATE IS NULL) AND (ENDTIME = ? OR
? IS NULL AND ENDTIME IS NULL) AND (TOTALMARKS = ? OR
? IS NULL AND TOTALMARKS IS NULL) AND (GRADE = ? OR
? IS NULL AND GRADE IS NULL) AND (TID = ? OR
? IS NULL AND UID IS NULL)
plz help
Last edited: