Getting error : Must be non-negative and less than the size of the collection.

Oct 17, 2012 at 12:45 PM

Hi,

Below code is giving error to me.

 

string expr = "If(19 in (13,19,28,33,48,71,73,101,105,114,116,117,118,121,122,125,130,143),1,0)"

;

 

ExpressionContext context = new ExpressionContext

();

context.Imports.AddType(

typeof(Math

));

 

IDynamicExpression

eDynamic = context.CompileDynamic(expr);

 

int result = (int

)eDynamic.Evaluate();

 

it looks problem with length of expression. Can you please give me the solution for this.