Solved

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

Posted on 2013-05-29
2
207 Views
Last Modified: 2013-06-25
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.
0
Comment
Question by:jazz__man
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 250 total points
ID: 39204216
Is tour column of a numeric datatype? Have You tried to Cast with a .tostring?
0
 
LVL 9

Accepted Solution

by:
sarabhai earned 250 total points
ID: 39204473
0

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question