题目内容
(请给出正确答案)
[主观题]
You create a Web Form that displays a GridView. The GridViews data source is a DataSet nam
ed dsOrders. The DataSet contains two DataTables named Orders and OrderDetails. You create a relation between the two DataTables using the following code segment. (Line numbers are included for reference only.)01 dtOrders = dsOrders.Tables[“Orders”]; 02 dtOrderDetails = dsOrders.Tables[“OrderDetail”]; 03 colParent = dtOrders.Columns[“OrderID”]; 04 colChild = dtOrderDetails.Columns[“ParentOrderID”]; 05 dsOrders.Relations.Add(“Rell”, colParent, colChild, false); You need to find the cause of the exception being raised in line 05. What should you do? ()
A. Ensure that the child column and the parent column have the same names.
B. Ensure that the child table and the parent table have the same names.
C. Ensure that the child column and the parent column have the same data types.
D. Ensure that each row in the child table has a corresponding row in the parent table.
E. Ensure that the tables have an explicit relationship defined by a foreign key constraint in the database.
查看答案
如果结果不匹配,请 联系老师 获取答案