Update Parent and Child Table
-
Hello every one; the below Code is to update Parent and Child table, the relationship between tables was set to (Relation only) on Data Designer, But on SQL Server, Update and Delete Rule set to (Cascade) with this setup Parent table was Updating ok, but child table return (Added/Modified) changes as nothing and did not get update I tried all cases to Set (Update-Delete-Accept/Reject) relationship Rules On Dataset Designer but did not solve the issue Could advise what to do here thanks in advance
ParentTableBindingSource.EndEdit
Dim My_Parent_Modified As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Modified)
Dim My_Parent_Added As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Added)
Dim My_Parent_Deleted As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Deleted)If My_Parent_ Modified Is Nothing = False Then
'Some Coding here
End if
If My_Parent_ Added Is Nothing = False Then
'Some Coding here
End if
If My_Parent_Deleted Is Nothing = False Then
'Some Coding here
End if
DataSet1.ParentTable.AcceptChangesChildTableBindingSource.EndEdit
Dim My_Child_Modified As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Modified)
Dim My_Child_Added As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Added)
Dim My_Child_Deleted As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Deleted)If My_Child_ Modified Is Nothing = False Then
'Some Coding here
End if
If My_Child_ Added Is Nothing = False Then
'Some Coding here
End if
If My_Child_Deleted Is Nothing = False Then
'Some Coding here
End if
DataSet1.ChildTable.AcceptChangesImad
-
Hello every one; the below Code is to update Parent and Child table, the relationship between tables was set to (Relation only) on Data Designer, But on SQL Server, Update and Delete Rule set to (Cascade) with this setup Parent table was Updating ok, but child table return (Added/Modified) changes as nothing and did not get update I tried all cases to Set (Update-Delete-Accept/Reject) relationship Rules On Dataset Designer but did not solve the issue Could advise what to do here thanks in advance
ParentTableBindingSource.EndEdit
Dim My_Parent_Modified As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Modified)
Dim My_Parent_Added As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Added)
Dim My_Parent_Deleted As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Deleted)If My_Parent_ Modified Is Nothing = False Then
'Some Coding here
End if
If My_Parent_ Added Is Nothing = False Then
'Some Coding here
End if
If My_Parent_Deleted Is Nothing = False Then
'Some Coding here
End if
DataSet1.ParentTable.AcceptChangesChildTableBindingSource.EndEdit
Dim My_Child_Modified As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Modified)
Dim My_Child_Added As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Added)
Dim My_Child_Deleted As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Deleted)If My_Child_ Modified Is Nothing = False Then
'Some Coding here
End if
If My_Child_ Added Is Nothing = False Then
'Some Coding here
End if
If My_Child_Deleted Is Nothing = False Then
'Some Coding here
End if
DataSet1.ChildTable.AcceptChangesImad
-
You already posted this question at Parent and child table update[^]. Please do not repost.