예제 #1
0
 public DalConfig(System.Data.Common.DbProviderFactory factory, GetConnectionString_t getConnectionString)
 {
     this.GetConnectionString = getConnectionString;
     this.ProviderFactory     = factory;
     this.ProviderFactoryType = this.ProviderFactory.GetType();
     this.ProviderName        = this.ProviderFactoryType.Namespace;
     this.ConnectionString    = getConnectionString(this);
 }
예제 #2
0
        public void SetConnectionStrings(params string[] connectionStrings)
        {
            if (connectionStrings == null)
            {
                return;
            }

            if (connectionStrings.Length > 1)
            {
                this.m_connectionCount             = connectionStrings.Length;
                this.m_connectionStrings           = connectionStrings;
                this.m_GetInternalConnectionString = GetConnectionStringFromArray;
            }

            else if (connectionStrings.Length == 1)
            {
                this.m_connectionString            = connectionStrings[0];
                this.m_GetInternalConnectionString = GetScalarConnectionString;
            }
            else
            {
                throw new System.InvalidOperationException("SqlFactory needs at least one connection string");
            }
        }
예제 #3
0
 public DalConfig(GetConnectionString_t getConnectionString) :
     this(defaultFactory, getConnectionString)
 {
 }
예제 #4
0
 public DalConfig(string providerName, GetConnectionString_t getConnectionString) :
     this(TypeFromProvider(providerName), getConnectionString)
 {
 }
예제 #5
0
 public DalConfig(System.Type t, GetConnectionString_t getConnectionString)
     : this(GetFactory(t), getConnectionString)
 {
 }