我想从混合格式(文本、数字)的 Excel 列中检索值。这就是我初始化连接字符串的方式。
var connectionString = string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1;ImportMixedTypes=Text""", fileName);
var excel = new ExcelQueryFactory(connectionString);
但是当我查询列值时,我得到的数据为零:
var xyz = (from model in carDetails
where (model.MakeDescription == carMakeName && model.YearGroup == carMadeYear) &&
model.FamilyDescription != null
select model.FamilyDescription).Distinct().ToList();
xyz 始终为零,即使子句中存在和匹配的carMakeName
记录。carMadeYear
where