Пример #1
0
        public void AddRange()
        {
            DataRelationCollection drcol = _dataset.Relations;
            DataRelation           dr1   = new DataRelation("CustOrder"
                                                            , _dataset.Tables["Customer"].Columns["custid"]
                                                            , _dataset.Tables["Order"].Columns["custid"]);
            DataRelation dr2 = new DataRelation("ItemOrder"
                                                , _dataset.Tables["Item"].Columns["itemid"]
                                                , _dataset.Tables["Order"].Columns["custid"]);

            drcol.AddRange(new DataRelation[] { dr1, dr2 });

            Assert.Equal("CustOrder", drcol[0].RelationName);
            Assert.Equal("ItemOrder", drcol[1].RelationName);
        }