title: How to insert the selected value in this form to the database?
body: <p>I am a new developer in ASP.NET with C#. I developed an intranet web-based suggestion application which works as a pool for the suggestions submitted by the employees in my department. </p>
  
  <p>I have the following database design:</p>
  
  <pre><code>Log Table: ID, Title, Description, DateSubmitted, Username, TypeID, StatusID
  SuggestionsType Table: ID, Type
  SuggestionsStatus Table: ID, Status
  Employee Table: Username, Name, Title
  </code></pre>
  
  <p>I could be able to insert the suggestion with its title, datesubmitted, description and Username through the following code:</p>
  
  <p><strong>ASP.NET Code</strong></p>
  
  <pre><code>&lt;div ID="contactform"&gt;
                  &lt;ol&gt;
                      &lt;li&gt;
                          &lt;label for="subject"&gt;
                          Type&lt;/label&gt;
                          &lt;asp:DropDownList ID="DropDownList" runat="server" DataSourceID="SqlDataSource1" Width="155px" 
                                      Font-Bold="True" ForeColor="#006666" AppendDataBoundItems="false" 
                                      DataTextField="Type" DataValueField="ID" AutoPostBack="true" OnDataBound="DropDownList_DataBound"&gt;
                          &lt;/asp:DropDownList&gt;
                          &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                      ConnectionString="&lt;%$ ConnectionStrings:testConnectionString %&gt;" 
                                      SelectCommand="SELECT * FROM [SafetySuggestionsType]"&gt;&lt;/asp:SqlDataSource&gt;
                          &lt;asp:TextBox ID="TextBox1" runat="server" CssClass="text"&gt;&lt;/asp:TextBox&gt;
                          &lt;br /&gt;
                          &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                              ControlToValidate="dropdownlist" 
                              ErrorMessage="Please select a type for your suggestion or choose Others and put a type for it"&gt;&lt;/asp:RequiredFieldValidator&gt;
                          &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                              ControlToValidate="TextBox1" 
                              ErrorMessage="Please enter a type for your suggestion"&gt;&lt;/asp:RequiredFieldValidator&gt;
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;label for="subject"&gt;
                          Subject&lt;/label&gt;
                          &lt;asp:TextBox ID="txtSubject" runat="server" CssClass="text"&gt;&lt;/asp:TextBox&gt;
                          &lt;br /&gt;
                          &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                              ControlToValidate="txtSubject" 
                              ErrorMessage="Please enter a subject/title for your suggestion"&gt;&lt;/asp:RequiredFieldValidator&gt;
                      &lt;/li&gt;
  
                      &lt;%--The following hidden field is for inserting the date--%&gt;
                      &lt;li&gt;
                          &lt;asp:TextBox ID="dateSubmitted" runat="server" CssClass="text" Visible="false"&gt;&lt;/asp:TextBox&gt;
                          &lt;br /&gt;
                      &lt;/li&gt;
  
                      &lt;li&gt;
                          &lt;label for="message"&gt;
                          Your Suggestion&lt;/label&gt;
                          &lt;asp:TextBox ID="txtSuggestion" runat="server" cols="50" CssClass="textarea" 
                              rows="6" TextMode="MultiLine"&gt;&lt;/asp:TextBox&gt;
                          &lt;br /&gt;
                          &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                              ControlToValidate="txtSuggestion" ErrorMessage="Please enter your suggestion"&gt;&lt;/asp:RequiredFieldValidator&gt;
                      &lt;/li&gt;
                      &lt;li class="buttons"&gt;
                          &lt;asp:ImageButton ID="imageField" runat="server" imageurl="images/Send.gif" 
                              OnClick="btnSubmit_Click" /&gt;
                          &lt;%--&lt;input type="image" name="imageField" id="imageField" src="images/Send.gif" /&gt;--%&gt;
                      &lt;/li&gt;
                  &lt;/ol&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p><strong>C# Code:</strong></p>
  
  <pre><code>string connString = "Data Source=localhost\\sqlexpress;Initial Catalog=Test;Integrated Security=True";
          string insertCommand = "INSERT INTO Log (Title, DateSubmitted, Description, Username) values(@Title, @DateSubmitted, @Description, @Username)";
          string username = netID;
          using (SqlConnection conn = new SqlConnection(connString))
          {
              conn.Open();
              using (SqlCommand cmd = new SqlCommand(insertCommand, conn))
              {
                  cmd.Parameters.Clear(); 
                  cmd.Parameters.AddWithValue("@Title", txtSubject.Text);
                  cmd.Parameters.AddWithValue("@DateSubmitted", DateTime.Now.ToString());
                  cmd.Parameters.AddWithValue("@Description", txtSuggestion.Text);
                  cmd.Parameters.AddWithValue("@Username", username);
                  cmd.ExecuteNonQuery();
              }
          }
  </code></pre>
  
  <p>What I need now is to insert the value of the selected type, <strong>so how to do that?</strong></p>