title: Value from DropDownList will not save into SQL Server table
body: <p>I have a DropDownList that gets populated by a SQL Server table called <code>tblVisa</code>. My issue is that the values that are being populated from the SQL Server table are not being saved. Everything else gets saved except for my DropDownLists. I've tried using <code>.SelectedValue</code> and <code>.Text</code>, but it still does not work.</p>
  <p>Here is my code</p>
  <pre><code>protected void PopulateVisaType()
  {
          List&lt;ListItem&gt; result = new List&lt;ListItem&gt; { new ListItem(&quot;&quot;, &quot;&quot;) };
  
          SqlCommand cmd = new SqlCommand() { Connection = sqlConn, CommandText = &quot;SELECT VisaType FROM tblVisa ORDER BY VisaType ASC&quot; };
  
          if (sqlConn.State == ConnectionState.Closed) 
          {
              sqlConn.Open(); 
          }
  
          SqlDataReader read = cmd.ExecuteReader();
  
          while (read.Read())
          {
              result.Add(new ListItem(read[&quot;VisaType&quot;].ToString(), read[&quot;VisaType&quot;].ToString()));
          }
  
          read.Close();
          sqlConn.Close();
          cmd.Dispose();
  
          DDLVisa.DataSource = result;
          DDLVisa.DataValueField = &quot;value&quot;;
          DDLVisa.DataTextField = &quot;text&quot;;
          DDLVisa.DataBind();
  }
  </code></pre>
  <p>Here's my code for saving the information into the database:</p>
  <pre><code>protected void LbSaveProfile_Click(object sender, EventArgs e)
  {
      SqlCommand cmd = new SqlCommand() { Connection = sqlConn, CommandText = &quot;spSaveNewProviderInformation&quot;, CommandType = CommandType.StoredProcedure };
  
      if (sqlConn.State == ConnectionState.Closed)
      { 
          sqlConn.Open(); 
      }
  
      cmd.Parameters.AddWithValue(&quot;@EmployeeNumber&quot;, TbEmployeeNumber.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@SSN&quot;, TbSSN.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@ContractType&quot;, DDLContractType.SelectedItem.Value);
      cmd.Parameters.AddWithValue(&quot;@Firstname&quot;, TbFirstname.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Lastname&quot;, TbLastname.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@MiddleInitial&quot;, TbMiddleInitial.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@ContractRenewalDate&quot;, TbContractRenewalDate.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Position&quot;, DDLPosition.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Specialty&quot;, DDLSpecialty.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@PrimaryDepartment&quot;, DDLPrimaryDepartment.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@SecondaryDepartment&quot;, DDLSecondaryDepartment.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Gender&quot;, DDLGender.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Birthdate&quot;, TbBirthdate.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@EmailAddress&quot;, TbEmailAddress.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@PhoneNumber&quot;, TbPhoneNumber.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Address&quot;, TbAddress.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@PassportNumber&quot;, TbPassportNumber.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Citizenship&quot;, DDLCitizenship.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Visa&quot;, DDLVisa.Text.Trim());
      cmd.Parameters.AddWithValue(&quot;@Status&quot;, 1);
  
      cmd.ExecuteNonQuery();
  
      sqlConn.Close();
  
      Alert(&quot;Provider Information saved!&quot;);
  
      ClearControls();
  }
  </code></pre>