List<Person> lst = PutRowsOfDGVIntoList(); if (lst != null && lst.Count != 0) { foreach (var person in lst) { if (!pda.ifExistPerson())//if current row don't exist in Db insert new person else update { if (!pda.InsertPerson(person))//insert throw new Exception(); } else { if (!pda.UpdatePerson(person))//update throw new Exception(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)