tags:

views:

8

answers:

0

In the physical MS Access DB the name of child column is Customer but if I use childCol = dataSet.Tables["Orders"].Columns["Customer"]; it doesn't work, I have to put the same name CustomerID as for ParentCol, that's illogical to me. So why ? And how .NET will recognize on which child column the link is done then ?

            parentCol = dataSet.Tables["Customers"].Columns["CustomerID"];
            childCol = dataSet.Tables["Orders"].Columns["CustomerID"];

            // Create the DataRelation
            relCustOrder = new DataRelation("CustomerOrders", parentCol, childCol, false);
            // Add the relation to the DataSet.
            dataSet.Relations.Add(relCustOrder);

related questions