c# - "cannot be assigned to -- it is read only" error on ConditionExpression -
i have create "between date" condition.
when write this:
conditionexpression modifiedoncondition = new conditionexpression(); modifiedoncondition.attributename = "modifiedon"; modifiedoncondition.operator = conditionoperator.between; modifiedoncondition.values = new object[] { startdate, enddate };
startdate
, enddate
datetime
. got error on modifiedoncondition.values
. says:
property or indexer 'microsoft.xrm.sdk.query.conditionexpression.values' cannot assigned -- read only
how can fix it?
you can't change values
property after object has been created, pass parameter in conditionexpression
constructor:
var modifiedoncondition = new conditionexpression( "modifiedon", conditionoperator.between, new object[] { startdate, enddate });
Comments
Post a Comment