コード例 #1
0
ファイル: DbGateway.cs プロジェクト: tu226/Eagle
        static DbGateway() 
        {
            if (ConfigurationManager.ConnectionStrings == null ||
                ConfigurationManager.ConnectionStrings.Count.Equals(0))
            {
                throw new ConfigException("Please provide a connection string including name, provider and connection string.");
            }

            string connectionStringSectionName = ConfigurationManager.ConnectionStrings[0].Name;

            DbProvider dbProvider = DbProviderFactory.CreateDbProvider(connectionStringSectionName);

            defaultDbGateway = new DbGateway(new Database(dbProvider));
        }
コード例 #2
0
        static DbGateway()
        {
            if (ConfigurationManager.ConnectionStrings == null ||
                ConfigurationManager.ConnectionStrings.Count.Equals(0))
            {
                throw new ConfigException("Please provide a connection string including name, provider and connection string.");
            }

            string connectionStringSectionName = ConfigurationManager.ConnectionStrings[0].Name;

            DbProvider dbProvider = DbProviderFactory.CreateDbProvider(connectionStringSectionName);

            defaultDbGateway = new DbGateway(new Database(dbProvider));
        }
コード例 #3
0
ファイル: DbGateway.cs プロジェクト: tu226/Eagle
 public static void SetDefaultDatabase(DatabaseType databaseType, string connectionString)
 {
     defaultDbGateway = new DbGateway(new Database(CreateDbProvider(databaseType, connectionString)));
 }
コード例 #4
0
ファイル: DbGateway.cs プロジェクト: tu226/Eagle
 public static void SetDefaultDatabase(string connectionStringSectionName) 
 {
     defaultDbGateway = new DbGateway(connectionStringSectionName);
 }
コード例 #5
0
 public static void SetDefaultDatabase(DatabaseType databaseType, string connectionString)
 {
     defaultDbGateway = new DbGateway(new Database(CreateDbProvider(databaseType, connectionString)));
 }
コード例 #6
0
 public static void SetDefaultDatabase(string connectionStringSectionName)
 {
     defaultDbGateway = new DbGateway(connectionStringSectionName);
 }