Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataReader Insert into a Drop Down Box

Status
Not open for further replies.

1Data

MIS
Sep 30, 2005
66
US
I need to know how to insert a data reader object into a drop down box...I am missing something..

Here is what I have aleady..

Dim dr As SqlDataReader = SQL_Data.GetEmps1()
dr.Read()
If dr.HasRows() Then
DropDownList1.DataTextField = dr("Written_Name")
DropDownList1.DataValueField = dr("Employee_ID")
DropDownList1.DataBind()
End If
'Set's the Default Value to Add a User on a Drop Down Box.
DropDownList1.Items.Insert(0, AddaUser)
DropDownList1.SelectedIndex = 0
CheckBox1.Enabled = False
 
Is this post due to the fact that you have read an article suggesting that you can't sort DDL's (thread855-1140325), which by the way, you can do if you sort the data before binding it like I suggested in that thread? If so, I suggest you don't pursue this method and concentrate on the other thread.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top