473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Looping through Database??

Hi,

I'm new to ASP.NET and have just strated using VS 2003 what I want to know is how I do a loop through a table in a database? I would be grateful for any feedback!

I'm trying to build a menu programatically! I want to use a table to build a piece of code similar to this:

....: CODE :...
Dim submenu1 As New skmMenu.MenuItem("<img src=""images/menublip.gif"" align=""absmiddle"">Home", "")

submenu1.SubItems.Add(New skmMenu.MenuItem("Sub Item 1", "page1.html"))
submenu1.SubItems.Add(New skmMenu.MenuItem("Sub Item 2", "page2.html"))

Dim submenu3 As New skmMenu.MenuItem("Sub Item 3 ->", "")
submenu3.SubItems.Add(New skmMenu.MenuItem("Sub Item 3 - 1", "page1.html"))
submenu3.SubItems.Add(New skmMenu.MenuItem("Sub Item 3 - 2", "page2.html"))

submenu1.SubItems.Add(submenu3)
submenu1.SubItems.Add(New skmMenu.MenuItem("Sub Item 4", "page4.html"))
submenu1.SubItems.Add(New skmMenu.MenuItem("Sub Item 5", "page5.html"))
submenu1.SubItems.Add(New skmMenu.MenuItem("Sub Item 6", "page6.html"))
Menu1.Items.Add(submenu1)

Dim submenu2 As New skmMenu.MenuItem("<img src=""images/menublip.gif"" align=""absmiddle"">Office", "")

submenu2.SubItems.Add(New skmMenu.MenuItem("Sub Item 1", "page3.html", "tooltip1"))
submenu2.SubItems.Add(New skmMenu.MenuItem("Sub Item 2", "page4.html", "tooltip2"))
Menu1.Items.Add(submenu2)

.............................

In the table I would have the following fields

-menuid
-name
-url
-level

I would be really really grateful if someone could give me some advice on how to achive this!

Thanks
Nov 18 '05 #1
0 878

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

Similar topics

8
by: kaptain kernel | last post by:
i've got a while loop thats iterating through a text file and pumping the contents into a database. the file is quite large (over 150mb). the looping causes my CPU load to race up to 100 per...
2
by: ensnare | last post by:
Hi all, I'm using a database session handler and am looking to loop through data residing in the sessions table to make a 'Users online' array. I've found that using urldecode on the data...
1
by: Matt | last post by:
how to get the last record from database without looping? Whenever the user need to insert a new record to the database, it just increment the id field by one from the last record. I tried...
4
by: Roy Adams | last post by:
Hi posting again because no answer to previous.. tring to loop through a recordset and update a record, thing is it only updates the first record in the table rather than searching through the...
4
by: Colin Steadman | last post by:
I've create a simple survey using ASP. Its finished and works, but one aspect of my coding is annoying me and I cant figure out a better way of doing it. Basically the questions are stored in...
7
by: Ken | last post by:
Hi All - I have a filtered GridView. This GridView has a check box in the first column. This check box is used to identify specific rows for delete operations. On the button click event I...
13
by: JayCallas | last post by:
I know this question has been asked. And the usual answer is don't use cursors or any other looping method. Instead, try to find a solution that uses set-based queries. But this brings up...
2
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First...
22
Dököll
by: Dököll | last post by:
Hiya, Partners! I have been into it for 12 hours straight this week-end, my son is very unhappy. Looks like I am getting pretty close but need your help, Again. I will post my first...
0
by: Rene Goris | last post by:
Hi all, I am trying to add meta:resourcekey's to database programmatically looping throug webcontrols, but i cann't read the 'meta:resourcekey' from the webcontrol. The 'meta:resourcekey' will...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.