c#读excel的问题
string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source ="+Path+";Extended Properties=Excel 8.0" ;
OleDbConnection myConn = new OleDbConnection ( strCon ) ;
string strCom = " SELECT * FROM [123$] " ;
myConn.Open() ;
OleDbDataAdapter myCommand = new OleDbDataAdapter ( strCom , myConn ) ;
DataSet myDataSet = new DataSet();
myCommand.Fill(myDataSet);
OleDbCommand dm=new OleDbCommand( strCom , myConn );
OleDbDataReader drmain=dm.ExecuteReader();
int i=0;
while (drmain.Read())
{
try
{
for( int j=0;j<10;j++)
{
bb[i,j]=drmain[j].ToString();
}
}
catch
{}
i++;
}
drmain.Close();
myConn.Close();
其中有一个字段读不出来.其它的字段都能读出.为什么?