Hi All,
I am openning an excel file using an OleDbConnection in c# in .NET Framework 3.5.
The connection string is:
string mycon = "provider=Microsoft.Jet.OLEDB.4.0; data source=" + filePath + ";Extended Properties='Excel 8.0;IMEX=1';"
When I open this excel:
FirstName | MiddleName | LastName
---------------------------------
fname1 | m1 | lname1
And execute this query using OleDbCommand.ExecuteReader:
"Select * FROM [Sheet1$] where F1='fname1' and F2='m1' and F3='lname1'"
It works well.
But when I change the excel into this:
FirstName | MiddleName | LastName
---------------------------------
fname1 | | lname1
And execute a query using this:
"Select * FROM [Sheet1$] where F1='fname1' and F2='' and F3='lname1'"
Or this:
"Select * FROM [Sheet1$] where F1='fname1' and F2=null and F3='lname1'"
It yields no result.
I really need your help.
Thanks in advance.