Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 06, 2013 01:38 PM by farooque84
Mar 05, 2013 06:53 AM|LINK
I can upload an Excel File and make it a gridview, but what i want to do is, insert the data also into my database that comes from the gridview.
Mar 05, 2013 06:56 AM|LINK
Mar 06, 2013 08:01 AM|LINK
Here is my solution to show data from Excel in gridview.
Dim workbook As Workbook = New Workbook()
Dim sheet As Worksheet = workbook.Worksheets(0)
'Export Data to DataTable and Bind Data to GridView
Dim table As DataTable = sheet.ExportDataTable
Me.GridView1.DataSource = table
I use a commercial
ASP.NET Excel library in this solution. Hope helpful!
Mar 06, 2013 12:13 PM|LINK
SqlBulkCopy is one way -
or ellse make the complete data into a Xml format, then send it to a stored procedure...in the stored procedure you can hace OpenXml in TSQL to make bulk inserts...
Mar 06, 2013 01:32 PM|LINK
To upload excel into database see this link
Once data goes into the database, you can get data using SQLConnection, SQLCommand and SQLDataAdapter class and bind using following code
gvYourGrid.DataSource = dataset_or_datatable_or_collection;
Mar 06, 2013 01:38 PM|LINK
Use below code to load the values to grid while importing excel ,
Use below code to save the loaded gridview values in to database,