Code: Select all
using (var command = new PgSqlCommand("PKG_PROCESS_UPSERT_PROCESS", dbConnection)
{
ParameterCheck = true,
CommandType = CommandType.StoredProcedure
})
{
// At this point, command.Parameters.Count should be 21.
}
I have not found a pattern to when this works.
To deal with this, I have modified my code like this:
Code: Select all
using (var command = new PgSqlCommand("PKG_PROCESS_UPSERT_PROCESS", dbConnection)
{
ParameterCheck = true,
CommandType = CommandType.StoredProcedure
})
{
if (command.Parameters.Count <= 0)
{
command.ParameterCheck = false;
PgSqlCommandBuilder.DeriveParameters(command);
}
// At this point, command.Parameters.Count is ALWAYS 21.
}
What is going on?
Is there a bug in ParameterCheck with regard to stored procedures?
Should I just skip ParameterCheck and always depend on the DeriveParameters method for stored procedures?
Regards,
Bill.