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()); } }
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); }
public IDbConnection GetIDbConnection() { this._con = this._con ?? new SqlConnection(SqlServerDbConnectConfig.GetSqlDbConntionConfigure()); return(this._con); }