O'Reilly logo

Essential ADO.NET by Bob Beauchemin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C.10. Relationships

If an element that is inferred as a table has a child element that is also inferred as a table, a DataRelation will be created between the two tables. A new column with a name of “ParentTableName_Id” will be added to both the table created for the parent element, and the table created for the child element. The ColumnMapping property of this identity column will be set to MappingType.Hidden. The column will be an auto-incrementing primary key for the parent table, and will be used for the DataRelation between the two tables. The data type of the added identity column will be System.Int32, unlike the data type of all other inferred columns, which is System.String. A ForeignKeyConstraint with DeleteRule = Cascade will also be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required