Select to view content in your preferred language

feature selection: Attribute query

623
2
05-22-2011 09:23 PM
shivagugila
Deactivated User
Greeting,

I am trying to select features using attribute query. Variable are referenced to listbox. Can anyone please let me why my whereclause is set to false and i am unable to select the features.
please ref the attached screenshot.

pqf.WhereClause = fieldname = fieldvalue     :    is the expression i used to implement fieldname and fieldvalue as variables.Tried various options like using &, ", ( etc etc...but did not find a way to use both as variables(fieldname and fieldvalue).

thanks n regards,
shiva
0 Kudos
2 Replies
NeilClemmons
Honored Contributor
The WhereClause property expects a string, therefore you must set it using a string expression.

queryFilter.WhereClause = fieldName & " = '" & stringValue & "'"

If the field isn't a text field then you must remove the single quotes.
0 Kudos
shivagugila
Deactivated User
Thanks Neil,

That single quote made the difference....( i missed that in my line of code)

thanks for the info.
have a nice day..

regards,
shiva
0 Kudos