Unique columns in a dataset

  • Thread starter Thread starter Michael Jackson
  • Start date Start date
M

Michael Jackson

I have a dataset with which I want to populate a TreeView. This dataset
contains tasks by person, therefore a person will repeat often in the
dataset. The first node of the TreeView is "Person" and under this node is
his/her tasks. I want one node per unique person in the dataset, not one
node per instance of the person. How would I accomplish this using datasets,
elegantly.

Thanks
Michael
 
Michael Jackson said:
The first node of the TreeView is "Person" and under this node is his/her
tasks.

1.
create table person
(
personID int not null primary key,personName varchar(60)
)

create table task
(
recordNum int identity not null primary key
, personID int not null
, taskID int not null
, taskname varchar(80)
)

2. Establish "Relation" in the DataSet with PersonID as Parent Node and
TaskID as ChildNode. Make sure the DataSet hosts 2 tables (Person & Task)

3. Populate the DataSet to DataGrid to make sure it works. Because DataGrid
is the easiest control to play with (to me).

4. Populate the DataSet to the TreeView.

*************
John Webbs
 
Back
Top