Selected Item in ListBox
- From: EdwardH <EdwardH@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 11:07:01 -0700
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
.
- Follow-Ups:
- Re: Selected Item in ListBox
- From: Stan
- Re: Selected Item in ListBox
- Prev by Date: Re: Updating GridView Problem
- Next by Date: Re: Selected Item in ListBox
- Previous by thread: Updating GridView Problem
- Next by thread: Re: Selected Item in ListBox
- Index(es):
Relevant Pages
|