如題 Excel導(dǎo)入數(shù)據(jù)到SqlServer中提示:定義了過多字段?源碼:// fileName 文件名//savePath 路徑 DataSet ds = null; try { string myString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + savePath + fileName + ";Extended Properties='Excel 8.0;HDR=No;IMEX=1'"; OleDbConnection oconn = new OleDbConnection(myString); oconn.Open(); ds = new DataSet(); OleDbDataAdapter oda = new OleDbDataAdapter("select * from [Sheet1$]", oconn); oda.Fill(ds); oconn.Close(); } catch (Exception ea) { My.ClientScript.Alert(this, "提供的文檔錯誤:" + ea.Message); } return ds;
- 2 回答
- 0 關(guān)注
- 1056 瀏覽
添加回答
舉報
0/150
提交
取消