It seems you are using SQL... so use SQL's power and sum the value at the SQL level...
SUM (Transact-SQL)[
^]
SELECT SUM(double_colum) FROM table1
But if you insist to do it in code, do it right...
Double sum1 = 0;
for (int i = 0; i < dataGridView2.Rows.Count; ++i)
{
sum1 = Double.Parse(dataGridView2.Rows[i].Cells[1].Value.ToString());
}
message box.show(sum1.tostring());
A suggestion to do it better...
double sum = 0
foreach (DataRow oDataRow in dataGridView2.Rows)
{
sum += oDataRow.Cells[1].Value;
}