string fileName;
DataSet myDataSet= new DataSet();
OpenFileDialog fileChooser=new OpenFileDialog();
DialogResult result1=fileChooser.ShowDialog();
fileChooser.CheckFileExists=false;
if(result1==DialogResult.Cancel)
{
return;
}
fileName=fileChooser.FileName;
if(fileName==""||fileName==null)
{
MessageBox.Show("不合法的文件名!","错误信息",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
else
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(oleDBConnString);
conn.Close();
conn.Open();
ArrayList ary=new ArrayList();
OleDbDataAdapter myCommand = new OleDbDataAdapter("SELECT * FROM [Sheet1]",conn);
myCommand.Fill(myDataSet,"table1");
}

当它运行到myCommand.Fill(myDataSet,"table1");
提示"Microsoft Jet 4.0 数据库引擎找不到"Sheet1" 对象"
可是我明明是通过打开文件的方式获得的这个文件,怎么会找不到呢?