Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I want to import excel file data into data base...
through asp.net,c#.....

please help me....
Posted

1 solution

Why don't you use SSIS (SQL Server Integration Services) to import the data into your database ? That is the fastest way to do it. If you want to do it using asp.net you can use the OleDbConnection to access the Excel sheet.

OleDbConnection oconn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("example.xls") + ";Extended Properties=Excel 8.0");


You can access the data by specifying the sheet name.
OleDbCommand ocmd = new OleDbCommand("select * from [Sheet1$]", oconn);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900