|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
>> DataRelation and NullsHi, 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 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 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> -- Show quoteHide quoteMany thanks Jonathan Parminter "+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 > > >
Export nText as Files
BeginInvoke with a property? Loading controls with objects versus recordsets DataTable Loop and String Building Is there an easy way to get my Subnet Mask? TAG Property inheritance question Cast from string to System.DayOfWeek Need help in converting from C# to vb.net. vb.Script to VB.NET 2005 |
|||||||||||||||||||||||