コード例 #1
0
ファイル: DbAccess.cs プロジェクト: snielsson/SqlFu
        public DbAccess(string connectionStringName)
        {
            var cnx = ConfigurationManager.ConnectionStrings[connectionStringName];

            if (cnx == null)
            {
                throw new InvalidOperationException("I need a connection!!!");
            }

            Init(cnx.ConnectionString, ProviderFactory.GetProviderByName(cnx.ProviderName));
        }
コード例 #2
0
ファイル: SqlFuConnection.cs プロジェクト: valipan/SqlFu
        public SqlFuConnection(string connectionStringName)
        {
            var cnx = ConfigurationManager.ConnectionStrings[connectionStringName];

            if (cnx == null)
            {
                throw new InvalidOperationException(
                          "Can't find connection '{0}' in the configuration file.".ToFormat(connectionStringName));
            }

            Init(cnx.ConnectionString, ProviderFactory.GetProviderByName(cnx.ProviderName));
        }
コード例 #3
0
ファイル: SqlFuConnection.cs プロジェクト: valipan/SqlFu
        internal SqlFuConnection()
        {
            var cnx = ConfigurationManager.ConnectionStrings[0];

            if (cnx == null)
            {
                throw new InvalidOperationException(
                          "I need a connection! Either call SqlFu.ConnectionStringIs() method or define a connection in config file. If there are more than one connection defined, call SqlFu.ConnectionNameIs() method");
            }

            Init(cnx.ConnectionString, ProviderFactory.GetProviderByName(cnx.ProviderName));
        }
コード例 #4
0
ファイル: DbAccess.cs プロジェクト: snielsson/SqlFu
 public DbAccess(string cnxString, string provider)
 {
     Init(cnxString, ProviderFactory.GetProviderByName(provider));
 }
コード例 #5
0
ファイル: SqlFuConnection.cs プロジェクト: valipan/SqlFu
 public SqlFuConnection(string cnxString, string provider)
 {
     Init(cnxString, ProviderFactory.GetProviderByName(provider));
 }