Esempio n. 1
0
        public override DbConnection GetConnection(DbSettings settings)
        {
            if (!(settings is DbSqlServerSettings))
            {
                throw new ArgumentException("settings must be of type DbSqlServerSettings.");
            }

            DbSqlServerSettings sqlSettings = (DbSqlServerSettings)settings;

            SqlConnection connection = new SqlConnection(sqlSettings.ConnectionString)
            {
                Credential = new SqlCredential(sqlSettings.UserID, sqlSettings.SecurePassword)
            };

            return(connection);
        }
Esempio n. 2
0
 public DbSqlServer(DbSqlServerSettings settings)
 {
     ConnectionObject = GetConnection(settings);
 }