我正在使用VS 2010與MS Access 2010. Microsoft Access數據庫引擎2010也安裝。 OS版本是帶有64位操作系統的Window 7 Enterprise。SEHException外部組件已引發異常
下面是我的代碼,我收到異常。我也粘貼堆棧軌道。
DCXManagerTableAdapters.AppDefaultOptionTableAdapter dataAdapter = new DCXManagerTableAdapters.AppDefaultOptionTableAdapter();
dataAdapter.Connection.ConnectionString = DB.ConnectionString;
if (dataAdapter.Connection.State == ConnectionState.Closed)
{dataAdapter.Connection.Open();} \* Here i am getting exception
內部異常:System.Runtime.InteropServices.SEHException (0X80004005):外部組件引發的異常。在 System.Data.OleDb.DataSourceWrapper.InitializeAndCreateSession在 System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString 構造,OleDbConnection的連接)在 System.Data.OleDb.OleDbConnectionFactory(OleDbConnectionString 構造,SessionWrapper & sessionWrapper)。創建連接(DbConnectionOptions 選項,DbConnectionPoolKey poolKey,對象poolGroupProviderInfo, 池類DBConnectionPool,的DbConnection owningObject)在 System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions 選項,DbConnectionPoolKey poolKey,對象poolGroupProviderInfo, 池類DBConnectionPool,的DbConnection owningConnection, 個DbConnectionOptions USEROPTIONS)在 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(的DbConnection owningConnection,DbConnectionPoolGroup poolGroup,DbConnectionOptions USEROPTIONS)在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(的DbConnection owningConnection,TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1重試,DbConnectionOptions USEROPTIONS )在在 System.Data.ProviderBase.DbConnectionInternal.OpenConnection System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(的DbConnection outerConnection,DbConnectionFactory connectionFactory的, TaskCompletionSource`1重試,DbConnectionOptions USEROPTIONS)(的DbConnection outerConnection,DbConnectionFactory connectionFactory的)在 System.Data.OleDb.OleDbConnection.Open()在 Branson.DataAccess.Providers.GraphTabProvider.GetAppDefaultOption()在 d:\ BRANSON-SVN \解\ Branson.DataAccess \提供商\ GraphTabProvider的.cs:線 180在Branson.Controller.GraphTabController.GetAppDefaultOption() 在 d:\ BRANSON-SVN \解\ Branson.Controller \ GraphTabController.cs:線 37在Branson.DCXManager.App.OnStartup(StartupEventArgsË )在 D:\ BRANSON-SVN \ Solution \ Branson.DCXManager \ Branson.DCXManager \ App.xaml.cs:行 174在System.Windows.Application。 < .ctor> b__1(對象未使用的)在 System.Windows.Threading.ExceptionWrapper.InternalRealCall在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(對象 源(代表 回調,對象指定參數時,的Int32 numArgs),委託方法,對象指定參數時,的Int32 numArgs,代表 catchHandler)
它看起來像錯誤是打開連接到數據庫。你的連接字符串是什麼? –
你有沒有想過這個? –