DataTable dtSum = new DataTable();
dtSum.Columns.Add("Name");
dtSum.Columns.Add("Salary");
for (int i = 1; i < 5; i++)
{
DataRow
drRow = dtSum.NewRow();
drRow["Name"]
= i.ToString();
drRow["Salary"]
= (1 * 100).ToString();
dtSum.Rows.Add(drRow);
}
decimal dAccuracy = Convert.ToDecimal(dtSum.Compute("Sum(Salary)", "").ToString());
Good solution which i found for my problem
ReplyDelete