V
varun kanwar
ok i tell u in detail.
database is:
menu_bar option_no menu_option
1 0 a
2 1 b
3 2 c
4 2 d
5 1 e
6 1 f
7 0 g
8 7 h
9 7 i
10 9 j
11 9 k
12 7 l
my coding is:
Dim mainMenu1 As New MainMenu
Dim menuItem As New MenuItem
conn.Open()
cmd.CommandText = "select * from user_profile where
option_no=0"
cmd.Connection = conn
dr = cmd.ExecuteReader
While dr.Read
menuItem.Text = Convert.ToString(dr(1))
mainMenu1.MenuItems.Add(menuItem.Text)
End While
dr.Close()
conn.Close()
Menu = mainMenu1
and output should be:
a g
|->b |->h
. |->c |->i
. |->d . |->j
|->e . |->k
|->f |->l
this code adds "a" and "g" but i m unable to add rest of child and sub
child items.
i have shown u the database hope u can generate dynamic main menu from
there as output is required.
database is:
menu_bar option_no menu_option
1 0 a
2 1 b
3 2 c
4 2 d
5 1 e
6 1 f
7 0 g
8 7 h
9 7 i
10 9 j
11 9 k
12 7 l
my coding is:
Dim mainMenu1 As New MainMenu
Dim menuItem As New MenuItem
conn.Open()
cmd.CommandText = "select * from user_profile where
option_no=0"
cmd.Connection = conn
dr = cmd.ExecuteReader
While dr.Read
menuItem.Text = Convert.ToString(dr(1))
mainMenu1.MenuItems.Add(menuItem.Text)
End While
dr.Close()
conn.Close()
Menu = mainMenu1
and output should be:
a g
|->b |->h
. |->c |->i
. |->d . |->j
|->e . |->k
|->f |->l
this code adds "a" and "g" but i m unable to add rest of child and sub
child items.
i have shown u the database hope u can generate dynamic main menu from
there as output is required.