Our company designing Accounting Systems which Have Chart of Accounts Of Infinite Levels And these numbers is not unique For Example
1000 / Assets
1100 / Current Assets
So I Need to make
L1 L2 L3 L4 L5 And So on.. Of infinite Levels
1100/100/200/300/100
But There`s Also 100, 200 ,300 of Another Category Called Liabilities For Example
2000 Liabilities
2100 short term liabilities
L1 L2 L3 L4 L5
SO Theres Account Like this : 2100/100/200/300/100
Finally, What i try to do is designing this accounting Table Like This :
Table Name : Account
[AccountID, ParentID, Level, Name] I Guess i make AccountID, ParentID,Level CompositeKey
The Question Is How I Know that 100 inherit from 300 inherit from 200 And Came From Liabilities 2100 ? it will also came from Parent 1100
That`s Problem maybe i cant design this well,
I know i can use Levels As String Not Integer But Big Data and big records will make queries slow For Example Inside Account Table ParentID Can Be 2100/100/200/300
And This maybe will work, but how i design these with Integer Values And Infinite Child Of Child
Another Additional Question : How I Attach This To TreeView DataSource !
Sorry, if i make you guys misunderstanding or can`t explain it well.
What I have tried:
Desiging Normal Table Of ID, ParentID, but i actually Fail.