Hi Friends
How to insert a Excel File into VS (Asp.net 4.0) and then create a new table in SQL MS with the Excel File data ?
Insert a Excel File into VS (Asp.net 4.0)
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Hemant KumarRank #1,202 · 1.5K reputationPosted Apr 4, 2012, 9:10 PM EDT
This link sounds useful. It will use OleDbConnection to connect to the Excel file then loads it in a DataTable and then sends it to the SqlServer.
Import Data from excel to SQL server using C# in ASP. NET[^]
You can find more posts associated with importing Excel to SQL using C# in CodeProject
I hope it helps,
Garry Gibson20 reputationPosted Apr 29, 2014, 3:38 AM EDT
http://stackoverflow.com/questions/3321082/from-excel-to-datatable-in-c-sharp-with-open-xml
Also you can check out this .NET Excel component, it provides a direct API for importing an Excel file to a DataTable in C#, like the following:
ExcelFile file = ExcelFile.Load("Book1.xlsx"); ExcelWorksheet sheet = file.Worksheets["Sheet1"]; DataTable dataTable = sheet.CreateDataTable(new CreateDataTableOptions());