Good morning,
I need help in the following, I have a table that is filled by a DataTable, now I include my project a dropdownlist (DDL) to change a column in specifies depending on the date selected in the DDL, My inconvenience is with the part to replace the values of the column with the new one taking into account that the result can be more than one record so I would like to make a sum and the result to place it in an INT and make the replacement in the column, I have the following code:
if (ddlMontoPorMes.SelectedIndex > 0)
{
foreach (DataRow row in dt.Rows)
{
foreach (DataColumn MONTOREC in dt.Columns)
{
foreach (DataRow dtRow in dt.Rows)
{
object fielsd = dtRow["NROACCRUAL"];
//Hago la busqueda de los nuevos valores por aqui
DataTable dt1 = Helper_wsWillisBudget.SumaRecibosPorMes(fielsd.ToString(), ddlMontoPorMes.SelectedValue);
//Aqui quiero sumar todos los valores para tener un solo resultado y asignarlo a la columna
int suma = int.Parse(dt1);
row.SetField("MONTOREC", dt1);
}
}
}
}
Thank you very much in advance