原连接字符串为(strConn = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + filePath + ";" + "Extended Properties=Excel 12.0 Xml;";)
当第一行不为标题为数据时,读取不到第一行数据,后面把连接字符串改为(strConn = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + filePath + ";" + "Extended Properties=\"Excel 12.0 Xml;HDR=NO\"";),就可以成功读取到文件中的第一行数据。