Linq to SQL case insensitive like

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
capo
Posts: 9
Joined: Fri 29 Apr 2011 22:29

Linq to SQL case insensitive like

Post by capo » Wed 07 Mar 2012 19:26

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

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Post by MariiaI » Mon 12 Mar 2012 12:58

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

Post Reply