The Linq to Excel open source project implements a simple and intuitive LINQ provider for retrieving data from Excel spreadsheets. It takes care of creating an OLEDB and sql connection in the background, as well as filling in the properties of the returned object.
For example, the code below reads data from excel and returns a list of User objects. It automatically matches the column names in the spreadsheet with the property names in the class.
var book = new ExcelQueryFactory(@"C:\Users.xls"); var administrators = from x in book.Worksheet<User>() where x.Role == "Administrator" select x;
Design the home page of the project and be sure to watch the introductory video .
Paul
source share