LINQ to the rescue:
DataTable dt = WhateverCreatesDataTable(); DataRow dr = dt.Rows[0]; int sum = dt.Columns.Cast<DataColumn>().Sum(dc=>(int)dr[dc]);
For those who still pull their joints into the stone ages (aka pre-.Net 3.5 and LINQ):
DataTable dt = WhateverCreatesDataTable(); DataRow dr = dt.Rows[0]; int sum = 0; foreach(DataColumn dc in dt.Columns) sum += (int)dr[dc];
source share