I looked at some resoureces before asking the question....but couldn't do it ...so asking ....
I need to populate a ddl from a database...
"I would like to show two columns from a database to the ddl"
????????IS IT POSSIBLE?????????????
My my code below so far attempted to populate the ddl with just one column..
let me know how i can make it to show two columms from the database...
Here is what I tried:
My ddl is:
<asp:DropDownList id="coursesddl" Runat="server"></asp:DropDownList>
My ddl databing code:
Dim ccddl As New OleDbConnection
Dim sddl As String = Server.MapPath("UST.mdb")
ccddl.ConnectionString = "provider =Microsoft.Jet.OLEDB.4.0; data source = " + sddl
Dim daddl As New OleDbDataAdapter("SELECT COURSE_ID FROM COURSES ", ccddl)
Dim dsddl As New DataSet
coursesddl.DataSource = dsddl.Tables("COURSES").DefaultView
coursesddl.DataTextField = "COURSE_ID"
coursesddl.DataValueField = "COURSE_ID"