Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need some some with a queryfilter whereclause that is giving me a headache.. All it does is convert the search to uppercase and preform the search whether the result is uppercase or not (e.g. it will find "Jones" or JONES") I have the following code in my VBA app

Dim pQF as IQueryFilter
Set pQF = new QueryFilter
pQF.WhereClause = "upper(" & strFieldToSearch &") LIKE '%" & UCase(Replace(strSearch,"'","''")) & "%'"

in my c# code I have tried various way including

queryFilter.WhereClause =  searchField + " LIKE '%" + search.Replace("'","''") + "%'";

queryFilter.WhereClause = strSearchField.ToUpper() + " LIKE " + "'%" + strSearch.ToUpper() + "%'";

But it cant find the record.

What am I doing wrong?


share|improve this question

closed as off topic by underdark Oct 12 '12 at 17:34

Questions on Geographic Information Systems Stack Exchange are expected to relate to geographic information systems within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Just tried the following

queryFilter.WhereClause = "upper(" + strSearchField + ") LIKE'%" + strSearch.ToUpper() + "%'";

and got it working.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.