If I create a child relationship between 2 tables, but the parent table has a
value which is not found in the child table, then this will cause an
exception....right? So how to I indicate that the parent/child relationship
may or may not exists so that no exception is generated when that occurs?

Re: Child Relationships by Sahil

Sahil
Thu May 26 14:45:47 CDT 2005

Well if the data doesn't satisfy the relation - then you can't create the
relation :-). Otherwise the relation would be no use .. right?

You can try using a nullable FK though.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



"Jim Heavey" <JimHeavey@discussions.microsoft.com> wrote in message
news:626B47B6-1774-428C-ACD5-581B391F013A@microsoft.com...
> If I create a child relationship between 2 tables, but the parent table
has a
> value which is not found in the child table, then this will cause an
> exception....right? So how to I indicate that the parent/child
relationship
> may or may not exists so that no exception is generated when that occurs?



RE: Child Relationships by ThorKornbrek

ThorKornbrek
Tue May 31 18:02:28 CDT 2005

If you are using an instance of the DataRelation class you can pass a
parameter in the constructor telling ado.net not to enforce constraints.

Documentation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarelationclassctortopic3.asp
--
Thor Kornbrek
.Net Developer



"Jim Heavey" wrote:

> If I create a child relationship between 2 tables, but the parent table has a
> value which is not found in the child table, then this will cause an
> exception....right? So how to I indicate that the parent/child relationship
> may or may not exists so that no exception is generated when that occurs?