mmSaveDataResult result = this.Save( oCustomer );
child business object tables get saved, but foreign keys DO NOT get populated with the Parent foreign key value.Business.cs public ABusinessObject() { ... this.RetrieveAutoIncrementPK = true; this.AutoSaveOnParentSaved = true; } public CustomerBusiness() { this.TableName = "Customers"; this.PrimaryKey = "CustomerID"; this.ClearOnFillDataSet = true; this.AutoUseTransactions = true; } public OrderBusiness() { this.TableName = "Orders"; this.PrimaryKey = "OrderID"; this.ForeignParentKeyField = "CustomerID"; }page
// declare BusinessObjects ... private void Page_Load(object sender, System.EventArgs e) { // instantiate the business objects and register with the form ... // create business object hierarchy oCustomer.RegisterChildBizObj(oOrder); ... if (! IsPostBack) { if (Request.QueryString["id"] == String.Empty) { oCustomer.GetEmptyDataSet(); oCustomer.NewRow(); dsCustomer oCustomer.GetCurrentDataSet(); oOrder.GetEmptyDataSet(); oOrder.NewRow(); dsOrder oOrder.GetCurrentDataSet(); } else // get data from db ... } }