Hi everyone,
I'm developing an AddIn in C # for Microstation Connect Version 12 and I should create, by code, a rule to insert in a display rules.
If I create the following rule (REFERENCE.References.Logical Name = Attachment_1), in the Microstation environment, everything works correctly (DisplayRules1.JPG) .
If I try to create the same rule from c # Microstation I get the message "Unrecognized Criteria" (DisplayRules2.JPG)
Code Example :
"string fieldValue = "Attachment_1";
string RuleStenName = "RulSet_1"; string MyRuleCondition = $@"REFERENCE.References.Logical Name = {fieldValue}";"
Could anyone tell me what is the exact way to build this rule condition from code?
Thanks for your help,
Salvio
No,
ECQuery is object graph.
For that where criteria LHS part shows with characters that are standard TSQL in text format. For e.g., look at *Advance Search* dialog of Explorer:
But when code for where criteria for your ECQuery, you need to use something like:
query.WhereClause.Add (new PropertyExpression (RelationalOperator.LIKE, purposeProp, "Ba*"));