Click here to Skip to main content
15,924,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i used visual studio 2015 in windows 10 .

and i import data from excel to sql.

if (FileUpload1.HasFile)
{
string path = string.Concat(Server.MapPath("~/Uploaded/" + FileUpload1.FileName));
FileUpload1.SaveAs(path);

if (Path.GetExtension(FileUpload1.FileName) == string.Format(".xlsx"))
{
oledbConn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\" ");
}

What I have tried:

how i solve this problem please
Posted
Updated 12-Jun-16 3:36am

 
Share this answer
 
Comments
MahmoudOmar 12-Jun-16 5:35am    
its not working
You have to download and install the ACE database engine that matches the architecture of your ASP.NET application. If it's compiled 32-bit, download and install the 32-bit engine. If it's 64-bit, you need the 64-bit engine. If you left it as AnyCPU and are running the site on a 64-bit Windows machine, you need the 64-bit engine.

ACE database engine 32 bit[^]

ACE database engine 64 bit[^]
 
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