×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

问个C#问题

dtOrders = dsOrdres.Tabls["orders"];
dtOrderDetails=dsOrders.Tables{"orderDetail"];
colParent=dtOrders.Columns['OrderID"];
colChild = dtOrderDetails.Columns["ParentOrderID"];
dsOrders.Relations.Add("Rell",colParent,colChild, false);

运行后发现出错,有2个答案,选一个:

1.Ensure that the child column and parent column have the same datatype
2.Ensure that each row in the child table has a corresponding row in the parent table

我在一些资料上看到是1,但另一些是2,实际试了试也没出错,有人能解释一下吗。到底那个对。
Report

Replies, comments and Discussions:

  • 工作学习 / 专业知识杂谈 / 问个C#问题
    dtOrders = dsOrdres.Tabls["orders"];
    dtOrderDetails=dsOrders.Tables{"orderDetail"];
    colParent=dtOrders.Columns['OrderID"];
    colChild = dtOrderDetails.Columns["ParentOrderID"];
    dsOrders.Relations.Add("Rell",colParent,colChild, false);

    运行后发现出错,有2个答案,选一个:

    1.Ensure that the child column and parent column have the same datatype
    2.Ensure that each row in the child table has a corresponding row in the parent table

    我在一些资料上看到是1,但另一些是2,实际试了试也没出错,有人能解释一下吗。到底那个对。
    • 这是个MCPD的题。1对。如果,dsOrders.Relations.Add("Rell",colParent,colChild, true); 2对