Q:
You ASP.NET application manages order entry data by using a DataSet object named EXorderEntry. The EXorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.
You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.What is the most likely cause of the problem?
Answer & Explanation
Answer: D) The current value of OrderDetails.KeyDeleteRule is Rule.None.
Explanation: The rule enumeration indicates the action that occurs when a ForeignKeyConstraint is enforced.None specifies that no action will occur, but exceptions are generated. This is what has occurred in this scenario.
Incorrect Answers:
A: Cascade specifies that all rows containing that value are also deleted.
B: SetNull specifies that values in all child columns are set to null values.
C: SetDefault specifies that all child columns be set to the default value for the column.
View Answer
Report Error
Discuss