Click here to Skip to main content
11,705,610 members (46,965 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0
Hello Everybody,

While loading the form i am retrieving values from database and showing in datagridview . when i click save,all the values are being updated .It is working fine.But i have many rows so performance is slow.
This is code i am using and it is working fine.
foreach (DataGridViewRow examinationlistrow in dgvExamination.Rows)
                string _examinid = examinationlistrow.Cells[0].Value.ToString();
                string _examinvalue = examinationlistrow.Cells[3].Value.ToString();
                UpdateListItem(mrid, ic, _examinid, _examinvalue);

But i want to update only changed values of the datagridview.
Posted 11-Nov-12 19:43pm
Edited 11-Nov-12 19:45pm
Adersh Ram at 12-Nov-12 4:06am

I suggest add a new column in datagridview Like "Action", when editing a column
you change the Action column value to "Edit"(you can use Datagridview cellendedit event).

When inserting time you put a condition
IF (examinationlistrow.Cells["Action"].Value.ToString() == "Edit")


1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 229
1 Sergey Alexandrovich Kryukov 100
2 Inimicos 60
3 ProgramFOX 50
4 Richard MacCutchan 45
0 OriginalGriff 9,053
1 Sergey Alexandrovich Kryukov 8,347
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,626

Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100