Пример #1
0
 public DbCommand BuildCommand(string connectionStringName)
 {
     var db = new DbCommon(connectionStringName);
     var cmd = db.CreateCommand(GetSql());
     foreach (var con in DbParams) {
         cmd.AddParameter(con.Name, con.Value, con.DbType);
     }
     return cmd;
 }
Пример #2
0
 public static DbCommand ToCommand(this string sql, string connStringName)
 {
     var db=new DbCommon(connStringName);
     var cmd=db.CreateCommand(sql);
     return cmd;
 }