Data
|
public static IDbCommand CreateParameterizedCommand( this IDbConnection connection, string sql, params Object[] values )
Exception | Condition |
---|---|
ArgumentException | Number of IDbDataParameter arguments in sql expression, identified by '@', do not match number of supplied parameter values. |
This method does very rudimentary parsing of the SQL statement so parameter names should start with the '@' character and should be surrounded by either spaces, parentheses, or commas.
Do not use the same parameter name twice in the expression so that each parameter, identified by '@', will have a corresponding value.