hierachical related data in datatset

  • Thread starter Thread starter Jon Vaughan
  • Start date Start date
J

Jon Vaughan

I have a hierachical dataset brought back from a sql server stored procedure
with a design as follows :

StaffID
<Staff Columns>

AddressID
<Address Columns>
StaffID_FK

PhoneID
<Phone Columns>
AddressID_FK

Im using a disconnected architecture, so when I recieve the dataset , I
remap the the relationship (is there no way to get this relationship from
sql server - see's silly remapping). What im now looking to do is to
duplicate a staff members data , if I copied a row from the Staff table will
all the related data also be duplicated ? and if it wont whats the best way
to achieve this result ?

Jon
 
Jon,

First of all if you use a newsreader as Outlook Express, do us than a favor
and don't multipost. Crossposting is appriciated in these dotnet newsgroup.
Sending one message to more newsgroups at once.
Im using a disconnected architecture, so when I recieve the dataset , I
remap the the relationship (is there no way to get this relationship from
sql server - see's silly remapping). What im now looking to do is to
duplicate a staff members data , if I copied a row from the Staff table
will all the related data also be duplicated ? and if it wont whats the
best way to achieve this result ?

It will not automaticly be duplicated, if there is a reference to it, is
completely dependend how that you made your relation and how you do that
copying.

I hope this helps,

Cor
 
Appologies for the mulitple post. I posted here and then found the ado group
after and posted there as it was more relavent.

About the relationship. I pull back the dataset over a webservice, as none
of the relational data comes I then re added it using :

dSet.Relations.Add("Rel1", dSet.Tables("Tbl1").Columns( .......

To replicate the relationship that was state in SQL Server.

In this situtauion what is the better method to replicate ?

Thanks

Jon
 
Jon,

I assume that the relationship is set on the webservice or do I see that
wrong, otherwise you should have to set it again of course.

I assume as well that the dataset is normal tranported using a VS created
webservice and not as a kind of file. Than I would add the schema
information to it.

Cor
 
You are right the relationship is set on the web services , but we are
digressing from the original point which is, whats the best way to duplicate
a row and its related records in a hierachical dataset ?
 
Jon,

I was starting my first message about the way you was duplicating. That word
can mean a lot.

Do you create a new member with a new key or are you importing the datarow
to a cloned dataset. This makes of course a lot of difference.

However, there will AFAIK never be an automatic copy of childrows then. A
second point is that a DataSet realation is forever a "one to more"
relation, so the reference cannot stay as well.

Cor
 
Cor,

The process is :

interface calls web service
web service returns a dataset
this dataset doesnt contain any relational data , so its added using :
dSet.Relations.Add("Rel1", dSet.Tables("Tbl1").Columns( .......
Now all I was wanting to do was , copy the root item and have all the one to
many sides cascade copy over as well.

Hope this is the information you were looking for ?

J
 
Thanks loads cor , I will have a play aroudn and see which suits me better ,
starting with 2.0 first :)
 
Back
Top