There are loads of ways!
The simplest to understand is:
DataTable dt;
...
DataRow dr = dt.Rows[0];
int sum = 0;
foreach (object o in dr.ItemArray)
{
if (o is int)
{
sum += (int)o;
}
}
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[i][1].ToString() != null)
{
string yy = dt.Rows[i][1].ToString();
count = yy + count;
}
}
"but row[0][1] value not adding with the row[1][1] value.."
Try:
int count = 0;
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[i][1].ToString() != null)
{
count += (int) dt.Rows[i][1];
}
}