3
Reply

How to add temp data to GridView and after inserting multiple temp entries, how to finally save all the entries in the database in an ASP.NET Web application.

Ashish Khadye

Ashish Khadye

6y
2.3k
2
Reply

    Take a DataTable and store in viewstate. Then add data in the gridview from the datatable. If you are inserting new record, Then add that record into the datatable which is present in viewstate and bind that dt to the gridview.

    You can do it using ViewState just like how Srikanth described or you could use simple user specific singleton approach to ensure your data persist in class and keep using the same object, This will be faster and efficient as it will save lot of boxing unboxing

    Yes , You can add temp data to list and bind data to gridview. then if want to data insert into database then you can add data in database using simple linq query