D
Darrel
I'm trying to perform a SQL query and then bind the results to two different
dropdownlists. Unfortunately, I can only get it to bind to one...whichever
one of the two I try to bind first:
Dim objConnect As New OleDb.OleDbConnection(strConnect)
objConnect.Open()
Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, objConnect)
DropDownList_category1.DataSource = objCommand.ExecuteReader()
DropDownList_category1.DataTextField = "directoryCategoryName"
DropDownList_category1.DataValueField = "directoryCategoryID"
DropDownList_category1.DataBind()
Dim objCommand2 As New System.Data.OleDb.OleDbCommand(strSQL, objConnect)
DropDownList_category2.DataSource = objCommand2.ExecuteReader()
DropDownList_category2.DataTextField = "directoryCategoryName"
DropDownList_category2.DataValueField = "directoryCategoryID"
DropDownList_category2.DataBind()
objCommand.Dispose
objCommand2.Dispose
objConnect.Close()
I'm probably missing a simple syntax concept, but I'm stumped.
-Darrel
dropdownlists. Unfortunately, I can only get it to bind to one...whichever
one of the two I try to bind first:
Dim objConnect As New OleDb.OleDbConnection(strConnect)
objConnect.Open()
Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, objConnect)
DropDownList_category1.DataSource = objCommand.ExecuteReader()
DropDownList_category1.DataTextField = "directoryCategoryName"
DropDownList_category1.DataValueField = "directoryCategoryID"
DropDownList_category1.DataBind()
Dim objCommand2 As New System.Data.OleDb.OleDbCommand(strSQL, objConnect)
DropDownList_category2.DataSource = objCommand2.ExecuteReader()
DropDownList_category2.DataTextField = "directoryCategoryName"
DropDownList_category2.DataValueField = "directoryCategoryID"
DropDownList_category2.DataBind()
objCommand.Dispose
objCommand2.Dispose
objConnect.Close()
I'm probably missing a simple syntax concept, but I'm stumped.
-Darrel