Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier.

Posted by Rushabh on Stack Overflow See other posts from Stack Overflow or by Rushabh
Published on 2011-04-12T15:01:35Z Indexed on 2011/06/25 0:22 UTC
Read the original article Hit count: 1659

Filed under:
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 a single column argument with possible 'Child' qualifier.

Do anyone can help me out?

Thanks.

© Stack Overflow or respective owner

Related posts about c#