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

后端 未结 4 880
傲寒
傲寒 2021-01-13 08:38
DataTable distinctTable = dTable.DefaultView.ToTable(true,\"ITEM_NO\",\"ITEM_STOCK\");
DataTable dtSummerized = new DataTable(\"SummerizedResult\");

dtSummerized.Co         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 09:14

    The problem is exactly about your DataType of the column. If you have a row with dynamically added columns without DataType like that (it may be a result of a manual calculation or cross-tab query-like)

    myTable.Columns.Add("AddedColumn");
    

    You will probably face with the column conversion issue. Instead, If you change your add method with pointing DataType like below

    myTable.Columns.Add("AddedColumn", typeof(System.Int32));
    

    It will work I think. It's what I experienced & fixed before...

提交回复
热议问题