将excle文件上传到gridview时找不到可安装的isam错误 [英] could not find installable isam error while uploading the excle file into gridview

查看:88
本文介绍了将excle文件上传到gridview时找不到可安装的isam错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void Page_Load(object sender, EventArgs e)
   {
       OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.Oledb.4.0;DataSource=E:\Naveen\school.xls;Extended Properties=Excel 4.0;HDR=yes");
       try
       {
           OleDbDataAdapter da = new OleDbDataAdapter("select * from [student$]", con);
           DataSet ds = new DataSet();
           da.Fill(ds);
           GridView1.DataSource = ds;
           GridView1.DataBind();
       }
       catch (Exception ex)
       {
           Label1.Text = ex.Message;
       }
       finally
       {
           Label1.Text = "Data Loaded Successfully";
       }
   }



但我没有完全得到我的要求



but im not getting my requirement exactly

推荐答案

",等等); DataSet ds = DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } 捕获(例外) { Label1.Text = ex.Message; } 最终 { Label1.Text = " ; } }
", con); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } catch (Exception ex) { Label1.Text = ex.Message; } finally { Label1.Text = "Data Loaded Successfully"; } }



但是我没有完全满足我的要求



but im not getting my requirement exactly


可能是连接字符串错误.在这里查看: http://www.connectionstrings.com/ [
Probably, the connection string is wrong. Have a look here: http://www.connectionstrings.com/[^]. Go to Data files section and choose the correct version of Excel.


这篇关于将excle文件上传到gridview时找不到可安装的isam错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆