Пример #1
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);
        }
Пример #2
0
 public IDbConnection GetIDbConnection()
 {
     this._con = this._con ?? new SqlConnection(SqlServerDbConnectConfig.GetSqlDbConntionConfigure());
     return(this._con);
 }