Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# GUI
Hello friends,
 
While reading the .xlsx file I'm getting the The 'Microsoft.ACE.Oledb.12.0' provider is not registered on the local machine. exception.
 
Though I have installed AccessDatabaseEngine_x64. Download from http://www.microsoft.com/en-us/download/details.aspx?id=13255
I'm trying to read and write both .xls and .xlsx files.
 
I tried to use gacutil.exe to put it dll to my local but couldn't succeed.
 
My conncetion strings are
if (extn.ToUpper() == ".XLS")
            {
                excelConn = @"Provider=Microsoft.Jet.Oledb.4.0; Data Source=" + path + "; Extended Properties=Excel 8.0;";
            }
            if (extn.ToUpper() == ".XLSX")
            {
                excelConn = @"Provider=Microsoft.ACE.Oledb.12.0; Data Source=" + path + "; Extended Properties=Excel 12.0;";
            }
 
Please put some light on this context and guide me.
Thanks Smile | :)
Posted 30-Oct-12 20:23pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can try this OLEDB Provider is not registered on the local machine[^]
 
OR
 
try adding the Reference of 'Microsoft.ACE.Oledb.12.0.dll' to your project.
  Permalink  
Comments
Manish Kumar Namdev at 31-Oct-12 2:11am
   
Hello Bitla Phanindra Is there any way to work with both .xls and .xlsx file operation with c#. I'm using express edition 2010
Saroj Singh at 28-Apr-14 7:23am
   
Please anyone answer this....
Bitla Phanindra at 23-Jun-14 11:35am
   
Check my comment below..
All Time Programming at 1-Feb-14 3:15am
   
I tried forcing to compile using x86 platform only, but that didn't worked for me. Finally I tried installing the Driver from http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734# and that made my app running back to normal.
Bitla Phanindra at 23-Jun-14 11:34am
   
You can try it this way..
if (FilePath.Trim().EndsWith(".xlsx"))
{
strConn = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1\";", FilePath);
}
else if (FilePath.Trim().EndsWith(".xls"))
{
strConn = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";", FilePath);
}

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

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100