In C#, I have one foreach
loop.
foreach (businfo ibusinfo in lclbbusinfo)
{
ibusinfo.Updateperson();
}
lclbbusinfo -> contains the column member_id and other releavnt columns
updateperson() - > method which will update the member_id(primary key) information like name ,phone etc.
Most of the cases lclbusinfo will have different member_id's so it will update the member's information accordingly in for each loop.
In rare scenario sometimes the lclbbusinfo will have same member_id's. In that case, the first iteration will update the member table and then the next (or 3rd or 4th, etc.) will also try to update the same member info again in the same table.
So how do we avoid updating the same member id again and again?
I have tried using ibusinfo to check previous member_id only.