Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Code for the excel export to the database Sql Server 2008 but there is some error for the Excel provider because I have not installed the Microsoft Office.

So my concern is without using MS Office but I have open office

what will be the provider for the Open Office.

My Code is below:-

C#
if (FileName.Substring(FileName.LastIndexOf('.')).ToLower() == ".xlsx")
    strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FileName + ";Extended Properties=\"Excel 12.0;HDR=" + HDR + ";IMEX=0\"";
else
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileName + ";Extended Properties=\"Excel 8.0;HDR=" + HDR + ";IMEX=0\"";



But Eror on

Provider=Microsoft.ACE.OLEDB.12.0;

Error Is

'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine error.
Posted

1 solution

 
Share this answer
 
v2
Comments
Smanish87 21-Oct-13 6:28am    
Thanks for the Solution ,

But I just want the provider for the Open office instead of Microsoft stuffs.If you have any solution please post the comment.
Karthik Harve 21-Oct-13 7:01am    
https://www.connectionstrings.com/openoffice-spreadsheet/

this may help.

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