Had to do this today, took a few minutes of google searching In order to dynamically populate a drop down list use the following logic: SqlConnection connection = new SqlConnection(connectionString); connection.Open(); string query = “SELECT STUFF1, [STUFF2] FROM STUFFTABLE”; SqlCommand command = new SqlCommand(query, connection); SqlDataReader reader = command.ExecuteReader(); lstAppointmentType.DataSource = reader; lstAppointmentType.DataTextField = “STUFF1”; […]
↧