Search found 2 matches

by AngelV
Tue 07 Sep 2010 17:11
Forum: LinqConnect (LINQ to SQL support)
Topic: How to generate case insensitive LIKE comparision with LINQ?
Replies: 22
Views: 27806

StanislavK wrote:At the moment, the comparison is case-sensitive/case-insensitive depending on the settings in the database. I.e., as MySQL servers are case-insensitive by default, strings are compared case-insensitively too. If the server is set to be case-sensitive, the simplest way to make your query case-insensitive is to use the ToLower/ToUpper method on the strings used:

Code: Select all

var query = from item in MyDataContext.Tables
	    where item.StringColumn.ToLower() == "Value".ToLower()
	    select item;
Feel free to contact us if something is unclear.
I thought that your solution would simply implicate to omit in your routines
the parameter "BINARY" so that the function LIKE could perform alone,
so that's ok, I just implemented the following to keep using the LIKE
function itself. Thanks

Code: Select all

query = query.Where(t => t.Department.ToLower().Contains(name.ToLower()));
by AngelV
Thu 02 Sep 2010 05:48
Forum: LinqConnect (LINQ to SQL support)
Topic: How to generate case insensitive LIKE comparision with LINQ?
Replies: 22
Views: 27806

AndreyR wrote:We have added the support for case-insensitive comparison in LINQ to MySQL.
Hello

I have the same problem and I have tried to find ways to use this type of comparison but can not find it, how access to this or how I can use it?. Have you an example?

I have dotConnect for MySQL 5.80.146.0

Thank you.