读取Excel中的数据存到数据库,但在读的时候报错 找不到可安装的 ISAM,这个错在本地调试时没有出现,但上传到服务器的时候就出现了,我的机器是XP的系统,服务器是2003的服务器。在网上找了很多解决方法,包括修改连接字符串和注册Excel组件,但都无效。现在将错误贴出来,希望有高手来帮忙解决,谢谢
“/fwadmin”应用程序中的服务器错误。--------------------------------------------------------------------------------
找不到可安装的 ISAM。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: 找不到可安装的 ISAM。
源错误:
行 84: DataSet ds = new DataSet();行 85: 行 86: sda.Fill(ds);行 87: flag = true;行 88:
源文件: d:\Webroot\lms_deqing\fwadmin\Manager\Module\FrameWork\SystemApp\ExamManager\paper_manage\excel_up.aspx.cs 行: 86
堆栈跟踪:
[OleDbException (0x80004005): 找不到可安装的 ISAM。] System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +969373 System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +29 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4863644 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.OleDb.OleDbConnection.Open() +40 System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +94 excel_up.GetExcelData(String filePath, String& info) in d:\Webroot\lms_deqing\fwadmin\Manager\Module\FrameWork\SystemApp\ExamManager\paper_manage\excel_up.aspx.cs:86 excel_up.AddExcelPaperData(String filePath, String PAPER_ID, String CONTENT_TYPE, String AUTHOR_NAME, String& info) in d:\Webroot\lms_deqing\fwadmin\Manager\Module\FrameWork\SystemApp\ExamManager\paper_manage\excel_up.aspx.cs:109 excel_up.btnUp_Click(Object sender, EventArgs e) in d:\Webroot\lms_deqing\fwadmin\Manager\Module\FrameWork\SystemApp\ExamManager\paper_manage\excel_up.aspx.cs:52 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
也许还有人怀疑我的连接字符串,现在也贴出来,大家看下
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+filePath+";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1;'";
2 回答
- 2 回答
- 0 关注
- 396 浏览
添加回答
举报
0/150
提交
取消