funtion parameters and calling from .NET using DAAB
Posted: Wed 21 Apr 2010 04:10
Hi guys,
if have a PGSQL function called
in C# I am calling this with
The above code will work fine becuase the parameters are in the same order as the function.
If I change the order of parameters in C#
I Get an Error. Does the parameters have to be in order listed in the function or can they be in any order as long as we have the correct parameter names???
TIA
Fred
if have a PGSQL function called
Code: Select all
function Getcurrentworkflows(detnumber text, onlyformanager integer, sall integer)
Code: Select all
Database db = DatabaseFactory.CreateDatabase();
string sqlCommand = "Getcurrentworkflows";
DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);
db.AddInParameter(dbCommand, "detnumber", DbType.String, "SSSSS");
db.AddInParameter(dbCommand, "onlyformanager ", DbType.Int32, 1);
db.AddInParameter(dbCommand, "sall", DbType.Int32, 1);
DataSet ds = db.ExecuteDataSet(dbCommand);
If I change the order of parameters in C#
Code: Select all
db.AddInParameter(dbCommand, "onlyformanager ", DbType.Int32, 1);
db.AddInParameter(dbCommand, "detnumber", DbType.String, "SSSSS");
db.AddInParameter(dbCommand, "sall", DbType.Int32, 1);
TIA
Fred