C# read the XLS file data comparison problems

Field value
Company 11231231
Company 2234234234
####
Company 31231231
Company 4234234234
This is a form of XLS, now I use C#
string strConn;
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
+ "Data Source=" + file_name + ";"
+ "Extended Properties='Excel 8.0;HDR=YES;IMEX=2;'";
OleDbConnection con = new OleDbConnection(strConn);
try
{
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", con);
con.Open();
da.Fill(myDataSet2, "ExcelInfo");
}
This way the text to read a DataSet myDataSet2 on the image.
At this time
if (myDataSet2.Tables["ExcelInfo"].Rows[i][0].ToString().Trim() == ("#####"))
{
// Operation
}

The judge does not work. Please master to help me see what the problem is!

Started by Emmanuel at November 28, 2016 - 4:17 AM

For the master solution. Good ah

Posted by Emmanuel at December 03, 2016 - 4:26 AM

if (myDataSet2.Tables["ExcelInfo"].Rows[i][0].ToString().Trim() != ("#####"))

Posted by Anita at December 13, 2016 - 4:29 AM

Heroes. Why is this?

Posted by Emmanuel at December 17, 2016 - 5:07 AM

No such

Posted by Emmanuel at December 19, 2016 - 5:28 AM

For the master. I want to break the head also don't know what's wrong.

Posted by Emmanuel at December 31, 2016 - 6:27 AM

What doesn't work?

Posted by Estelle at January 03, 2017 - 6:49 AM

if (myDataSet2.Tables["ExcelInfo"].Rows[i][0].ToString().Trim() == ("#####"))

Is the data from XLS files to DataSet, take out and a string comparison. Clearly DataSet has the word #####, but is not quite

Posted by Emmanuel at January 09, 2017 - 6:37 AM