public ConnectionStringBuilder(GenDatabase db)
 {
     GenDatabase = db;
     DbConnectionStringBuilder = GenDatabase.DbProviderFactory.CreateConnectionStringBuilder();
     if (db.GenProviderType == GenProviderType.OleDb)
         ((OleDbConnectionStringBuilder)DbConnectionStringBuilder).Provider = GenDatabase.OleDbName;
 }
 public OwlDatabaseInfo(DeviceManagerSettings owlSettings, SystemServices systemServices)
 {
     Settings = owlSettings;
     SystemServices = systemServices;
     OwlDb = null;
     ApplianceListInternal = null;
 }
Exemplo n.º 3
0
 internal GenConnection(GenDatabase db, bool isGlobal = false)
 {
     DbConnection = db.DbProviderFactory.CreateConnection();
     DbConnection.ConnectionString = db.ConnectionString;
     GenDatabase = db;
     IsGlobal = isGlobal;
     Id = NextId++;
     CreationThread = System.Threading.Thread.CurrentThread.ManagedThreadId;
     CreationTime = DateTime.Now;
 }
Exemplo n.º 4
0
        public GenCommand(String commandText, GenConnection connection)
            : base()
        {
            GenDatabase = connection.GenDatabase;
            DbCommand = GenDatabase.DbProviderFactory.CreateCommand();
            DbCommand.CommandText = commandText;
            DbCommand.Connection = connection.InnerConnection;
            GenConnection = connection;

            if (GenDatabase.UtilityLog.LogDatabase)
                GenDatabase.UtilityLog.LogMessage("GenCommand.GenCommand", "id: " + connection.Id +
                        " - creation thread: " + connection.CreationThread +
                        " - this thread: " + System.Threading.Thread.CurrentThread.ManagedThreadId +
                        " - command: " + commandText, LogEntryType.Database);
        }
Exemplo n.º 5
0
        private GenDatabase GetDatabase()
        {
            GenDatabase db = new GenDatabase(Settings.Host, Settings.Database,
                Settings.UserName, Settings.Password,
                Settings.DatabaseType, Settings.ProviderType,
                Settings.ProviderName, Settings.OleDbName,
                Settings.ConnectionString, Settings.DefaultDirectory, SystemServices);

            return db;
        }
 public void LoadApplianceList()
 {
     OwlDb = null; // Force new database settings in use (if changed)
     OwlAppliances = GetApplianceList();
 }
 private GenDatabase GetDatabase()
 {
     if (OwlDb == null)
     {
         if (Settings.OwlDatabase != "")
         {
             try
             {
                 OwlDb = new GenDatabase("", Settings.OwlDatabase, "", "", "SQLite", "Proprietary",
                 "System.Data.SQLite", "", "", Settings.ApplicationSettings.DefaultDirectory, SystemServices);
             }
             catch(Exception)
             {
             }
         }
     }
     return OwlDb;
 }
Exemplo n.º 8
0
 public GenCommand(GenDatabase db)
     : base()
 {
     GenDatabase = db;
     DbCommand = db.DbProviderFactory.CreateCommand();
 }