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.
LVL 2
jazz__manAsked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Is tour column of a numeric datatype? Have You tried to Cast with a .tostring?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.