User283571144 posted
Hi jasmine girl,
In a visual studio 2010 web form, I would like to be able to complete insert, updates, and deletes for one row in a sql server 2012 table. My goal is for the user to enter the data, and the
data gets saved. Thus can you tell me and or show me how to accomplish this goal using a gridview control preferable or possilbly a detailsview control?
According to your description, I suggest you could refer to follow link.
More details about how to insert delete select edit updata row in GridView you could refer to follow links:
http://www.aspsnippets.com/Articles/Simple-Insert-Select-Edit-Update-and-Delete-in-ASPNet-GridView-control.aspx
As far as I know, the difference between girdview and DetailsView as below:
The DetailsView : The DetailsView control renders a single record at a time as a table and provides the capability to page through multiple records, as well as to insert, update, and delete records. The DetailsView control is often used in master-detail
scenarios where the selected record in a master control such as a GridView control determines the record displayed by the DetailsView control.
The GridView : it supports paging but it doesn't provide a flexible layout , since its mainly used to display the data in a table based layout. And If we looked at data inserting , the Gridview doesn't have a built in support for inserting data( since it
doesn't call the insert method of it underlying data source when you click on a button with a CommadName set to "Insert" ).
More details about how to insert delete select edit updata row in DetailsView you could refer to follow links:
https://msdn.microsoft.com/en-us/library/bb532429(v=vs.100).aspx
Best Regards
Brando