Relations between tables
I have two tables (picture), AirportIn is a foreign key of AirportID, and AirportOut is also a foreign key of AirportID.
The problem is I can't make relations between these tables like this:
dataset.Relations.Add("AirportFlight", dataset.Tables["Airport"].Columns["AirportID"], dataset.Tables["Flight"].Columns["AirportIn"]);
dataset.Relations.Add("AirportFlight", dataset.Tables["Airport"].Columns["AirportID"], dataset.Tables["Flight"].Columns["AirportOut"]);
In runtime I get an error. How to solve the problem ?
Give the 2 relations unique names.
精彩评论