|
| if your listbox is named "lbMyList" you can access the
value that is selected one of two ways.
1. lbMyList.SelectedItem.Value
2. lbMyList.SelectedIndex.Value
ex
Select something FROM tblData Where MyValue = '" &
lbMyList.SelectedItem.Value & "' ORDER BY whatever"
If you want to do the query automatically when someone
selects a different listitem, then you need to build the
commandtext inside of the selectedindexchanged event
handler.
If you are using web forms, make sure the autopostback
property on the control you are using is set to true.
NW
>-----Original Message-----
>hi all,
>
> I have created a dropdownlist control and populating
the drop downs. now I
>have assigned the values to each of the value appearing
in the dropdown. I
>want to accessthose and pass this to my query that
value. every time I do
>that it passes just one value.
> no idea what to do?
>
> please help
>
>Puneet
>
>
>.
>
|
|