tags:

views:

48

answers:

1

I implemented paging for one of my GridViews. Now I want that all checked boxes(which are 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

A: 

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.

Shogun
no thats ok i got your point but i want to know how should i store each checked value row in temporary dataable ehch may ne in session of view state, and if we nevigate back and the value again then how should it reflect reflect to datatable after having a consistent table i will store t to datatable
NoviceToDotNet