Rowupdating error handling Text site sex
I have a Grid View bound to a Data Table which comes from a database.
However, if you manually write code to do the update, you can always wrap with a try/catch block... Row Updated event occurs after the update, if there is an error during the update it will happen before the Row Updated event fires so you cannot handle the error there.
(Note, in the gridview the Enable View State="False" - if I set it to True I get the standard "Failed to load viewstate. error) One strange thing that I've noticed that makes me think it's a View State problem is that if I change the Command Name of the Update button to "Edit" that postback event does get captured in the Row Command event...
There are similar questions on Stackoverflow and other websites, but I seem to miss something.
Data Row Then If Not table Copied Then original Data Table = CType(e.
Click original Data Table = CType(View State("original Values Data Table"), System. Data Table) For Each r As Grid View Row In Grid View1.
How can I catch that error and display in a label a text to warn the user the value already exists?