从excel中导入数据库中字符串超过255个就被截断

解决方案 »

  1.   

    string conn = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =" + Server.MapPath("../Excelfile") + "/" + filename + ";Extended Properties=Excel 8.0";
    OleDbConnection thisconnection = new OleDbConnection(conn);
    thisconnection.Open();
    string Sql = "select * from [Sheet1$]";
    OleDbDataAdapter mycommand = new OleDbDataAdapter(Sql, thisconnection);
    DataSet ds = new DataSet();
    mycommand.Fill(ds, "[Sheet1$]");
    thisconnection.Close();
      

  2.   

    我也遇到这种情况,好像是excel本身问题,,需要设置什么东西忘记了
    不光是你写程序会被截取,你就是用sql2005的去导入也会截取255