开发者

asp.net grid view save checked rows to datatable (paging is already done)

开发者 https://www.devze.com 2023-01-13 19:54 出处:网络
I implemented paging for one of my GridViews.Now I want that all checked boxes(which a开发者_开发百科re kept in first column of GridView) to be inserted to Database.How can I achieve this? Please let

I implemented paging for one of my GridViews. Now I want that all checked boxes(which a开发者_开发百科re kept in first column of GridView) to be inserted to Database. How can I achieve this? Please let me know.

I want to know how can I save the checked rows to the data table, and then re-bind to this temporary data table to grid view

If some body navigate back and uncheck check box for the row then how can i remove it again from the temporary datatable


Using a gridview and DataAdapters you can achieve this. Read more about updating data with DataAdapters here. To quote Microsoft on the use of DataAdapters:

You can use a data adapter to perform the following operations:

Retrieve rows from a data store into corresponding data tables within the dataset.

To retrieve rows into a dataset, use the Fill method on a data adapter object (SqlDataAdapter, OleDbDataAdapter, OdbcDataAdapter, or OracleDataAdapter). When you invoke the Fill method, it transmits an SQL SELECT statement to the data store.

Transmit changes made to a dataset table to the corresponding data store.

To transmit a dataset table of the dataset to the data store, use the adapter's Update method. When you invoke the method, it executes whatever SQL INSERT, UPDATE or DELETE statements are needed, depending on whether the affected record is new, changed, or deleted.

0

精彩评论

暂无评论...
验证码 换一张
取 消