473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

hierachical related data in datatset

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
May 1 '06 #1
8 1089
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
May 1 '06 #2
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
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:es**************@TK2MSFTNGP05.phx.gbl...
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

May 1 '06 #3
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
May 1 '06 #4
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 ?
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:u4*************@TK2MSFTNGP03.phx.gbl...
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

May 1 '06 #5
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
May 1 '06 #6
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
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
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

May 1 '06 #7
Jon,

There are two methods, for 1.x you can in my opinon only use the GetChilds
from the parent relation.

http://msdn.microsoft.com/library/de...drowstopic.asp

In 2.0 you can ignore the relation. Set the key from the relation in the
datarow filter and than use the new method ToTable.

http://msdn2.microsoft.com/en-us/library/a8ycds2f.aspx

As you probably already understand do I prefer the last one.

I hope this helps,

Cor

"Jon Vaughan" <jo**********@hotmail.com> schreef in bericht
news:BI********************@fe02.news.easynews.com ...
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
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
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


May 1 '06 #8
Thanks loads cor , I will have a play aroudn and see which suits me better ,
starting with 2.0 first :)

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:u9**************@TK2MSFTNGP03.phx.gbl...
Jon,

There are two methods, for 1.x you can in my opinon only use the GetChilds
from the parent relation.

http://msdn.microsoft.com/library/de...drowstopic.asp

In 2.0 you can ignore the relation. Set the key from the relation in the
datarow filter and than use the new method ToTable.

http://msdn2.microsoft.com/en-us/library/a8ycds2f.aspx

As you probably already understand do I prefer the last one.

I hope this helps,

Cor

"Jon Vaughan" <jo**********@hotmail.com> schreef in bericht
news:BI********************@fe02.news.easynews.com ...
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
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
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



May 1 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Mike MacSween | last post by:
I have an app I need a hierachical structure for. There seem to be 3 ways of implementing this, as far as I can see: 1. Adjacency list. Pros - intuitive and relatively simple Cons - not easily...
2
by: Jim in Arizona | last post by:
Usually, If i need special formatting, I don't use the datagrid control and use a loop that processes a table for each record read from the database (as in classic asp) like so: ...
1
by: thf | last post by:
Hi, I wish to know how to display a collection of object which is a property in another object in a data grid in VB.Net. For example, I'm displaying a collection of vendor objects (in ArrayList)...
1
by: Chuck Gantz | last post by:
I have an existing XML file that I read into a data set ds. The XML is hierarchical; i.e., it looks like <A> <B> <C> <D> element1<\D> <E> element2<\E> <\C> <C>
0
by: lvpaul | last post by:
Hello ! I am calling a .NET Webservice and getting back a ADO.NET Datatset. How can I convert this to an PHP-Array ? $ergebnis = $m_service->call( $function, $data ); print_r($ergebnis)...
1
by: David | last post by:
Hi, I have an MS Access app which lets me create a new product by copying data from another selected product. All works fine, except one of the copy updates which I cannot fathom. The code...
4
by: HLCruz via AccessMonster.com | last post by:
I am working with a database that has client information separated in to 4 related tables - tFolder, tAddress, tEmail, tPhone number. In addition there are related tables tGifts and tCalls. The...
7
by: JJ | last post by:
I am trying to set up a SQL table with associated stored procedures to be able to have nested 'categories' to any depth. I need to then be able to retrieve (or move or delete) a particular...
4
by: JJ | last post by:
I want to be able to display items and their categories on a page, so that the user can click on an item to edit it, or add further items or categories. Simple enough, however, I want to do it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.