I have a C# webform which uses a formview to insert, update, and delete records selected from a gridview into an Access database. The insert and delete functions work fine, the update does not.
- The formview has 'id' as a DataKeyName.
- The update works if done from the Query Builder and I enter the values manually
- I don't have anything in the codebehind for the update event.
UpdateCommand:
I'm not getting an error. The command proceeds as normal, like it's actually updating, then the page does the postback and everything is the same.
I've added some code to debug it...
- protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
- {
- object comments = e.OldValues["comments"];
- object newcomment = e.NewValues["comments"];
- }
Now, looking at the Autos debug window I see that it's getting the new value for the "comments" field, I changed the value to "Comment1" just so it would stick out. The old value was "NO COMMENT"
So, when I update the field and click the Update link button, it's getting the new value but for some reason not storing it.
What to do...
Also, it's getting the key "id" just fine with its value of "10" so I'm not sure what to check next...
Is there any way to see the SQL statement it's trying to use? If I just write out the update command it's giving me all the "?"'s but what I want to see are my variables in there.