Home All Groups Group Topic Archive Search About

>> DataRelation and Nulls

Author
29 Apr 2006 8:43 AM
Jonathan
Hi,  I have two table (Business and Contacts) for which I would like to
create a DataRelation. The problem is that the Foreign key field cannot be
null. So the code throws an exception when trying to create the DataRelation.

My database does not have any records; business or contacts. How do I create
a data relation when the data does not yet exist? Then what if I want to add
a business record and don't have a contact?

--
Many thanks
Jonathan Parminter

Author
29 Apr 2006 6:55 PM
+Vice
I think you problem may lie in the fact that your Foreign Key may be setup
as a nullable field and this is basically saying you can't do that.  Modify
your table with the Foreign Key column and set it not to allow nulls.

Show quoteHide quote
"Jonathan" <Jonat***@discussions.microsoft.com> wrote in message
news:283F82A9-A4E7-4815-9F0F-EA157AD796C3@microsoft.com...
> Hi,  I have two table (Business and Contacts) for which I would like to
> create a DataRelation. The problem is that the Foreign key field cannot be
> null. So the code throws an exception when trying to create the
> DataRelation.
>
> My database does not have any records; business or contacts. How do I
> create
> a data relation when the data does not yet exist? Then what if I want to
> add
> a business record and don't have a contact?
>
> --
> Many thanks
> Jonathan Parminter
Author
29 Apr 2006 9:31 PM
Jonathan
Thanks friend, in checking whether the foreign key field did allow nulls I
found that <face color=red> the actual problem was a spelling mistake! </face>

--
Many thanks
Jonathan Parminter


Show quoteHide quote
"+Vice" wrote:

> I think you problem may lie in the fact that your Foreign Key may be setup
> as a nullable field and this is basically saying you can't do that.  Modify
> your table with the Foreign Key column and set it not to allow nulls.
>
> "Jonathan" <Jonat***@discussions.microsoft.com> wrote in message
> news:283F82A9-A4E7-4815-9F0F-EA157AD796C3@microsoft.com...
> > Hi,  I have two table (Business and Contacts) for which I would like to
> > create a DataRelation. The problem is that the Foreign key field cannot be
> > null. So the code throws an exception when trying to create the
> > DataRelation.
> >
> > My database does not have any records; business or contacts. How do I
> > create
> > a data relation when the data does not yet exist? Then what if I want to
> > add
> > a business record and don't have a contact?
> >
> > --
> > Many thanks
> > Jonathan Parminter
>
>
>