Help Postgres NET Pliss(Parameter name missing)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
felmarla
Posts: 5
Joined: Thu 24 Nov 2005 14:16

Help Postgres NET Pliss(Parameter name missing)

Post by felmarla » Fri 25 Nov 2005 17:11

public int getRegistroDecimal(string procedimiento, ref decimal salida, params Parametro[] parametros)
{
PgSqlParameter pg_codigo;
pgcoman.CommandText = procedimiento;
pgcoman.CommandType = CommandType.StoredProcedure;

foreach (Parametro param in parametros)
pgcoman.Parameters.Add(param.Nombre, param.Valor);

//PgSqlParameter pgp = new PgSqlParameter("pg_codigo", PgSqlType.Numeric);
pg_codigo=pgcoman.Parameters.Add("ent_nombre",PgSqlType.Numeric);
pg_codigo.Direction=ParameterDirection.ReturnValue;
//pgcoman.Parameters.Add(pgp).Direction = ParameterDirection.ReturnValue;
objeto = salida;
res = this.ejecutarScalar(ref objeto);
salida = (decimal) pg_codigo.Value;
//salida = (decimal) pgp.Value;
return res;
}
private int ejecutarScalar(ref object obj)
{
try
{
this.pgconec.Open();
obj = pgcoman.ExecuteScalar();
this.pgconec.Close();
return 0; //no hubo error
}
}
decimal codigoEnt = 0;
conx.getRegistroDecimal("get_codigo_entidad", ref codigoEnt,new Parametro("valor_nombre", "Mantenimiento"));
msgMensaje.ShowMessage(codigoEnt.ToString());
error
{"Parameter name is missing.\r\nParameter name: ent_nombre" }

SecureGen
Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Post by SecureGen » Mon 28 Nov 2005 08:34

It is related to http://crlab.com/forums/viewtopic.php?t=2264, please check this post

Post Reply