i m editing records through datagrid..behind my update button i've written following code..
String str = " ";
for (int i = 0; i == editgrid.RowCount - 1; i++)
{
str = "UPDATE criminal SET cr_id = " + editgrid.Rows[i].Cells[1].Value + ", cr_name= '" + editgrid.Rows[i].Cells[2].Value + "', cr_desc='" + editgrid.Rows[i].Cells[3].Value + "' ,cr_pic= '" + editgrid.Rows[i].Cells[4].Value + "', no_times ='" + editgrid.Rows[i].Cells[5].Value + "' WHERE cr_id = " + editgrid.Rows[i].Cells[1].Value;
SqlCommand com = new SqlCommand(str, conn);
com.ExecuteNonQuery();
label2.Visible = true;
}
it is not giving any errors but records are not updated,yet
can anybody help me??