Updating database in asp

16-Jun-2017 23:06 by 6 Comments

Updating database in asp - Sex chats numbers that dont need credit cards

When Update link of the Grid View will be clicked (in edit mode), On Row Updating event will fire that will call Update Record method.

That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).

Till now our Grid View is ready to be populated, now let’s write a method to populate the Grid View.

To populate the Grid View, I am calling Bind Data() method from Page_Load event after checking Is Post Back property of the page, so the Grid View will only be populated when there is no postback on the page (when the page loads for the first time).

This will make sure that Bind Data() method will not fire when you are going to edit, update or delete the record.

In Bind Data() method, I am getting the data from database using Sql objects and specifying the Data Source property of the Grid View to the Pages Data table of the Data Set.

In this article, I am going to explain how to manipulate data using Grid View control.

This article scope is limited to Updating and Deleting records using Grid View and I am not using any readymade Data controls for that but manually writing all event methods.

After that again, I am doing the same thing that I had done in Cancel Record method, I mean setting Edit Index property of the Grid View to -1 and rebinding the data again by calling Bind Data() method.

When Delete link of the Grid View will be clicked, it will confirm the user whether they really want to Delete the record, if they will click OK, it will fire On Row Deleting event of the Grid View that will call Delete Record method.

Connect me on | https://twitter.com/sheonarayan | Hello....

Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.

When Edit link of the Grid View will be clicked then On Row Editing event will fire that will call Edit Record method.