I have two tables- one called territory and the other called contacts. Each contact can belong to a territory.
On my form, i allow the user to delete a territory. However, i don't want to actually delete the contacts associated with this territory from the database. I just want to set the territoryID on them to DBNULL.
I don't have any relationships set at the database level that will cause an automatic deletion of these child records.
Right now, when the user clicks on the delete button, the territory row is properly removed from the datagrid control. But now I'd like to set up my SAVE button so that I have a change to reset the territoryIDS on the child records... and then delete the territory from the database.
So far, in my save button I have
Dim TerritoryDeletions() As DataRow = TerritoryDS.Territory.Select("", "", DataViewRowState.Deleted)
I don't know how to loop through this territoryDeletions object and get all the territory IDs.
On my form, i allow the user to delete a territory. However, i don't want to actually delete the contacts associated with this territory from the database. I just want to set the territoryID on them to DBNULL.
I don't have any relationships set at the database level that will cause an automatic deletion of these child records.
Right now, when the user clicks on the delete button, the territory row is properly removed from the datagrid control. But now I'd like to set up my SAVE button so that I have a change to reset the territoryIDS on the child records... and then delete the territory from the database.
So far, in my save button I have
Dim TerritoryDeletions() As DataRow = TerritoryDS.Territory.Select("", "", DataViewRowState.Deleted)
I don't know how to loop through this territoryDeletions object and get all the territory IDs.