Using SQLDataAdapter to populate Treeview

2 posts, 0 answers
  1. swells
    swells avatar
    3 posts
    Member since:
    Jul 2008

    Posted 17 Aug 2010 Link to this post

    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.

  2. swells
    swells avatar
    3 posts
    Member since:
    Jul 2008

    Posted 17 Aug 2010 Link to this post

    Sorry, never mind, found this article so I will try this approach.

    http://www.telerik.com/help/aspnet-ajax/tree_databindingtoloadingrelatedtables.html
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top