Wcf Data Service: How to handle case insensitive queries
Asked Answered
D

1

6

I have a Wcf Data Service (it uses OData protocol) and using this query I want to get all countries, that stars with 'Ca' and this works:

http://localhost/TestService/Data.svc/Countries?$filter=startswith(Name, 'Ca') eq true

But I'm unable to make it work with next query:

http://localhost/TestService/Data.svc/Countries?$filter=startswith(Name, 'ca') eq true

This is auto-complete service for countries and I don't wont to make it case sensitive. Any ideas?

D answered 9/11, 2011 at 14:25 Comment(0)
D
14

You can use tolower (or toupper), for example: /Countries?$filter=startswith(tolower(Name),tolower('Ca'))

Disvalue answered 9/11, 2011 at 19:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.