6

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

1

2 Answers 2

7

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.

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

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"]
                };
Sign up to request clarification or add additional context in comments.

1 Comment

The link goes to empty page (22 oct 2018)
-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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.