private mmSaveDataResult DoBasicSave() { // always save new comments (child table in example) // set status, date, user to comment in dsChild int rowAdded = ChildHelper.Add(eChild, oChild, eMdtUser.Logon, eParent.Status, NoteLocation.Comment, this.txtComments.Text); // Save the DataSet (automatically binds back) mmSaveDataResult saveResult = this.Save(this.oParent, this.dsParent); if (saveResult == mmSaveDataResult.RulesPassed) { // go back to list Response.Redirect("default.aspx"); } else // some kind of error { // *** if mmSaveDataResult.RuleWarnings // *** the child table is already saved!!! // *** now need to Delete() it, otherwise duplicated // *** if user saves DESPITE warnings // *** this only works when mmSaveDataResult.RulesBroken // *** as child table NOT saved // remove and record from child DataSet // (page logic inserts it programatically again if (rowAdded > -1) { ChildHelper.Remove(eChild, oChild, rowAdded); } // save data Session["dsParent"] = this.dsParent; Session["dsChild"] = oChild.GetCurrentDataSet(); } }Now the obvious workaround is to disconnect the child table from the parent and
mmSaveDataResult saveResult = this.Save(this.oParent, this.dsParent); if (saveResult == mmSaveDataResult.RulesPassed) { // add new comment (child record) // ... // *** save child separately this.Save(this.oChild, this.dsChild); // go back to list Response.Redirect("default.aspx"); } else // some kind of error { ... }But, I thought I'd point out the problem. Any suggestions?