I've got a Data Component - dc on which I've described three tables tblMenu, tblWebPages and tblMenuWebPages. I also have two relations defined as follows: 1) Menu_MenuWebPages Parent: tblMenu (column MenuID) Child: tblMenuWebPage (column MenuID) Choose what
to create: Relation only 2) WebPage_MenuWebPages Parent: tblWebPages (column PageID) Child: tblMenuWebPage (column PageID) Choose what to create: Relation only In my code-behind, I have: Dim tadMenu As New MenuTableAdapter Dim tadWP As New WebPagTableAdapter
Dim tadMWP As New MenuWebPagesTableAdapter Dim tblMenu As New DataTable Dim tblWP As New DataTable Dim tblMWP As New DataTable tblMenu = tadMenu.GetMenu tblWP = tadWP.GetWebPage tblMWP = tadMWP.GetMenuWebPages I then want to fillup my Menu control. So I do:
For Each masterRow As DataRow In tblMenu.Rows() Dim masterItem As New MenuItem(masterRow("vcMenuName").ToString()) Menu1.Items.Add(masterItem) For Each childRow As DataRow In masterRow.GetChildRows("Menu_MenuWebPages") Dim childItem As New MenuItem(childRow("intPageID").ToString())
masterItem.ChildItems.Add(childItem) Next Next What I want is the following: > Dim childItem As New MenuItem(childRow("intPageID").ToString()) instead of doing this, I want to go up to the tblWebPages to get the PageName. How?
Thanks
I love computers because: MY WISH IS THEIR COMMAND :)
yaip
Contributor
4785 Points
1229 Posts
Menu
Oct 04, 2004 01:09 AM|LINK
I love computers because: MY WISH IS THEIR COMMAND :)
<Website>
<Gadget>