title: Fill DropDownList from database
body: <p>I am new to C# and trying to populate a DropDownList  based on a database value.  I tried connecting to database as shown below - tested with the statement and it says connected. Can I assume this is correct? Am I on the right track?  Also, how do I then select value from the table and fill DropDownList  with a field?</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      SqlConnection connection = new SqlConnection (
      "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:customers.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
  
       try
       {
           connection.Open();
           TextBox1.Text = "connected";
       }
       catch (Exception)
       {
           TextBox1.Text = " not connected";
       }
   }
  </code></pre>