very easy small question:c#导入excel的问题。
欲导入excel文件作为dataset来填充datagrid,已经将excel9.olb转化,并将Microsoft Excel 10.0添加项目引用了,我的是xp+officexp+sql2000+.net1.0.3705
代码:
private void Form1_Load(object sender, System.EventArgs e)
{
string connstr="provider=Microsoft.Jet.OLEDB.4.0;Data Source=myexcel.xls;Extended Properties=\"Excel 8.0\";HDR=yes;";
OleDbConnection conn=new OleDbConnection();
try
{
conn.ConnectionString=connstr;
conn.Open();
}
catch(OleDbException ex)
{
MessageBox.Show(ex.Message);
}
conn.Close();
}
错误提示:未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll 中
捕捉错误后错误提示:找不到可安装的ISAM
请问还有那些配置要修改还是代码不对?请高手指点!