[英]The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#
I am trying to use linq_to_excel 我试图用linq_to_excel
http://www.softinterface.com/DL/DL_UserData_Proc.ASP http://www.softinterface.com/DL/DL_UserData_Proc.ASP
This is my code: 这是我的代码:
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);
}
when I run it, I got this exception: 当我运行它时,出现了以下异常:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Help please 请帮助
I found this question Microsoft.ACE.OLEDB.12.0 provider is not registered and I changed my platform target
from any cpu
to x86
but still have the problem 我发现这个问题Microsoft.ACE.OLEDB.12.0供应商没有注册 ,我改变了我的platform target
从any cpu
到x86
,但仍然有问题
我需要下载Office 2007系统驱动程序:数据连接组件版本: https : //www.microsoft.com/zh-cn/download/confirmation.aspx?id = 23734
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.