title: create a dropdown list in c# .net server side
body: <p>I trie to create a dropdown list in c# .net server side ... but this is not working .. anyone know what is it going wrong here?</p>
  
  <pre><code>    string conncetionStr = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
      SqlConnection msSQLConnectoin = new SqlConnection(conncetionStr);
      SqlCommand msSQLCommand = msSQLConnectoin.CreateCommand();
  
      msSQLCommand.CommandText = "app_Event_Type_Select";
      msSQLConnectoin.Open();
      SqlDataReader msDataReader = msSQLCommand.ExecuteReader();
  
      while (msDataReader.Read())
      {
          dropDown.DataSource = msDataReader["Name"].ToString(); 
          dropDown.DataTextField = msDataReader["Name"].ToString();
          dropDown.DataValueField = msDataReader["EventTypeID"].ToString(); 
          dropDown.DataBind();
  
      }
  </code></pre>