Page 1 of 1

Linq to SQL case insensitive like

Posted: Wed 07 Mar 2012 19:26
by capo
Hello,
I am using Devart LinqConnect Model and have some issues making the autofilter feature of my grid to filter case insensitive.

I found a property in the Entity Model documentation to set a CaseInsensitiveLike.
config.QueryOptions.CaseInsensitiveLike = true;

I tried this in a little test project using the EntityModel and it works. Unfortunately I use a LinqConnect Model in my project. Is there a similar property which I can set?

Is it a good idea to switch the model from LinqConnect to an EntityModel?
What is the difference? It looks like the EntityModel supports all the my Linq-Queries as well. Is there a comparison table of this two models.

Thanks,
Christian

Posted: Mon 12 Mar 2012 12:58
by MariiaI
The question about CaseInsensitiveLike has already been discussed on our forum.
Follow the link http://www.devart.com/forums/viewtopic.php?t=14937
In two words, you can use StringComparison.CurrentCultureIgnoreCase as the second argument in the StartsWith, EndsWith or IndexOf methods to generate a command with case-insensitive LIKE.

As for the differences between Entity Data Models and LinqConnect models, LinqConnect is an ORM developed closely to LINQ to SQL, and Entity Data Models work with Entity Framework.
For some discussion of LINQ to SQL and Entity Framework differences, please see
http://stackoverflow.com/questions/8676 ... inq-to-sql
http://msdn.microsoft.com/en-us/library/cc161164.aspx