Require Syntax example, for a WhereClause populated from a ComboBox and a ListBox
Hi All,
I’m trying to use the values from a ComboBox and then a ListBox to be passed into a Where Clause to produce a report.
First question: Do I use the ‘ID:’ or the ‘Argument Name:’ from the ComboBox and the ListBox to be passed into the WhereClause?
Second Question: What is the basic Syntax I need to use? I have an Assign activity (see pic), WhereClause = (Below are some examples of combinations I have tried.) Am I even close?
"(Category = "'"ComboBox11"'" AND CrossingCategory = "'"ListBox22"'")"
"Category = ('" + ComboBox11.ToString() + "') AND CrossingCategory = ("' + ListBox22.ToString() + "')"
"Category = ComboBox11 AND CrossingCategory = ListBox22"
FYI
ID: = ComboBox1
Argument Name: = ComboBox11
ID: = ListBox2
Argument Name: = ListBox22
This is an example of an ArcGIS Definition Query that works
Category = 'Case 1B MP Gas Trunkline' AND CrossingCategory = 'Power'
/customer/servlet/servlet.FileDownload?file=00P6000000em1hfEAA
Thanks
-
Hi All,
FYI
This has been solved, see below for example of syntax that worked
"Category = '" + ComboBox111.ToString + "' and CrossingCategory = '" + ListBox222.ToString + "'"
(Using a ListBox with a Selection Mode: as Multple)
"Category = '" + ComboBox111.ToString + "' and CrossingCategory IN ('" + String.Join("','", CType(ListBox222, Object())) + "')"
Also for my first question, I needed to create a new Variables (as Objects) for the Display's form "Output Arguments"
e.g. ComboBox11 - ComboBox111 and ListBox22 - ListBox222
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar