title: How to set dropdown list value and item as database table value in edit?
body: <p>When I click edit button the form filling database values in textbox as well as dropdown list..</p>
  
  <p>Textbox values is set. But I can't set dropdownlist values..</p>
  
  <p>The code is;</p>
  
  <pre><code>SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
  con.Open();
  string str = "Select * from Master where Id='" + id + "'";
  SqlCommand command = new SqlCommand(str, con);
  SqlDataReader reader = command.ExecuteReader();
  while (reader.Read())
  {
        ddCustomerName.DataValueField = reader["CustomerId"].ToString();
        txtPickupLocation.Text = reader["Location"].ToString();
  }
  con.Close();   
  </code></pre>