i have gridview control with a checkbox on it
When i hit on save button i able to find the checkbox which have been checked and i able to do it so far so good but the pr
It sounds like what you need is set operations. You have a few choices:
.NET 4.0 - HashSet
http://msdn.microsoft.com/en-us/library/bb359438.aspx
.NET 3.5 - Linq extensions
The Linq to Objects extensions contains some set operations like Intersect and Union. http://msdn.microsoft.com/en-us/library/system.linq.enumerable.aspx
.NET 2.0 - SetList
In 2.0 you'll need to hand-roll something like the following SetList class. http://csharptest.net/browse/src/Library/Collections/SetList.cs (online-help)
To use SetList:
SetList listFromDB = new SetList(EmployeeListFromDB);
SetList selectedEmployee = new SetList(MySelectedEmployee);
SetList removed = listFromDB.SubtractSet(selectedEmployee);
SetList added = selectedEmployee.SubtractSet(listFromDB);
Note: Employee must implement IComparable