c# - Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier -


datatable distincttable = dtable.defaultview.totable(true,"item_no","item_stock"); datatable dtsummerized = new datatable("summerizedresult");  dtsummerized.columns.add("item_no",typeof(string)); dtsummerized.columns.add("item_stock",typeof(double));  int count=0;  foreach(datarow drow in distincttable.rows) {   count++;   //string itemno = convert.tostring(drow[0]);   double totalitem = convert.todouble(drow[1]);    string totalstock = dtable.compute("sum(" + totalitem + ")", "item_no=" + drow["item_no"].tostring()).tostring();   dtsummerized.rows.add(count,drow["item_no"],totalstock); } 

error message: syntax error in aggregate argument: expecting single column argument possible 'child' qualifier.

do can me out?

thanks.

you might try this:

dtable.compute("sum([" + totalitem + "])",""); 

i.e enclose column name in square brackets [ ]

the idea this post.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -