try this one
foreach (dataGridView1 row in dataGridView1.Rows)
{
insertQuery("insert into abc(id,name,adderss)values("+row.cells["id"].Value+","+row.cells["name"].Value+","+row.cells["address"].Value+")");
}
//rest of the code
private static SqlCommand...