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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -