-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameters are not working #683
Comments
What is the type of |
It is a string, i have also tried with int in other where statements with the same issue |
What if you try this?
|
I tried that prior, I tried explicitly setting the array in case that was the issue. It returns the same exception that no parameters are set, even though they are |
You'll need to post a full sample |
Version: NPoco 5.3.2
I'm using the sqlBuilder with a template as follows:
var template = sqlBuilder.AddTemplate($"select * from TABLE WHERE /**where**/");
followed by:
sqlBuilder.Where("COLUMN LIKE @0 OR COLUMN2 LIKE @0", new[]{ searchProperties.Keywords });
I can see in my breakpoint that
searchProperties.Keywords
does indeed have a value, however I get the following exception:ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Parameter '@0' specified but only 0 parameters supplied
When I look at the raw SQL generated I can see that @0 has not been replaced.
Is this a known bug, or am I doing something wrong here?
Thanks for all your help!
The text was updated successfully, but these errors were encountered: