Select to view content in your preferred language

Querytask for a mixed case letters

503
1
12-06-2013 08:59 AM
srikanthpilli
Emerging Contributor
Hi,

I am performing a query task for a layer whose display field is LINENAME.

This filed LINENAME has attributes in mixed case lettera. For example one of the atrribute is "Stone Yard".

As of now, only if I enter the attribute name as "Stone Yard" - which is as it is in the layer's non spatial data - it works, but with
mix of upper and lower case like "STone YARD" or "STONE YARD" or "stone yard" doesn't work.


Please let me know what updates I have to do for the below statement irrespective of what I enter - upper or lower case, or mix of upper and lower - the query must work :

txtRailline is the text box for the user to enter the LINENAME attribute :


query5.Where = "LINENAME ='" + txtRailline.Text.ToString(). + "'"


Thanks for going through the message and providing your inputs.
0 Kudos
1 Reply
DenisT
by
Deactivated User
The Where clause is passed to the storage as is, so the behavior depends on database settings (if you use db as the storage).
For example SQL Server has the collation settings for a db and it can be either CI (case insensitive) or CS.
Also you can use functions that your storage supports. For example string function UPPER for SQL Server:
UPPER(LINENAME)='STONE YARD'
0 Kudos