> >oRegisterDS = csRegister.oDataProcs.ExecuteQuery("b_GetRegisters", "Register", oRegParams); > >DataColumn oBalanceCol = new DataColumn("Balance", System.Type.GetType("System.Double")); >oRegisterDS.Tables["Register"].Columns.Add(oBalanceCol); > >double dBalance = 0; >foreach (DataRow oRow in oRegisterDS.Tables["Register"].Rows) >{ > if (oRow["Payment"] == null) > { > dBalance = dBalance + Convert.ToDouble(oRow["Deposit"]); > } > else > { > dBalance = dBalance - Convert.ToDouble(oRow["Payment"]); > } > > oRow["Balance"] = dBalance; >} >>