This is a migrated thread and some comments may be shown as answers.

Bind without ParentID

2 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Cal
Top achievements
Rank 1
Cal asked on 02 Nov 2010, 03:34 AM
Hi,
  I realize this may be an odd question, but here is my situation, i have two tables:
table1:
stateid, statename

table2:
CountyId, CountyName, stateId

I'm trying to have a structure like this:

Statename
 --> CountyName

my challenge is how to relate the two table to get the parentId. 

I think the answer is simple but for some reason I just can't get the sql right.

Regards,
Cal

2 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 04 Nov 2010, 02:22 PM
Hi Cal,

Well, you need to add all records from table1 as records of table2.
Also you need to transform table2:
 - CountyId will become just id;
 - stateId will become parentId (this column should be nullable as the records representing states should have null for it).

From now on it's pretty straight-forward, isn't it?
Hope this is helpful for you!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Cal
Top achievements
Rank 1
answered on 04 Nov 2010, 04:16 PM
Amaaazingly simple :)
Tags
TreeView
Asked by
Cal
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Cal
Top achievements
Rank 1
Share this question
or