Insert data in GridView without database and insert all record to database on Button click in ASP.Net

Last Reply one year ago By dharmendr

Posted one year ago


I want to bind temprary invoice data to gridview and show the total in asp label in web application.

and after adding all items i want to save all data to database.


How to do it?

please give refernce links

Posted one year ago

Hi ashishk,

First you need to save the record in viewstate and then bind the gridview using the view state.

Insert data in GridView without using database in ASP.Net

Then use BulkCopy to insert the DataTable from viewstate to database.

SqlBulkCopy: Bulk Copy data from DataTable (DataSet) to SQL Server Table using C# and VB.Net