I call the stored procedure in Sybase ASE using the provider "ASEOLEDB.1".
SP takes one varchar (255) argument, called @PricePreference, which defaults to NULL in SP.
I use the Dapper QueryMultiple method and pass in a DynamicParameters object:
var parameters = new DynamicParameters();
parameters.Add("@PricePreference", "Foo");
var reader = dbConnection.QueryMultiple("myProcName", parameters, commandType: CommandType.StoredProcedure);
This code behaves as if I didn't pass the parameter at all. This is apparently due to the fact that the AddParameters () method in the Dapper DynamicParameters class calls Clean () for my parameter name, which removes the '@' prefix (or the equivalent for other DBMSs) - see โWorking with Parameter Keepersโ on MSDN is here ).
Without the '@' prefix, Sybase cannot match the argument.
Conversely, when I comment on the Clean () call, I get the correct result from the query.
What is the point of removing the '@' prefix?
source
share