E_FAIL(0x80004005)excel导入到数据库时出错,please!!!!
if (File.Exists(filepath)){
try
{
string strConn = "Provider=Microsoft.Jet.OleDb.4.0;" + "data source=" + @filepath + ";Extended Properties='Excel 8.0; HDR=YES; IMEX=1'";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbDataAdapter odda = new OleDbDataAdapter("select * from [" + SheetName + "$]", conn);
DataSet ds = new DataSet();
odda.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
return (System.Data.DataTable)ds.Tables[0];
}
}
catch
{ }
补充:.NET技术 , ASP.NET