K
Kent Johnson
Hi all,
I have a code that is supposed to load three tables in a dataset.
This works fine with one Dropdownlist1 but not with the other Dropdownlist2.
Tables(0) = "Table0" : Tables(1) = "Table1"
MyDataSet = GetDataSet(strConn, Tables)
For intCount = 0 To Tables.GetUpperBound(0)
objCmd.CommandText = "SELECT * FROM " & Tables(intCount)
objDA.Fill(objDS, Tables(intCount))
Next
DropDownList1.DataSource = MyDataSet
DropDownList1.DataTextField = ("Field1")
DropDownList1.DataValueField = ("Field2")
objDA.Fill(objDS)
DropDownList1.DataBind()
DropDownList2.DataSource = MyDataSet
DropDownList2.DataTextField = ("Field3")
DropDownList2.DataValueField = ("Field4")
objDA.Fill(objDS)
DropDownList1.DataBind()
How can I get the data to Dropdownlist2?
/Kent J.
I have a code that is supposed to load three tables in a dataset.
This works fine with one Dropdownlist1 but not with the other Dropdownlist2.
Tables(0) = "Table0" : Tables(1) = "Table1"
MyDataSet = GetDataSet(strConn, Tables)
For intCount = 0 To Tables.GetUpperBound(0)
objCmd.CommandText = "SELECT * FROM " & Tables(intCount)
objDA.Fill(objDS, Tables(intCount))
Next
DropDownList1.DataSource = MyDataSet
DropDownList1.DataTextField = ("Field1")
DropDownList1.DataValueField = ("Field2")
objDA.Fill(objDS)
DropDownList1.DataBind()
DropDownList2.DataSource = MyDataSet
DropDownList2.DataTextField = ("Field3")
DropDownList2.DataValueField = ("Field4")
objDA.Fill(objDS)
DropDownList1.DataBind()
How can I get the data to Dropdownlist2?
/Kent J.