Editing The Datasource

Ahh it's all coming back to me now... the headaches that is :P

One thing that I would always forget how to do with the new asp.net 2.0 data controls is how to enable editing using the datasource. I set up the sql statements for select, insert, update, and delete, but only select would work. when I update something and save, it just reverts back...

the problem is that I forgot to set the Datakeys property for the control which I want to edit. It must be set to the primary key of the table in order to enable "out of the box" editing.

back to work

Enjoyed this post and/or found it useful?
SelArom Dot Net Profile Image
SelAromDotNet

Josh loves all things Microsoft and Windows, and develops solutions for Web, Desktop and Mobile using the .NET Framework, Azure, UWP and everything else in the Microsoft Stack.

His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom.



Scroll to top