& # 39; Microsoft.ACE.OLEDB.12.0& # 39;提供程序未在本地计算机上注册.c#

本文关键字:注册 计算机 ACE Microsoft OLEDB 程序 | 更新日期: 2023-09-27 18:17:23

我正在尝试使用linq_to_excel

http://www.softinterface.com/DL/DL_UserData_Proc.ASP

这是我的代码:

var data = new LinqToExcel.ExcelQueryFactory();
            data.FileName= @"FRM_DTA.xlsx";
            data.AddMapping<ExcelFileDefinition>(x => x.FARM_ID, "FRM_ID");
            data.AddMapping<ExcelFileDefinition>(x => x.FARM_OWNER, "FRM_OWNER");
            data.AddMapping<ExcelFileDefinition>(x => x.FARM_AREA_ID, "FRM_AREA_ID");
            data.AddMapping<ExcelFileDefinition>(x => x.FARM_EMARA_ID, "FRM_EMARA_ID");
            data.AddMapping<ExcelFileDefinition>(x => x.FARM_REGION_ID, "FRM_REGION_ID");
            data.AddMapping<ExcelFileDefinition>(x => x.FARM_NUMBER, "farmNumber");
            data.AddMapping<ExcelFileDefinition>(x => x.RECEIVING_CENTER_ID, "RecievingCentreID");
            var result = from x in data.Worksheet<ExcelFileDefinition>()
                         select x;
            (foreach(var row in result){
                Console.WriteLine(row.FARM_ID);
            }

当我运行它时,我得到了这个异常:

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

帮助请

我已经试过了

我发现这个问题Microsoft.ACE.OLEDB.12.0提供商没有注册,我将我的platform targetany cpu更改为x86,但仍然有问题

& # 39; Microsoft.ACE.OLEDB.12.0& # 39;提供程序未在本地计算机上注册.c#

我需要下载Office 2007系统驱动程序:数据连接组件版本:https://www.microsoft.com/en-us/download/confirmation.aspx?id=23734

下载并安装Microsoft Access Database Engine 2010 Redistributable