Update query not working in table adapter
I have a table adapter on which I want to query an update to my database.
UPDATE Polls
SET DateRequest = ?
WHERE (Id = ?)
But it's not working when I try to execute it
_pollsAdapter.UpdatePollById(id, DateTime.Parse(RequestedDateBox.开发者_如何学CText).ToOADate());
The adapter also has some other queries for selecting or inserting and they all work perfectly fine.
I checked if the id
is correct or if any other error in the statement could cause it to not work, but then I would get an exception, wouldn't I?
Also, if I check for the return value, I get 0
- so the query actually edited no rows, but I can't see any reason why. The id
is correct, the statement is correctly created within the table adapter, it throws no syntax or whatsoever-errors...
How could I debug this matter more?
Your query shows DateRequest and the ID, so you need to pass the parameters in the same order. You are passing ID first.
-- http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/8f09bdd7-ba53-4f0c-95c4-cdcb35dea4f2
精彩评论