If a column in the table is all numbers or characters, there is no problem, but if there is a mixture of all numbers and some characters, some parts will be read as empty. The connection method to EXCEL is as follows
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0; " +"Data Source=" + _physicalPath +";Extended Properties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
First, I directly FILL into the DATASET, thinking that the data type was incorrect, and then I built a temporary datatable. When I imported it, it still had a null value. I searched on the Internet and found the same problem but couldn't solve it.
string strConn = Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + _physicalPath + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1';";
http://www.cnblogs.com/newblue/archive /2006/11/27/573831.html