I'm trying to batch record using windows form. But When I click button to save, it works very slowly especially in this code block. Do you have a solution?
int i = 0;
List<int> ChkedRow = new List<int>();
if (dataGridView1.Rows.Count > 0)
for (i = 0; i <= dataGridView1.RowCount - 1; i++)
{
if (Convert.ToBoolean(dataGridView1.Rows[i].Cells["oid"].Value) == true)
{
ChkedRow.Add(i);
}
}
if (ChkedRow.Count == 0)
{
MessageBox.Show("Geziye katilacak ögrenci seçiminde bulunmadiniz!");
return;
}