Hej !URL Från databas i TreeView controllen
Jag har ett reserverat fält i databasen, men får inte ut fältet i min treeview som url.
Är det någon som ser en lösning, känns som jag provat allt!?
Koden.
'Sub PopulateNodes()
' Dim dst As DataSet = GetTreeViewData()
' For Each masterRow As DataRow In dst.Tables("Tb_DataNet_Cat").Rows()
' Dim masterNode As New TreeNode(masterRow("Categoryname").ToString())
' TreeView1.Nodes.Add(masterNode)
' For Each childRow As DataRow In masterRow.GetChildRows("Children")
' Dim childNode As New TreeNode(childRow("Subname").ToString())
' masterNode.ChildNodes.Add(childNode)
' Next
' Next
'End Sub
'Function GetTreeViewData() As DataSet
' Dim con As SqlConnection = New SqlConnection(connectionString)
' Dim dadCats As SqlDataAdapter = New SqlDataAdapter("Select * FROM Tb_DataNet_Cat", con)
' Dim dadSub As SqlDataAdapter = New SqlDataAdapter("Select * FROM Tb_DataNet_Subcat", con)
' Dim dst As DataSet = New DataSet()
' dadCats.Fill(dst, "Tb_DataNet_Cat")
' dadSub.Fill(dst, "Tb_DataNet_Subcat")
' dst.Relations.Add("Children", dst.Tables("Tb_DataNet_Cat").Columns("CategoryID"), dst.Tables("Tb_DataNet_Subcat").Columns("CategoryID"))
' Return dst
'End Function