I'm trying to populate a drop down list with data from an SQL database but I fail miserably. Code seems ok to me but refuses to work.
SqlDataSource sql_Names = new SqlDataSource(WebConfigurationManager.ConnectionStrings[1].ConnectionString, "SELECT name FROM Names");
sql_Names.DataSourceMode = SqlDataSourceMode.DataReader;
ddl_names.DataSource = sql_Names;
ddl_names.DataBind();
The database connection is working. It creates the right amount of entries (same as the number of rows in the DB) in the drop down list but insted of the values it fills every element of the list with "System.Data.DataRecordInternal" (or "System.Data.DataRowView" if the mode is set to DataSet).
Please help...