public string LoadConfig()
        {
            string    configPath = AppSettingConfig.GetAppSetting()["AppSetting:sqlconfigPath"];
            XDocument xDoc       = this.LocalConfig(configPath);
            var       sc         = from t in xDoc.Root.Elements("sqlconntionitem")
                                   select SqlServerDbConnectConfig.CreaterConfigureItem(t);

            var s = sc.First();

            return(sc.First().ToString());
        }
 public static string GetSqlDbConntionConfigure()
 {
     lock (obj)
     {
         if (sqlServerDbConnectConfig == null)
         {
             sqlServerDbConnectConfig = new SqlServerDbConnectConfig();
             return(sqlServerDbConnectConfig.LoadConfig());
         }
         return(sqlServerDbConnectConfig.LoadConfig());
     }
 }
Ejemplo n.º 3
0
        public IDbCommand GetIDbCommand()
        {
            SqlCommand sqlCommand = null;

            if (this._con == null)
            {
                this._con = this._con ?? new SqlConnection(SqlServerDbConnectConfig.GetSqlDbConntionConfigure());
            }
            if (this._con.State == ConnectionState.Closed)
            {
                this._con.Open();
            }
            sqlCommand = this._con.CreateCommand();
            return(sqlCommand);
        }
Ejemplo n.º 4
0
 public IDbConnection GetIDbConnection()
 {
     this._con = this._con ?? new SqlConnection(SqlServerDbConnectConfig.GetSqlDbConntionConfigure());
     return(this._con);
 }