I have 2 tables, 1 containing categories (parent) and another one containing sub-categories (children).
The sub-categories table has a reference to the parent in fldPID field:
I'm trying to fill a listbox which would list the parent category with sub-categories listed below each parent
so the results would look like this:
Parent 1 Cate
> Sub 1
> Sub 2
Parent 2 Cate
> Sub 1
Parent 3 Cate
> Sub 1
In classic ASP 3.0 I'd use 2 recordsets to achieve it, but in .NET apparently I can not have 2 datareaders open for 1 connection.
Any ideas ?
"Taxes are the fees we pay for civilized society" G.W.
The sub-categories table has a reference to the parent in fldPID field:
Code:
CREATE TABLE [tbl_m_cate] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[fldNAME] [varchar] (150) NULL ,
) ON [PRIMARY]
CREATE TABLE [tbl_s_cate] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[fldNAME] [varchar] (150) NULL ,
[fldPID] [int] NULL ,
) ON [PRIMARY]
I'm trying to fill a listbox which would list the parent category with sub-categories listed below each parent
so the results would look like this:
Parent 1 Cate
> Sub 1
> Sub 2
Parent 2 Cate
> Sub 1
Parent 3 Cate
> Sub 1
In classic ASP 3.0 I'd use 2 recordsets to achieve it, but in .NET apparently I can not have 2 datareaders open for 1 connection.
Any ideas ?
"Taxes are the fees we pay for civilized society" G.W.