Hi
I am using v2.0, Adapter.
I am trying to create a windows form that allows me to specify criteria for fetching records into a dynamic list which is bound to a datagrid. I have the following code:
EntityField2 afield = (EntityField2) employee.Fields[cbCritFields1.SelectedItem.ToString()];
bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareExpressionPredicate(afield,null,ComparisonOperator.GreaterThan, txtValue1.Text));
cbCritFields1 is a combo box, that contains a list of fields
I get the following error:
Error 2 Argument '4': cannot convert from 'string' to 'SD.LLBLGen.Pro.ORMSupportClasses.IExpression'
But if I change the above code to:
EntityField2 afield = (EntityField2) employee.Fields[cbCritFields1.SelectedItem.ToString()];
bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(afield > txtValue1.Text);
There is no problem and the results come back properly. What is the difference, and how can I make the first one work?
Appreciate your response
Weera