Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 public static DbCommand ToCommand(this string sql, string connStringName)
 {
     var db=new DbCommon(connStringName);
     var cmd=db.CreateCommand(sql);
     return cmd;
 }