Error in loading excel file in windows 7 ...

Traitée Error in loading excel file in windows 7 ...

  • 2012年4月16日 15:36
     
      包含代码
    Hi all !
    in my project to reading an excel file , there is no problem in windows XP , but in Win Seven(7) , I have problem to reading the excel 2007 file . here in some part of code :
    string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0;HDR=YES;IMEX=1;""", openFileDlgData.FileName);
    string SheetName = "Test";
    string query = String.Format(@"select * from [{0}$]", SheetName);
       try
         {
            OleDbConnection conn = new OleDbConnection(connectionString);
            OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, conn);
            System.Data.DataTable dt = new System.Data.DataTable("ExcelData");
            dataAdapter.Fill(dt);
            ...
    
    Thanks in any help !

全部回复

  • 2012年4月16日 15:42
     
     

    Hi,

    what the error is? Can you post it.



    Jose Mendez.
    Blog
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Si un Post reponde a tu pregunta, por favor "Marcala como Respondida" y "Vota como útil".

  • 2012年4月16日 16:55
     
     
    Try to run the app in admin mode and see if you are getting the same error or not. Post complete error message for more details.

    Welcome to MSDN Forums. Feel free to ask your questions and Please Note to Vote helpful topics and Mark answering posts. Sudhakar

  • 2012年4月16日 17:36
     
     

    Error in win Seven(x64) :

    System.InvalidOpertionException:The 'Microsoft.ACE.OLEDB.12.0' provider

  • 2012年4月16日 19:26
     
     已答复

    check this:

    http://forums.asp.net/t/1348126.aspx/1

    you have to download this:

    http://www.microsoft.com/download/en/details.aspx?id=13255

    This download will install a set of components that can be used to facilitate transfer of data between 2010 Microsoft Office System files and non-Microsoft Office applications.



    Jose Mendez.
    Blog
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Si un Post reponde a tu pregunta, por favor "Marcala como Respondida" y "Vota como útil".