E
EdwardH
I am filling a ListBox from a stored proc and a SQLDataReader which works fine.
Private pCateg As SqlCommand
Private pDR as Data.Sql.SqlDataReader
pCateg = New SqlCommand("pLodge")
pCateg.CommandType = Data.CommandType.StoredProcedure
pDR = pCateg.ExecuteReader
ListBox1.DataSource = pDR
ListBox1.DataTextField = "Category"
ListBox1.DataValueField = "Category"
ListBox1.Databind
I am trying to use the Value/Text of the Selected Item but am failing to get
that value which is coming back as a Null:
ListBox1. SelectedValue
How should I test that an Item has been selected and then get the value for
further use?
With thanks
Private pCateg As SqlCommand
Private pDR as Data.Sql.SqlDataReader
pCateg = New SqlCommand("pLodge")
pCateg.CommandType = Data.CommandType.StoredProcedure
pDR = pCateg.ExecuteReader
ListBox1.DataSource = pDR
ListBox1.DataTextField = "Category"
ListBox1.DataValueField = "Category"
ListBox1.Databind
I am trying to use the Value/Text of the Selected Item but am failing to get
that value which is coming back as a Null:
ListBox1. SelectedValue
How should I test that an Item has been selected and then get the value for
further use?
With thanks