I use C# and I instantiate a DbCommand
in order to execute an Oracle stored procedure.
My question is: why does the procedure receive the value through a different named parameter than the on in db?
When I add a parameter to the dbCommand
:
...
string value = "Whatever"
db.AddInParameter(dbCommand,"WrongParamName",DbType.String);
db.SetParameterValue(dbCommand, "WrongParamName", value);
and I execute:
dataSet = db.ExecuteDataSet(dbCommand);
It will pass the dbCommand
parameter to the stored procedure parameter correctly.
Why is that?
Does it set the value to the first parameter without a value or is it based on position?
If it's based on position why do we need the name for?
Is the name only to help the dev understand the code?