Click here to Skip to main content
15,900,589 members
Home / Discussions / Database
   

Database

 
GeneralRe: Same SQL Statement in access and in vb.net return difference result Pin
Mekong River28-Dec-04 14:56
Mekong River28-Dec-04 14:56 
GeneralQuerying CSV file using ODBC Pin
Wayne Phipps27-Dec-04 9:12
Wayne Phipps27-Dec-04 9:12 
GeneralMS-Access insert problem Pin
Imtiaz Murtaza27-Dec-04 0:38
Imtiaz Murtaza27-Dec-04 0:38 
GeneralRe: MS-Access insert problem Pin
Rob Graham31-Dec-04 3:54
Rob Graham31-Dec-04 3:54 
Questionhow to use ADO Event with VC6.0? Pin
深蓝26-Dec-04 19:26
深蓝26-Dec-04 19:26 
GeneralCrystal Reports... Pin
dSolariuM26-Dec-04 15:41
dSolariuM26-Dec-04 15:41 
GeneralSql variable Value Problem Pin
Hemant_Mane200325-Dec-04 3:14
sussHemant_Mane200325-Dec-04 3:14 
GeneralLooping Through Table Display Category Hierarchy Pin
tech@untouchable24-Dec-04 9:35
tech@untouchable24-Dec-04 9:35 
I have my category hiearchy stored within a table called categories. What I need to do is display the actual category hiearchy with a single sql statement.

For example:
I have the following data in the table

category | category_no | category_above
---------------------------------------------------
Computers | 1 | 0
Dell | 24 | 1
Sony | 48 | 1
Pentium 4 | 33 | 24
Pentium 4 | 85 | 48

How would i query a database to sort the records as follows (in the category hierarchy)?

Computers, Dell, Pentium 4, Sony, Pentium 4

so i could then generate text that looks like

Computers
-->Dell
----->Pentium 4
-->Sony
----->Pentium 4

Anyone have any ideas? Right now I have a function that loops through, but the problem is it's using too many resources...I have to open a database connection each time i loop through. So if I had 500 categories i'd be opening 500 database connections, which i don't want.

Any help?
GeneralRe: Looping Through Table Display Category Hierarchy Pin
sreejith ss nair27-Dec-04 19:05
sreejith ss nair27-Dec-04 19:05 
GeneralRe: Looping Through Table Display Category Hierarchy Pin
Anonymous28-Dec-04 5:13
Anonymous28-Dec-04 5:13 
GeneralRe: Looping Through Table Display Category Hierarchy Pin
sreejith ss nair28-Dec-04 16:07
sreejith ss nair28-Dec-04 16:07 
QuestionSqlConnection string? Pin
murali_utr24-Dec-04 2:14
murali_utr24-Dec-04 2:14 
AnswerRe: SqlConnection string? Pin
Michael P Butler24-Dec-04 3:45
Michael P Butler24-Dec-04 3:45 
AnswerRe: SqlConnection string? Pin
Colin Angus Mackay24-Dec-04 14:53
Colin Angus Mackay24-Dec-04 14:53 
GeneralRe: SqlConnection string? Pin
johan313127-Dec-04 23:06
johan313127-Dec-04 23:06 
GeneralRe: SqlConnection string? Pin
Colin Angus Mackay28-Dec-04 0:49
Colin Angus Mackay28-Dec-04 0:49 
GeneralRe: SqlConnection string? Pin
Johan Finland228-Dec-04 21:17
sussJohan Finland228-Dec-04 21:17 
GeneralRe: SqlConnection string? Pin
Colin Angus Mackay29-Dec-04 1:27
Colin Angus Mackay29-Dec-04 1:27 
General[SQL] Using 'Like' operator for prepared statement Pin
ppp00123-Dec-04 15:03
ppp00123-Dec-04 15:03 
GeneralRe: [SQL] Using 'Like' operator for prepared statement Pin
GreggS24-Dec-04 2:31
GreggS24-Dec-04 2:31 
GeneralRe: [SQL] Using 'Like' operator for prepared statement Pin
Chris Meech24-Dec-04 2:54
Chris Meech24-Dec-04 2:54 
QuestionHow to add/update/delete more than 1 record in datagrid at one go Pin
amittinku23-Dec-04 0:08
amittinku23-Dec-04 0:08 
AnswerRe: How to add/update/delete more than 1 record in datagrid at one go Pin
Charlie Williams23-Dec-04 6:49
Charlie Williams23-Dec-04 6:49 
GeneralRe: How to add/update/delete more than 1 record in datagrid at one go Pin
amittinku23-Dec-04 17:09
amittinku23-Dec-04 17:09 
GeneralRe: How to add/update/delete more than 1 record in datagrid at one go Pin
Colin Angus Mackay24-Dec-04 14:55
Colin Angus Mackay24-Dec-04 14:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.