How to compare the data (any data) of one excel file with another excel file in asp.net with c#?
If some set of data matches then I want to display excel file?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Mar 5, 2011, 12:51 AM EST
Sam HobbsRank #107 · 20.5K reputationPosted Mar 5, 2011, 12:20 PM EST
Raju KatareRank #1,971 · 742 reputationPosted Mar 5, 2011, 10:45 PM EST
Excel_1 Excel_2
Want to compare "Abs" column values of Excel_1 starting from A16 (nm 200.0) with "Abs" column values of Excel_2 starting from A16 (nm 200.0).
If some set of "Abs" values of Excel_1 matches with Excel_2 , then i want to display Excel_2 file as a output.
Suthish NairRank #92 · 22.8K reputationPosted Mar 6, 2011, 7:23 AM EST
using System.Data;
using System.Data.OleDb;
String sConnectionString = "OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
OleDbConnection objConn = new OleDbConnection(sConnectionString);
objConn.Open();
OleDbCommand objCmdSelect =new OleDbCommand("SELECT * FROM [Sheet1$]", objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
objAdapter1.SelectCommand = objCmdSelect;
DataSet objDataset1 = new DataSet();
objAdapter1.Fill(objDataset1);
objConn.Close();
For connection string..
http://www.connectionstrings.com/excel
Raju KatareRank #1,971 · 742 reputationPosted Mar 6, 2011, 6:03 PM EST
I know how to load excel data into DataSet.
But i need comparison.
Suthish NairRank #92 · 22.8K reputationPosted Mar 7, 2011, 9:29 AM EST