Click here to Skip to main content
15,912,897 members
Home / Discussions / Database
   

Database

 
GeneralRe: database Idea Pin
modiagag11123-May-07 4:33
modiagag11123-May-07 4:33 
GeneralRe: database Idea Pin
kubben23-May-07 4:37
kubben23-May-07 4:37 
QuestionHow to connect a computer with a remote sql database? Pin
Leia201122-May-07 21:55
Leia201122-May-07 21:55 
AnswerRe: How to connect a computer with a remote sql database? Pin
Harini N K22-May-07 22:42
Harini N K22-May-07 22:42 
GeneralRe: How to connect a computer with a remote sql database? Pin
Leia201123-May-07 2:26
Leia201123-May-07 2:26 
GeneralRe: How to connect a computer with a remote sql database? Pin
Colin Angus Mackay23-May-07 3:45
Colin Angus Mackay23-May-07 3:45 
Questiondatagridview Pin
kylinqiu22-May-07 19:57
kylinqiu22-May-07 19:57 
Questioncalculate the LEVEL Of Node of a tree having exactly two node. Pin
singhal's22-May-07 19:55
singhal's22-May-07 19:55 
:-Dhi all,
i am a new guy..
i get good results from Recursive queries in sql server 2005 to count no of childs unde a node in a tree.

but now i am facing a problem ???

i have to define the level of a node ..

the case is as : starting from the rootnode of tree every node can have maximum of two node as left node and right node. not more than two node under a node.
so at level zero means root of node contains zero nodes.
suppose A is root of tree. first ledt node of A will be create afetr that right node a will be create. now A have two members under him so A is now at level one.
as suppose A have two node B(left)/C(right). and node B contais D/E as left right node and C(right of A ) contains F/G as Left/right node than at this level B exactly contains two nodes under him as well as C conyais two nodes . so binary has been complete. so now A is at level two.
now D has left only and G has only left node so at this level D E F G are uncomplete (having less tahn two nodes ) so now a is at two level.
so this is the pattern for that structure..
so have to et the level for every node in the tree.
now can i do
i am using asp . net 1.1/C# and sql server 2005.
This is the table structure for above :---Smile | :)
-------------------------------------------
Id name ParentId Left Right
--------------------------------------------
1 A -1/null 0 1
------------------------------------------
2 B 1 0 1
-------------------------------------------
3 C 1 0 1
--------------------------------------------
4 D 2 0 -1
----------------------------------------------
5 E 2 -1 -1
----------------------------------------------
6 F 3 -1 -1
-----------------------------------------------
7 G 3 0 -1
------------------------------------------------
8 H 4 -1 -1
--------------------------------------------
9 I 7 -1 -1
-----------------------------------------------
parent of A has null or -1 as reference .if a node has keft child that is represent by zero and for right one .
if a node does not contains any node this left=right will be -1;

so plz help me how can i set the level of a node in the tree.
the depth can be up to 50,000 node.




-- modified at 2:31 Thursday 24th May, 2007


-- modified at 2:34 Thursday 24th May, 2007

jh hsg sabdhas avdhagd advahgd axva

AnswerRe: plz help me send me query for this plz!! Pin
leckey23-May-07 3:56
leckey23-May-07 3:56 
QuestionGetting new line in XML? Pin
chand1022-May-07 18:14
chand1022-May-07 18:14 
AnswerRe: Getting new line in XML? Pin
Christian Graus22-May-07 20:11
protectorChristian Graus22-May-07 20:11 
QuestionInstallation SQL 2005 Express from a network Pin
jimbassett22-May-07 10:42
jimbassett22-May-07 10:42 
QuestionVisual Studio and SQL database Pin
CassT22-May-07 6:22
CassT22-May-07 6:22 
AnswerRe: Visual Studio and SQL database Pin
Expert Coming22-May-07 10:11
Expert Coming22-May-07 10:11 
GeneralRe: Visual Studio and SQL database Pin
CassT22-May-07 15:41
CassT22-May-07 15:41 
QuestionSSRS2005 User interface Pin
BLOEDHOND22-May-07 3:29
BLOEDHOND22-May-07 3:29 
AnswerRe: SSRS2005 User interface Pin
Dave Herren22-May-07 10:53
Dave Herren22-May-07 10:53 
GeneralRe: SSRS2005 User interface Pin
BLOEDHOND22-May-07 22:51
BLOEDHOND22-May-07 22:51 
GeneralRe: SSRS2005 User interface Pin
BLOEDHOND22-May-07 23:06
BLOEDHOND22-May-07 23:06 
QuestionNew line character in XML? [modified] Pin
chand1021-May-07 23:40
chand1021-May-07 23:40 
AnswerRe: New line character in XML? Pin
kubben22-May-07 3:17
kubben22-May-07 3:17 
QuestionOptimising stored procedure Pin
Pradip Kishore21-May-07 22:07
Pradip Kishore21-May-07 22:07 
AnswerRe: Optimising stored procedure Pin
Expert Coming21-May-07 22:19
Expert Coming21-May-07 22:19 
GeneralRe: Optimising stored procedure Pin
Ch_Shahzad iqbal21-May-07 23:01
Ch_Shahzad iqbal21-May-07 23:01 
QuestionSQL Connection Troubles Pin
BadKarma21-May-07 21:23
BadKarma21-May-07 21:23 

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.