I have a SQLDataAdapter with a data relation defined thusly:
Dim cnn As SqlConnection = New SqlConnection(Application("ConnStr"))
Dim cmd1 As SqlDataAdapter = New SqlDataAdapter("select * from topic_Areas Order by Topic_Name ASC", cnn)
Dim ds As DataSet = New DataSet()
cmd1.Fill(ds, "topic_Areas")
Dim cmd2 As SqlDataAdapter = New SqlDataAdapter("select * from vw_DCMP_Topics_Subjects Order by Subject_Name ASC", cnn)
cmd2.Fill(ds, "vw_DCMP_Topics_Subjects")
ds.Relations.Add("myrelation", ds.Tables("topic_Areas").Columns("Topic_Num"), ds.Tables("vw_DCMP_Topics_Subjects").Columns("Topic_Num"))
'some form of setting the Treeview datasource on this line
Page.DataBind()
cnn.Close()
I would like to have the Parent nodes populated with the topic_areas and the child nodes for each parent node filled with the vw_DCMP_Topics_Subjects related data.
Is if possible to do this with the Treeview and if so how would one do this?
Thanks in advance.
Dim cnn As SqlConnection = New SqlConnection(Application("ConnStr"))
Dim cmd1 As SqlDataAdapter = New SqlDataAdapter("select * from topic_Areas Order by Topic_Name ASC", cnn)
Dim ds As DataSet = New DataSet()
cmd1.Fill(ds, "topic_Areas")
Dim cmd2 As SqlDataAdapter = New SqlDataAdapter("select * from vw_DCMP_Topics_Subjects Order by Subject_Name ASC", cnn)
cmd2.Fill(ds, "vw_DCMP_Topics_Subjects")
ds.Relations.Add("myrelation", ds.Tables("topic_Areas").Columns("Topic_Num"), ds.Tables("vw_DCMP_Topics_Subjects").Columns("Topic_Num"))
'some form of setting the Treeview datasource on this line
Page.DataBind()
cnn.Close()
I would like to have the Parent nodes populated with the topic_areas and the child nodes for each parent node filled with the vw_DCMP_Topics_Subjects related data.
Is if possible to do this with the Treeview and if so how would one do this?
Thanks in advance.