Asp onrowupdating inserts new row

17-Dec-2016 00:20

You may have noticed that I have cancelled the Grid View's Edit mode by setting its Edit Index equal to -1 which brings the Grid View back to the normal mode so that the changes could be viewable.Save all or press "Ctrl S" and hit "F5" to run the page, the page will look as in the following image: Click on "Edit the Grid View", it will display Textboxes in each cell as in the following image: Edit the value(s) here and click on the Update link, it will update all the data or to remove it click on the "Delete" link above the image shown.Here we are not deleting a record permanently but using active flag column, make it inactive the record while doing the delete operation then make it active and get it whenever you want.

This sample contains a Sql Server database file, if you do not install Sql Server, The Data In page can also works fine.

I’m using visual studio 2008 and sql server 2008 for this sample.

In general, gridview control is used to populate the data in tabular format from different datasources and basically it derived from webcontrol class.

Place Link Button Edit in Item Template and Link Button Update and Cancel in Edit Tamplate of Gridview's column. Fire Grid View's Row Editing event for Link Button Edit. Fire Grid View's Row Updating event for Link Button Update. Fire Grid View's Row Canceling Edit event for Link Button Cancel. Set Command Name propery of Link Buttons according to their respective event. Set Grid View's Data Key Names Property to record ID (ID=Primary/Unique key of student table) 7.

In this article, we will explore how to add, update, delete and select a record from sql server database using gridview control in a simple way.

This sample contains a Sql Server database file, if you do not install Sql Server, The Data In page can also works fine.

I’m using visual studio 2008 and sql server 2008 for this sample.

In general, gridview control is used to populate the data in tabular format from different datasources and basically it derived from webcontrol class.

Place Link Button Edit in Item Template and Link Button Update and Cancel in Edit Tamplate of Gridview's column. Fire Grid View's Row Editing event for Link Button Edit. Fire Grid View's Row Updating event for Link Button Update. Fire Grid View's Row Canceling Edit event for Link Button Cancel. Set Command Name propery of Link Buttons according to their respective event. Set Grid View's Data Key Names Property to record ID (ID=Primary/Unique key of student table) 7.

In this article, we will explore how to add, update, delete and select a record from sql server database using gridview control in a simple way.

Now you can ask questions directly to me on my new site ASPForums.