public static DataSet Run(IDBHelper db, string sql)
 {
     using(DbConnection conn = db.CreateConnection())
     {
         conn.Open();
         DbCommand cmd = conn.CreateCommand();
         cmd.CommandText = sql;
         using (DbDataAdapter adapter = db.CreateDataAdapter())
         {
             DataSet ds = new DataSet();
             adapter.SelectCommand = cmd;
             adapter.Fill(ds);
             return ds;
         }
     }
 }
Esempio n. 2
0
 public DbConnection CreateConnection()
 {
     return(_IDBHelper.CreateConnection(Config.GetInstance().DB));
 }