2
Answers

Can't get a simple Foreign Key relationship setup in C#...?

Todd Vance

Todd Vance

17y
9k
1

 

I am making two tables in a DBASE - Giving and Members -- The Members has a primary key of HouseholdName with all the member details (address, name, etc.) ---

 

The Giving table uses a PK ID.

 

I go to the Dataset designer and I click on the HouseholdName (PK) in the Members table and drag to the HouseholdName in the Giving table --- a menu pops up and I select Foreign Key Constraint only.

 

I want every giving instance to have a HouseholdName attached.... simple right???

 

NOT --  I put in a couple rows of data -- the HouseHold name FK in Giving has the same names as the ones in the Members table (see below)  but when I run it, I get this error:

 

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

 

I have checked and re-checked and do not know what is wrong.  *** I know the names are the same, the types are the same... I even tried dragging the OTHER way in my Diagram and still got the same error.... can someone please help me?

 

Thanks!!!!

 

GIVING TABLE:

1 7/1/2007 12:00:00 AM G 100.0000 VanceTE
2 7/4/2007 12:00:00 AM T 300.0000 LarsonJL
3 6/5/2007 12:00:00 AM T 450.0000 VanceTE

 

MEMBERS TABLE:

AndersonAA John Anderson 111 Blvd Chatham IL         61111
BakerBB Paul & Doris Baker 222 Street Springfield IL         62222
LarsonJL John & Blaine Larson 111 Avenue Auburn IL         61111
VanceTE Todd & Dawn Vance 1560 W. Decatur Decatur IL         62522

Answers (2)