I like to retrieve the data from excel sheet using linq, I saw ExcelqueryFactory for that in some sites. I don't know the namespace or reference for that. I am using .net3.5 framework(visual studio2008). Is it possible to use it in .net3.5
我喜欢使用linq从excel表中检索数据,我在某些站点看到了ExcelqueryFactory。我不知道名称空间或引用。我正在使用.net3.5框架(visual studio2008)。是否可以在.net3.5中使用它
3 个解决方案
#1
6
I think ExcelQueryFactory come from .net framework 4.0 . We need to inculde dll for access that class in .net3.5.From below link we can get that.
我认为ExcelQueryFactory来自.net framework 4.0。我们需要包含dll以访问.net3.5中的类。从下面链接我们可以得到它。
http://code.google.com/p/linqtoexcel/source/browse/trunk/src/LinqToExcel/ExcelQueryFactory.cs?r=50
http://code.google.com/p/linqtoexcel/source/browse/trunk/src/LinqToExcel/ExcelQueryFactory.cs?r=50
Below example code show how we retrieve from Excel using ExcelQueryFactory
下面的示例代码显示了我们如何使用ExcelQueryFactory从Excel中检索
var book = new ExcelQueryFactory("pathToExcelFile");
var australia = from x in book.Worksheet()
where x["Country"] == "Aust"
select new
{
Country = x["Country"],
BookCode = x["Code"],
BookName = x["Name"]
};
#3
-2
Try to obtain data to DataTable or any other collection using OleDb and process collection by LINQ. I can post or send obtaining sources bit later.
尝试使用OleDb获取数据到DataTable或任何其他集合以及LINQ的进程集合。我可以稍后发布或发送获取源。
#1
6
I think ExcelQueryFactory come from .net framework 4.0 . We need to inculde dll for access that class in .net3.5.From below link we can get that.
我认为ExcelQueryFactory来自.net framework 4.0。我们需要包含dll以访问.net3.5中的类。从下面链接我们可以得到它。
http://code.google.com/p/linqtoexcel/source/browse/trunk/src/LinqToExcel/ExcelQueryFactory.cs?r=50
http://code.google.com/p/linqtoexcel/source/browse/trunk/src/LinqToExcel/ExcelQueryFactory.cs?r=50
Below example code show how we retrieve from Excel using ExcelQueryFactory
下面的示例代码显示了我们如何使用ExcelQueryFactory从Excel中检索
var book = new ExcelQueryFactory("pathToExcelFile");
var australia = from x in book.Worksheet()
where x["Country"] == "Aust"
select new
{
Country = x["Country"],
BookCode = x["Code"],
BookName = x["Name"]
};
#2
#3
-2
Try to obtain data to DataTable or any other collection using OleDb and process collection by LINQ. I can post or send obtaining sources bit later.
尝试使用OleDb获取数据到DataTable或任何其他集合以及LINQ的进程集合。我可以稍后发布或发送获取源。