title: .NET Object Datasource, DetailsView and DropDownList
body: <p>Ok, I am going to try and give a very bried yet detailed description of what I need to accomplish.  </p>
  
  <p>First, I have a LinqToSQL datacontext defined that has an employee object.  I then created a BLL (partial of employee) that handles my validations, inserts, updates etc.  Everthing is good at this point.  Next, I created a detailsview with an object data source binding to my select/update/insert methods on my Employee object.  This is good too, data pulls like it should, updates, inserts like it should except for one issue.  I am having trouble with drop down list inside of the details view.  These are required fields, cannot be null.  When that constraint is dropped, the code functions just fine. </p>
  
  <p>Code Snippet of details view - fields abbreviated to show relevant information.</p>
  
  <pre><code>&lt;asp:DetailsView ID="grd_empDetails"  runat="server" DataSourceID="empDataSource" DataKeyNames="EmployeeID" DefaultMode="Insert" AutoGenerateRows="false"&gt;
              &lt;Fields&gt;
                  &lt;asp:BoundField HeaderText="First Name" DataField="FirstName" /&gt;
                  &lt;asp:TemplateField HeaderText="Type of Employee"&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:DropDownList ID="empType" runat="server" DataValueField="empType" AppendDataBoundItems="true"&gt;
                              &lt;asp:ListItem Text="Full Time" Value="1" /&gt;
                              &lt;asp:ListItem Text="Part Time" Value="2" /&gt;
                              &lt;asp:ListItem Text="Subcontractor or 1099" Value="3" /&gt;
                              &lt;asp:ListItem Text="Intern" Value="4" /&gt;
                          &lt;/asp:DropDownList&gt;
                      &lt;/ItemTemplate&gt;                   
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:CommandField ShowInsertButton="true" ShowCancelButton="true" /&gt;    
              &lt;/Fields&gt;
          &lt;/asp:DetailsView&gt;
  </code></pre>
  
  <p>When the insert method is called, the empType is always returned as Nothing (empType is the database field).</p>
  
  <p>What is the proper way to attach the value of the dropdownlist to my object so that it can be properly created in the database?  Most of my searches keep telling me how to bind a dropdownlist to an object data source, but that is not what I need to do.  This is a basic drop down list, 4 items that will never change.  Would it make sense to use just a standard HTML select tag here or would that even help.</p>
  
  <p>Thanks for looking, let me know if you need any more information.</p>