tags:

views:

368

answers:

6

I am interested in using LINQ against Excel. Right now I am using oledb to read a sheet into a datatable and then maybe convert it to list and then I want to manipulate the data and write back to Excel. Seems cumbersome.

Is there an easier way using LINQ to do this stuff in a more straightforward way?

A: 

Have you tried using ADO with Excel to use your excel document as a datasource?

More here: http://support.microsoft.com/kb/257819

hypoxide
I mentioned I am using oledb.
Tony_Henrich
A: 

You can save Excel as XML and parse it with LINQ, but I've never written data back out. I would suggest using MS-Excel automation. If you can use .NET 4, it's even easier with dynamic.

kenny
+4  A: 

You could use the Linq to Excel provider from this blog

Perpetualcoder
+11  A: 

There are a couple of Linq-to-Excel providers that you will likely be interested in checking out:

There are also some related posts here on Stack Overflow that have some interesting discussions on this topic:

-- Mike

Mike Rosenblum
+2  A: 

Read here to find an Excel provider.

A: 

try this also add the to dlls to your references http://code.google.com/p/linqtoexcel/wiki/UsingLinqToExcel

Hasti