开发者

Relations between tables

开发者 https://www.devze.com 2023-01-25 02:51 出处:网络
I have two tables (picture), AirportIn is a foreign key of AirportID, and AirportOut is also a foreign key of AirportID.

I have two tables (picture), AirportIn is a foreign key of AirportID, and AirportOut is also a foreign key of AirportID.

Relations between tables

开发者_运维百科

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消