Npgsql pass parameters by name to a stored function

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2010-03-04T20:28:49Z Indexed on 2010/04/23 14:43 UTC
Read the original article Hit count: 919

Filed under:
|
|
|

I'm working with code I'm converting to Pgsql working with .NET. I want to call a stored function that has several parameters, but I'd like to bind the parameters by name, like so:

NpgsqlCommand command = new NpgsqlCommand("\"StoredFunction\"", _Connection)
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("param2", value2);
command.PArameters.Add("param1", value1);

Attempts to do this so far look for a function with parameter types matching in the order in which I added the parameters to the collection, not by name.

Is it possible for Npgsql to bind parameters to stored functions by name?

© Stack Overflow or respective owner

Related posts about pgsql

Related posts about npgsql