Parameter '@home' specified but none of the passed arguments...Error message
Asked Answered
L

1

13

I am having an sql statement as follows:

SELECT [User].[ID], 
    [User].[Name],
    [User].[Email] 
FROM [User] 
WHERE Email = '[email protected]'' 

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 = '[email protected]'')

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.

Livelong answered 9/3, 2012 at 6:36 Comment(2)
The real question is why you aren't using parameters?Gold
PetaPoco does support named parameters. That's why this error exists.Briannebriano
M
27

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'.

Mensa answered 9/3, 2012 at 9:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.