// find the appropriate DB provider factory try { string requiredDBProviderFactory = getValue("/settings/DatabaseProviderFactory", "System.Data.OleDb.OleDbFactory"); if (requiredDBProviderFactory == "System.Data.SQLite.SQLiteFactory") { Logger.Verbose("...using System.Data.SQLite.SQLiteFactory DB Provider Factory"); dbProviderFactory = new System.Data.SQLite.SQLiteFactory(); } else { System.Data.DataTable providers = DbProviderFactories.GetFactoryClasses(); foreach (DataRow row in DbProviderFactories.GetFactoryClasses().Rows) { try { DbProviderFactory tempProviderFactory = DbProviderFactories.GetFactory(row); Logger.Verbose("Installed ADO.NET Provider: " + tempProviderFactory.GetType().FullName); if (tempProviderFactory.GetType().FullName == requiredDBProviderFactory) { dbProviderFactory = tempProviderFactory; Logger.Verbose("...using " + tempProviderFactory.GetType().FullName); break; } } catch (Exception ex2) { }; } } if (dbProviderFactory == null) { Logger.Error("Unable to locate DB Provider Factory...about to crash"); } } catch (Exception ex) { Logger.Verbose("Unexpected error locating DBProviderFactory: " + ex.ToString()); }