protected void Button2_Click(object sender, EventArgs e) { int i; for (i = 0; i < gridview2.Rows.Count; i++) { SqlCommand cmd = new SqlCommand("insert into rep values('"+gridview2.Rows[i].Cells[0].Text+"','" + gridview2.Rows[i].Cells[1].Text +"','" + gridview2.Rows[i].Cells[2].Text+ "','"+ gridview2.Rows[i].Cells[3].Text+ "')", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); }
con
try...catch
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)