PC Review


Reply
Thread Tools Rate Thread

DataSet with multiple relations to

 
 
Jonas
Guest
Posts: n/a
 
      15th Feb 2005
Hi!

I'm using a typed dataset where I have a common address table which is
related to several other tables in the dataset, see below:

Table Incident:
- PK
- FK_incidentAddress - relation to Address.PK
- FK_destinationAddress - relation to Address.PK
....

Table Person:
- PK
- FK_homeAddress - relation to Address.PK
....

Common table Address
- PK
- Street
- City
.....

If I use one Address entity in the dataset, I guess that I'll get problems
as one row in Address can not satisfy all the relations specified. If I
instead create multiple Addresses which I give different names, and the
relate each of them to their parent, I get ConstraintExceptions when trying
to enable constraints in the dataset after merging the child rows. It seems
like it is the rename of a Address table that creates my problem.

Any tips?

Brgds

Jonas


 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      15th Feb 2005
Hi Jonas,

"Jonas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> If I use one Address entity in the dataset, I guess that I'll get problems
> as one row in Address can not satisfy all the relations specified.


No problems there. The address row doesn't need to satisfy all relations, or
better, it doesn't need to satisfy any relation.
On the other hand, if you put some value into, for example,
FK_incidentAddress, there has to be related row in Address table.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

If I
> instead create multiple Addresses which I give different names, and the
> relate each of them to their parent, I get ConstraintExceptions when
> trying to enable constraints in the dataset after merging the child rows.
> It seems like it is the rename of a Address table that creates my problem.
>
> Any tips?
>
> Brgds
>
> Jonas
>



 
Reply With Quote
 
Jonas
Guest
Posts: n/a
 
      15th Feb 2005
Hi Miha,

thank you for your very fast response. I tried it, and it worked like a
charm. I guess that I complicated the problem before trying out the simplest
solution :-/

Thanks

Jonas



"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:(E-Mail Removed)...
> Hi Jonas,
>
> "Jonas" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> If I use one Address entity in the dataset, I guess that I'll get
>> problems as one row in Address can not satisfy all the relations
>> specified.

>
> No problems there. The address row doesn't need to satisfy all relations,
> or better, it doesn't need to satisfy any relation.
> On the other hand, if you put some value into, for example,
> FK_incidentAddress, there has to be related row in Address table.
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> www.rthand.com
> SLODUG - Slovene Developer Users Group www.codezone-si.info
>
> If I
>> instead create multiple Addresses which I give different names, and the
>> relate each of them to their parent, I get ConstraintExceptions when
>> trying to enable constraints in the dataset after merging the child rows.
>> It seems like it is the rename of a Address table that creates my
>> problem.
>>
>> Any tips?
>>
>> Brgds
>>
>> Jonas
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Relations in Dataset MRW Microsoft ASP .NET 0 2nd Dec 2006 08:34 PM
Retrieve info from Dataset with Relations (Dataset,SQL or XML) Joe Microsoft C# .NET 2 4th Apr 2006 01:58 PM
One more about dataset relations Mr.Matthew.Smith@gmail.com Microsoft C# .NET 1 2nd Nov 2005 09:41 PM
Re: How to display a dataset with multiple relations Cor Ligthert Microsoft VB .NET 0 10th Sep 2004 09:33 AM
Dataset Relations rhill Microsoft ADO .NET 0 10th Jul 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:00 AM.