-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Issue with Dapper: Intermittent '@ParameterNames1 is not a parameter for procedure...' Error #2091
Comments
Does any part of your code use something akin to |
Thanks for replying. I used 'new {type = 1, employeeId}' and didn't get that error. I'm continuing to monitor to see if there are any other issues. |
Greetings, First off thank you dapper team for providing this library. We have also experienced this when using QueryAsync against a stored procedure and dynamic parameters passed. Until randomly it will show For anyone else experiencing the specific issue (@ParameterNames1 is not a parameter for procedure), we found the QueryMultiple functions work every time so we have moved to using this with stored procedures returning results. example of changing to querymultiple:
to
Hope that helps Many thanks |
This sounds very odd; I wonder whether there is some kind of internal strategy cache conflict happening here. I'll take a look at that, but as a side note: you could try using AOT mode - there is no strategy cache in the AOT implementation, so: nothing to get conflicted on; you can try this via: https://aot.dapperlib.dev/gettingstarted.html |
We had the same issue today. We also use DynamicParameters. We have two methods calling the same procedure: one is using QueryFirstOrDefaultAsync, and the other is using QueryMultipleAsync. The procedure is something like this:
|
I always thought that DynamicParameters would be more efficient than using anonymous types. Is this always the case? |
Hello,
I'm encountering an intermittent issue with Dapper. Occasionally, I receive the error message '@ParameterNames1 is not a parameter for procedure....' When I stop and restart the application using 'dotnet run', the error disappears, and everything works fine. However, after a while, the error reappears.
I've thoroughly checked the parameters I'm passing, and they are correct because the application runs without issues after restarting.
Could you please help me troubleshoot this issue?
Thank you.
P/s: Dapper 2.1.44 and .Net 8.0
``
The text was updated successfully, but these errors were encountered: