In, C# I built a datatable connected to a datagrid which has three columns: id1, id2 and sum.
I want to add up id1 and id2 into column "sum", but only if sum is greater than x (x will be supplied from textbox1).
I have this code, but this defaults adding all the columns and doesnt allow for an if/then statement.
column = new DataColumn();
column.DataType = Type.GetType("System.Double");
column.ColumnName = "sum";
table.Columns.Add(column);
table.Columns["sum"].Expression = "[id] * [id2]";
I thought about adding a foreach (Datarow row in table.Rows) (), but that doesnt allow me to create if then statements.