Link to home
Start Free TrialLog in
Avatar of jazz__man
jazz__man

asked on

Linq statement _MyList .Where(c => c.ListItem.Contains(txt.Text)); generates invalid sql like syntax

I am running code like the code below to filter my results in _MyList, this code has ran for ages without any problems but it is now not working for some reason. I had a look at the sql that is being generated and it is building an invalid where clause like this

Result of sql generated from linq code
WHERE [t].[MyColumn] LIKE %12345%


Here is the linq code
_MyList = _MyList .Where(c => c.ListItem.Contains(txt.Text));

Be very grateful for your help.
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial