comparing two List<>
<p>i have gridview control with a checkbox on it</p>

<p>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 problem is:</p>

<p>let say if the user tries to uncheck the checkedbox so how would i track the changes and save it into the db that has been checked. anyhelp?.. so in that regards i have created two list for comparision... hope i make sense here.</p>

<p>i want to compare the two list and if any changes then save else ....do something...</p>

<pre><code>&lt;asp:TemplateField HeaderText="Select"&gt;  &lt;ItemTemplate&gt;  
      &lt;asp:CheckBox ID="chkSelected" runat="server" Checked="false"&gt;&lt;/asp:CheckBox&gt;   
&lt;/ItemTemplate&gt;  &lt;/asp:TemplateField&gt;     


List&lt;Employee&gt; listFromDB = new List&lt;Employee&gt;();
listFromDB = EmployeeListFromDB ; //loads the list

List&lt;Employee&gt; selectedEmployee = new List&lt;Employee&gt;();
selectedEmployee = MySelectedEmployee //loads the list

//Employee object looks like this:
id
name
</code></pre>

<p>here is what i got stuck and here is what i am doing...</p>

<pre><code>foreach (Employee item in MySelectedEmployee )
{
    bool _flag = false;
    _flag = EmployeeService.SaveEmployee(item.Id, item.Name);
}
</code></pre>
