Yup, you cannot populate a DropDownList like that. Code for that is as follows:
Dim conn As New SqlConnection( connection )
Dim cmdSelect As New SqlCommand( ""Select flightnum from Air_flight", conn )
Dim dtrReader As SqlDataReader
Try
conn.Open()
dtrReader = cmdSelect.ExecuteReader()
if dtrReader.HasRows then
ddlflightnum.DataSource = dtrReader
ddlflightnum.DataValueField = "flightnum"
ddlflightnum.DataTextField = "flightnum"
ddlflightnum.DataBind()
end if
dtrReader.Close()
conn.Close()
Catch
End Try Now if you do not specify DataTextField, it will default to the DataValueField.
You can populate it through a dataset how you were as well, but I would try to steer you away from datasets as it takes up a lot of resources and the above code is much more efficient.