Hi every one any body can help me in this regards ? i don't know how to do that
how do i convert following code into sub catagory ?
like . . . -
Computer
-
Mainboards
-
Keyboards
-
Mouse
-
Process
-
Intel
-
AMD
-
these catagories i've got in database -
<%
-
Dim Conn, rsCatalog
-
Set Conn = Server.CreateObject("ADODB.Connection")
-
Conn.Open ConString
-
Set rsCatalog = Conn.Execute("SELECT * FROM catalogs")
-
While Not rsCatalog.EOF
-
-
Response.Write rsCatalog("catalogID")
-
rsCatalog.MoveNext
-
Wend
-
rsCatalog.Close
-
Set rsCatalog = Nothing
-
%>
-
but when i display it's just like not with subcatagories ? -
Computer
-
Mainboards
-
Keyboards
-
Mouse
-
Process
-
Intel
-
AMD
-
but i want just main 2 catagories like Computer & Process then any body click on the Computer section then it's bring subcatagories ?
4 1437
There are many ways to do something but the easiest would be to define whether the item is a top level item or a sub category item at a database level. In other words, Put a bit value in your database table. If it's top level item define a value of false, if it's a sub-level item define a value of true.
Then check the value as you loop through each record.. -
If rs("bSubCategory") = False Then 'Boolean value of false, it is a top level item, simply write it on the page
-
Response.Write rs("ID")
-
Else 'Boolean value of true, it's a sub-level item, put a blockquote around it to indent it to visually show it's a sub-level item.
-
Response.Write "<blockquote>"
-
Response.Write rs("ID")
-
Response.Write "</blockquote>"
-
End If
-
Sincerely,
Mark
Please read a recent post of mine to my personal blog about programming: Hierarchical Data Using SQL
It explains a common database table structure and some sample queries in regards to hierarchical data.
Hi
i still not figer it out can you plz see my code & figer it out how the best way to find that
thaxxxxxxxxxxxx xxxxxxxxxx
i still not figer it out can you plz see my code & figer it out how the best way to find that
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Brian Murphy |
last post by:
I have a php-based yahoo-like web directory.I wanna give webmasters
the possiblity to integrate my whole directory in their websites with
their own formatting.I wanna this inclusion to be possible to all
kinds of websites (ASP,PHP,... or just HTML).There are basically two
files in my website:
-index.php : shows the main categories along with 3 sample
subcategories.
-index1.php : displays the subcategories and sites of categories
(exactly...
|
by: DettCom |
last post by:
Hello,
I would like to be able to display or hide fields based on whether a
specific Yes/No radio button is selected. This is in conjunction with
a posting a just made here in the same group related to checkboxes.
Thanks!!!
|
by: Paul Hendryx |
last post by:
I have the table structure:
CREATE TABLE . (
IDENTITY (1, 1) NOT NULL ,
NOT NULL ,
NULL ,
(50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL
) ON
GO
|
by: vinayg |
last post by:
how can i search subcategory wise for a particular category,i want to display items.suppose user selected a particular category.I want to display all items in that category + its subcategories.
this is my table structure with 3 tables.
i need a sql query
http://www.ukrate.com/db.jpg
|
by: jmDesktop |
last post by:
I have read various things on subcategories. If there is only one
subcategory for a main category it doesn't seem too bad, just another
table, but I was wondering what some of you might recommend as the
best way to created subcategories. What if a subcategory has another
subcategory? I have read about sql adjacency models, but wanted a
real world example to see if this is necessary. thanks in advance.
| |
by: mbumbalough |
last post by:
I am working on building a dynamic menu that searches the database for the manufacturer ID to get the product catagories for the submenu. The problem that I am having right now is that when searching the Products table, there are multiple entries from the same manufacturer thus showing multiple instances of the same manufacturer in the menu. What I am trying to do is search the Products database table and get all of the Manufacturer IDs then...
|
by: DotNetNewbie |
last post by:
Hello,
I need to display a list of categories on the left side of a page, and
I am confused how I would do this using a List Control (as appose to
weaving my own HTML on the server side).
My HTML should look like:
<ul>
|
by: itpvision |
last post by:
Hello,
I have a link navigation of categories retrieved from the database,
while I know how to display subcategories based on category link
clicked with classical approach, I want to do this with ajax,
The problem is with the classical style,I know the GET sent and
the row im in with the category, so by simple comparison, I know how
to display the subcategories under its parent category, but with ajax,
I cannot know the GET and compare...
|
by: AaronL |
last post by:
Hello,
I am developing an e-commerce system and I want to be able to create catagories and subcatagories for items. I have the basics down however I may be making things too complicated. First I select a parent catagory and the page sucessfully brings me to the subcatagory screen, however anything past that, the catagory id variable is not being passed back to the application. Here is the code, hopefully someone can understand what I'm...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 we have to send another system
| |