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

Re: DataSet with multiple relations to by Miha

Miha
Tue Feb 15 04:11:33 CST 2005

Hi Jonas,

"Jonas" <jonas@no.spam.pl> wrote in message
news:O557CE0EFHA.1348@TK2MSFTNGP14.phx.gbl...

> 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
>



Re: DataSet with multiple relations to by Jonas

Jonas
Tue Feb 15 04:41:12 CST 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:ORCi7a0EFHA.3908@TK2MSFTNGP12.phx.gbl...
> Hi Jonas,
>
> "Jonas" <jonas@no.spam.pl> wrote in message
> news:O557CE0EFHA.1348@TK2MSFTNGP14.phx.gbl...
>
>> 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
>>
>
>