Hi folks,
I have a little problem with a datareader and a listbox.
Please see code below
Code:
If Not Page.IsPostBack Then
Dim cmdWardList As New Odbc.OdbcCommand("SELECT WARDCODE, WARDNAME FROM ASSETDDH.WARDS5 ORDER BY WARDNAME", cnBarwickPas)
cnBarwickPas.Open()
Dim drWardList As Odbc.OdbcDataReader
drWardList = cmdWardList.ExecuteReader()
lstWardList.DataSource = drWardList
lstWardList.DataTextField = "WARDNAME"
lstWardList.DataValueField = "WARDCODE"
lstWardList.DataBind()
drWardList.Close()
cnBarwickPas.Close()
End If
Now this is working wonderfully, but the problem is i need to insert an entery into the list box say "Please choose a Ward from the list". So when the page loads the first option you see in the list is above.
Anyone have any ideas??
Thanks