0

I am trying the evaluate an expression using DataTable, But it's throwing the below exception on line var temp = dt.Compute(formula, filter); I have followed this documentation but it didn't help me.

Cannot evaluate. Expression 'System.Data.NameNode' is not an aggregate

string formula = "(Column * 2)";
DataTable dt = new DataTable();
dt.Columns.Add("Column");

string filter = "Column = 1"
var temp = dt.Compute(formula, filter);

The expected output is 2 here. I have followed this answer. I am just avoiding using any external library. because I tried to Flee library but it's quite unstable.

So if you pass value 3 in place of 1 to this, then it should return 6.

Vivek Nuna
  • 25,472
  • 25
  • 109
  • 197

0 Answers0