[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2013-05-29
2
Medium Priority
?
223 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 1000 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 1000 total points
ID: 39204473
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

650 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