private void InitClass() { base.set_DataSetName("StreetsHousesFlatsDS"); base.set_Prefix(""); base.set_Namespace("http://tempuri.org/StreetsHousesFlatsDS.xsd"); base.set_EnforceConstraints(true); this.set_SchemaSerializationMode(System.Data.SchemaSerializationMode.IncludeSchema); this.tableStreets = new StreetsDataTable(); base.Tables.Add(this.tableStreets); this.tableHouses = new HousesDataTable(); base.Tables.Add(this.tableHouses); this.tableFlats = new FlatsDataTable(); base.Tables.Add(this.tableFlats); System.Data.ForeignKeyConstraint constraint = new System.Data.ForeignKeyConstraint("StreetsHouses", new System.Data.DataColumn[] { this.tableStreets.IdColumn }, new System.Data.DataColumn[] { this.tableHouses.ParentIdColumn }); this.tableHouses.Constraints.Add(constraint); constraint.set_AcceptRejectRule(System.Data.AcceptRejectRule.None); constraint.set_DeleteRule(System.Data.Rule.Cascade); constraint.set_UpdateRule(System.Data.Rule.Cascade); this.relationStreetsHouses = new System.Data.DataRelation("StreetsHouses", new System.Data.DataColumn[] { this.tableStreets.IdColumn }, new System.Data.DataColumn[] { this.tableHouses.ParentIdColumn }, false); this.Relations.Add(this.relationStreetsHouses); this.relationHousesFlats = new System.Data.DataRelation("HousesFlats", new System.Data.DataColumn[] { this.tableHouses.IdColumn }, new System.Data.DataColumn[] { this.tableFlats.ParentIdColumn }, false); this.Relations.Add(this.relationHousesFlats); }
internal void InitVars(bool initTable) { this.tableStreets = (StreetsDataTable) base.Tables.get_Item("Streets"); if (initTable && (this.tableStreets != null)) { this.tableStreets.InitVars(); } this.tableHouses = (HousesDataTable) base.Tables.get_Item("Houses"); if (initTable && (this.tableHouses != null)) { this.tableHouses.InitVars(); } this.tableFlats = (FlatsDataTable) base.Tables.get_Item("Flats"); if (initTable && (this.tableFlats != null)) { this.tableFlats.InitVars(); } this.relationStreetsHouses = this.Relations.get_Item("StreetsHouses"); this.relationHousesFlats = this.Relations.get_Item("HousesFlats"); }