-
Data Grid Update
I am frustrated. I have placed all the code I thought I needed to perform an update to a datagrid. I am using the build in In-Line editing with the UpdateCommand.
Everything is ok until the update command fires. When the data is grabbed from the text boxes it is the OLD data.
Here is an example:
Text1 before the edit = "Jones"
Text1DureingEdit "Brown"
Text1 during the update command= "Jones"
It ignores "Brown" and keeps the old data.
Here is my code.
dr("ccLName") = CType(dgi.Cells(3).Controls(0), TextBox).Text
Is this a bug?
-
I would need to see more code. for example what is dr? If it is a datareader then it's no use to you.
If you are correctly associating an update command with a dataadapter then ensure that you call the acceptchanges method on the dataadapter before updating. At least I think thats the method.