title: checkboxlist databinding to an entity framework table
body: <p>I have placed a checkboxlist in a formview object.
  I would like to store and load the results of the checkboxlist in a table of an entity framework.</p>
  
  <p>I filled the cbl with values and labels coming from a table that has 2 columns, using the DataSourceID, DataTextField and DataValueField attributes but I can't seem to find how to bind the cbl to the entity framework object in order to store the checked values when the formview is in "EDIT" mode.</p>
  
  <p>Any help would be appreciate. Thanks!</p>
  
  <pre><code>&lt;asp:FormView ID="formView1" runat="server" DataSourceID="Ods1" 
          Height="203px" Width="495px" 
          onpageindexchanging="formView1_PageIndexChanging"&gt;
  &lt;EditItemTemplate&gt;
      &lt;asp:CheckBoxList ID="cblProducts" runat="server" RepeatColumns="3" 
                  Width="782px" DataSourceID="SqlDataSource1" DataTextField="ProductName" 
                  DataValueField="ProductCode"&gt;
      &lt;/asp:CheckBoxList&gt;
      &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                  ConnectionString="&lt;%$ ConnectionStrings:ApplicationServices %&gt;" 
                  SelectCommand="SELECT [ProductCode], [ProductName] FROM [Products]"&gt;
      &lt;/asp:SqlDataSource&gt;
  &lt;/EditItemTemplate&gt;
  &lt;/asp:FormView&gt;
      &lt;asp:ObjectDataSource ID="Ods1" runat="server" 
          DataObjectTypeName="WebApplication1.EDM.Emp" DeleteMethod="DeleteEmp" 
          InsertMethod="CreateNewEmp" OldValuesParameterFormatString="original_{0}" 
          SelectMethod="GetEmpByEmpId" TypeName="WebApplication1.EDM.EmpLogic" 
          UpdateMethod="UpdateEmp" OnSelecting="Ods1_Selecting"&gt;
          &lt;SelectParameters&gt;
              &lt;asp:RouteParameter Name="EmpId" RouteKey="EmpId" Type="String" /&gt;
          &lt;/SelectParameters&gt;
      &lt;/asp:ObjectDataSource&gt;
  </code></pre>