未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序

其错误如下:

System.InvalidOperationException: 未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序。    在 System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)    在 System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)    在 System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)    在 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)    在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)    在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)    在 System.Data.OleDb.OleDbConnection.Open()    在 ExcelOperation.ImportFromExcel(String fileName, String strSql)    在 Retiree_ImportData.btnImport_Click(Object sender, EventArgs e)    在 System.Web.UI.WebControls.Button.OnClick(EventArgs e)    在 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)    在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)    在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

后来了解到客户的操作系统为64位,通过IIS程序池设置中启用32位应用程序选项中设置为True,问题随即解决如下图:

 

posted on 2013-03-30 11:37  。!  阅读(243)  评论(0编辑  收藏  举报