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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Mar 7, 2011, 2:29 PM
Raju KatarePosted Mar 6, 2011, 11:03 PM
I know how to load excel data into DataSet.
But i need comparison.
Suthish NairPosted Mar 6, 2011, 12:23 PM
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 KatarePosted Mar 6, 2011, 3:45 AM
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.
Sam HobbsPosted Mar 5, 2011, 5:20 PM
Suthish NairPosted Mar 5, 2011, 5:51 AM