I have 2 datatables.
One is the master the other is the detail
When someone goes to delete a master record how can I check that there are no rows in my detail datatable that relate to the master table’s ID.
UPDATE: The user has the ability to select more than one master record at a time
I want to use LINQ if possible.
I started looking at DataTable.Rows.Cast()……
You don’t need LINQ for this.
Instead, you can check
masterRow.GetChildRows("RelationName").Length.EDIT: You should use a DataRelation.
If you really don’t want to, you can check
EDIT: To check for multiple parents: