为什么我从exl 文件中读取 的时候 如果 某一个单元格的字数太多 那么dataset里的数据就不全 总是别截取掉 为什么呢
string connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1';";
OleDbConnection conn = new OleDbConnection(connstring);
//得到sheet表名
conn.Open();
DataTable allSheet = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
conn.Close();
StringBuilder message = new StringBuilder();
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [下载简历列表$]", conn);
DataSet userList = new DataSet();
adapter.Fill(userList, "UserList");
string name = (userList.Tables[0].Rows[0][0]).ToString();
if (!string.IsNullOrEmpty(name))
name = name.Replace("/", "").Replace(",", "").Trim();
string sheetName = string.Format("'{0}#{1}$'", new object[] { 1, name });
adapter.SelectCommand = new OleDbCommand("SELECT * FROM [" + sheetName + "]", conn);
DataSet ds = new DataSet();
adapter.Fill(ds, "ds");