Im trying to do an update on the database, after changes are made, but I keep getting errors on my update command statement. Im sure its a syntax error on my part, but I cant seem to find it. Can someone take a look at my code, and let me know what Im doing wrong? All the examples I have only use only field for the WHERE, instead of two like Im using. Thanks, Donna
DataAdapter.UpdateCommand.CommandText = _
"UPDATE TasksTable SET Task_Date=" & _
"" & txtDate.Text & "," & _
"Task_Description =" & txtDesc.Text & "" & _
"WHERE (Task_Date = SaveDate)" & _
"AND (Task_Desc = SaveDesc); "
Try
DataAdapter.UpdateCommand.ExecuteNonQuery()
Catch exceptionparameter As Exception
MessageBox.Show("Bad update")
End Try
DataAdapter.UpdateCommand.CommandText = _
"UPDATE TasksTable SET Task_Date=" & _
"" & txtDate.Text & "," & _
"Task_Description =" & txtDesc.Text & "" & _
"WHERE (Task_Date = SaveDate)" & _
"AND (Task_Desc = SaveDesc); "
Try
DataAdapter.UpdateCommand.ExecuteNonQuery()
Catch exceptionparameter As Exception
MessageBox.Show("Bad update")
End Try