13

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.

Tao
  • 13,457
  • 7
  • 65
  • 76
learning
  • 11,415
  • 35
  • 87
  • 154

1 Answers1

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

patmortech
  • 10,139
  • 5
  • 38
  • 50