Thanks alot....right again!!!!!!
I wanted the intial selection to be nothing .listindex=-1 in vb terms but it
always seems to select first item even if i reset listindex to -1 after
databinding.
HAve i got to load a blank entry as the first item in the dropdownlist?
Thanks a lot!
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:23********************@msnews.microsoft.com.. .
If you get the data into a dataset DSStates with a table tblStates, then
the dropdownlist will look like the following:
<asp:dropdownlist id=ddlLocation Runat="server" DataTextField="Name"
DataValueField="Id" DataMember="tblStates" DataSource="<%# DSStates
%>"></asp:dropdownlist>
Eliyahu
Hi,
I want to select an id column and a name column from the database
and have the results databound to a SINGLE dropdown control with the
value
property matched to the database id column and the name values on
display to the user. Any idea how i can do this?
Sample HTML showing desired result: Thanks for any help!
<select name="DropDown1" id="DropDown1">
<option value="1">IN</option>
<option value="2">KS</option>
<option value="3">MD</option>
<option value="4">MI</option>
<option value="5">OR</option>
<option value="6">TN</option>
</select>