Extended Properties=\"Excel 8.0;IMEX=1\""   
在连接串中添加上面的属性

解决方案 »

  1.   


    谢谢高手,再请教一下,IMEX=1 是什么意思?
    然后我看到还有的加入一个参数 HDR=yes 是什么意思?
      

  2.   

    在生成excel的时候,把该列作为文本类型保存就不会有这个问题了
      

  3.   

    连接字符串是这样的:
                OleDbConnectionStringBuilder oleconnstrbuilder = new OleDbConnectionStringBuilder();
                oleconnstrbuilder.DataSource = oleconnstr;
                oleconnstrbuilder.Provider = "Microsoft.Jet.OLEDB.4.0";
                oleconnstrbuilder.Add("Extended Properties", "Excel 8.0");
                //oleconnstrbuilder.Add("HDR", "YES");
                oleconnstrbuilder.Add("IMEX", "1");
                OleDbConnection oleconn = new OleDbConnection(oleconnstrbuilder.ConnectionString);
                return oleconn;现在报错说 could not find installable ISAM
    希望高手能继续指导一下
      

  4.   

    string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileName + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1;'";
    OleDbConnection conn = new OleDbConnection(strConn);
      

  5.   

    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileName + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1;'"
    已经加进去了,但是那个列中的数据字母混杂的字符串还是没有读到,Thank you all the same