Hi all,
I have two excel files.
In each file two columns are there.
In first file ID And FirstName columns are there.
In second file ID And LastName columns are there.
In both files ID column values are same.
Now my requirement is compare those id columns in two files and replace the FirstName Column(in First File) values with SecondName Column(in Second File) values to corresponding ID's.
Please post code to this..
Code for comparing two .xls files(excel documents) in c sharp .net
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sam HobbsRank #108 · 20.5K reputationPosted Jun 13, 2011, 11:44 PM EDT
Create a DataSet which is an in-memory copy of data; you do not need to write the data to a database. Create two tables in the DataSet, one for the data for each spreadsheet. Use a SQL query to create a union. Use the result of that to create the new spreadsheet.
Alternatively you can read the data of each of the two spreadsheets into collections and then use LINQ to create the union.
gold spoon3 reputationPosted Jun 14, 2011, 1:49 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Jun 14, 2011, 2:29 AM EDT
Yonatan Sion2 reputationPosted Jun 20, 2011, 11:18 AM EDT
http://nobhillsoft.com/Columbo.aspx