| Author |
Share Topic Topic Search Topic Options
|
WardBell
IdeaBlade
Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
|
Post Options
Quote Reply
Topic: Case InSensitive string Query Posted: 23-Aug-2010 at 12:31pm |
|
Hey great. I blamed the customer for not having the proper environment ... like mine ... like DF preview bits that you couldn't possibly have. Sorry about that!
|
 |
EisenbergEffect
Newbie
Joined: 20-Aug-2010
Location: Tallahassee, FL
Posts: 11
|
Post Options
Quote Reply
Posted: 23-Aug-2010 at 12:26pm |
|
That did it! Thanks!
|
 |
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 23-Aug-2010 at 11:20am |
We added support for serialization of the StringComparison type in 6.0.5. You can work around this now by adding this as a known type; see my reply here - http://www.ideablade.com/forum/forum_posts.asp?TID=2080.
|
 |
WardBell
IdeaBlade
Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
|
Post Options
Quote Reply
Posted: 23-Aug-2010 at 10:24am |
|
The technique definitely works ... on all of our machines. Something is not quite right in your environment. Following up with you outside the forum. I'll be back with the resolution for our genernal audience.
|
 |
EisenbergEffect
Newbie
Joined: 20-Aug-2010
Location: Tallahassee, FL
Posts: 11
|
Post Options
Quote Reply
Posted: 23-Aug-2010 at 7:00am |
Unfortunately, this solution does not work. It causes a serialization error:
There was an error while trying to serialize parameter http://ideablade.com/EntityModel:entityQuerySurrogate. The InnerException message was 'Type 'System.StringComparison' with data contract name 'StringComparison:http://schemas.datacontract.org/2004/07/System' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.
Getting this simple scenario working is *critical* for our application. I'm using version 6.0.4
Edited by EisenbergEffect - 23-Aug-2010 at 7:12am
|
 |
EisenbergEffect
Newbie
Joined: 20-Aug-2010
Location: Tallahassee, FL
Posts: 11
|
Post Options
Quote Reply
Posted: 20-Aug-2010 at 4:46pm |
|
That will work in the mean time. Thanks!
|
 |
ting
IdeaBlade
Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
|
Post Options
Quote Reply
Posted: 20-Aug-2010 at 4:14pm |
Our next build will have queries set to the SQL Server defaults (case insensitive, ignore trailing whitespace), and will have options for you to configure the behavior if you need something different.
In the meantime, you can perform the query like this: entityManager.Employees.Where(emp => emp.FirstName.Equals("Kathy", StringComparison.CurrentCultureIgnoreCase);
|
 |
bennage
Newbie
Joined: 04-Aug-2010
Location: Tallahassee, FL
Posts: 9
|
Post Options
Quote Reply
Posted: 20-Aug-2010 at 2:37pm |
|
Some additional information about this problem. The db is case insensitive.
I'm catching the generated SQL with EFPRof and when I run it manually I get a row back. Is DevForce possibly filtering the results from the db?
|
 |
EisenbergEffect
Newbie
Joined: 20-Aug-2010
Location: Tallahassee, FL
Posts: 11
|
Post Options
Quote Reply
Posted: 20-Aug-2010 at 11:05am |
|
I would like to use linq to query for all Persons with a certain Name. However, I would like to do this in a case insensitive way. Currently, I am using Name.Contains(searchText), but that isn't working.
Edited by EisenbergEffect - 02-Sep-2010 at 11:28am
|
 |