esakal

esakal

  • NA
  • 1
  • 0

Dataset issue - How should i define the relations between tables (in terms of definitions)...

Dec 16 2005 8:09 PM
Hello,

I'm using vs2005 and i have the following dataset:
http://www.optimus.co.il/tarshim1.jpg

Description:
For each table, its' first column is a primary key.
The relation between "ParentTable" to "ChildsTable" is one-2-many
The relation between "ChildsTable" to "SubChildTable" is one-2-one.

The idea is that each row in "ChildsTable" can have corresponding row in "SubChildTable", if there is no row related in "SubChildTable" then the value of the column "SubChildID" in "ChildsTable" will be null.

i want to create relations between the tables so when you delete one line "ParentTable", the related rows in "ChildsTable" will also be deleted. then if in those rows, the field "SubChildID" is not null, the relevant row in "SubChildsTable" will also be deleted.

The problem is that when i do the link as shown in the hyperlink, i have 2 problems:
1. i can't set null value at "SubChildID".
2. i must add first an ID in "SubChildID" of "ChildsTable" before setting the row in the "SubChildTable" which is un reasonable.

What can i do?

Many thanks,
Eran.