Parameter '@home' specified but none of the passed arguments…Error message
-
09-12-2019 - |
Question
I am having an sql statement as follows:
SELECT [User].[ID],
[User].[Name],
[User].[Email]
FROM [User]
WHERE Email = 'user@home.com''
and it's firing an error as follows from petaPOCO:
Parameter '@home' specified but none of the passed arguments have a property with this name (in 'SELECT [User].[ID], [User].[Name], [User].[Email] FROM [User] WHERE Email = 'user@home.com'')
what does the error message implies? What is wrong with the sql statement? Does petaPOCO not accept '@' in an sql statement?I need to do a search by email address.
Solution
You need to put two @ symbols to escape the character since it is used to prefix parameters normally.
So your value would need to be 'user@@home.com
'.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow