473,511 Members | 9,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic main menu

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.

Aug 17 '06 #1
2 1006
You are only selecting 'a' and 'g' when you restrict your record
selection with "where option_no = 0".
Where are the sub-menus for 'a' and 'g' supposed to come from?

T

varun kanwar wrote:
>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.
Aug 17 '06 #2

cmd.CommandText = "select * from user_profile"

ok llets change the command to this but even then how will i
distinguish between parent menu and child menu.

and big problem is where to right code to add child menu to parent menu.

Aug 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2118
by: Chris45 | last post by:
Hi , Trying to get a menu working for sometime now have wasted money on stupid software etc.Now have been trying out a freebee from www.dynamicdrive.com, but have one or two question. It's...
1
1620
by: Phil | last post by:
Supposedly, the code below should assign the correct value to the 'url' variable. But all I get is a blank 'main' Frame with apparently nowhere to go when I click on the link in the 'menu'...
1
2513
by: Martin Falta | last post by:
Hi all, I need a help with following problem. I need to create a menu from dynamic loaded assembly on the main form of my application. The menu is created succesfully, but the events of this...
1
4268
by: tribal boy | last post by:
Guys, I am using a dynamic menu which uses xml,xsl a css file and javascript. This works fine when there are no server controls around or underneath it. The problem is whenever the menu...
2
1389
by: guoqi zheng | last post by:
Dear Sir, I have a menu page (main.aspx") with a placeholder on it. This placeholder will load a a main menu item user controls (mainmenu.ascx), on this page, there are a few menu items, When...
3
4767
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
2
1435
by: libish | last post by:
hi all... can any one help me by suggesting a way to add event to a dynamic form? here what i'm doing is , i'm displaying a dynamic form. in that form i have a main menu and this main menu...
4
1835
by: libish | last post by:
hi all... can any one help me by suggesting a way to get items in dynamic form? here what i'm doing is , i'm displaying a dynamic form. in that form i have a main menu and this main menu contains...
1
1205
by: jeddiki | last post by:
Hi I have a dynamic menu on my site and it uses javascript to make slide up and down the page. I think its pretty cool but it seems that it works independently of the page so if you try and...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.