Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New to .NET
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01126997
Message ID:
01127248
Views:
30
Kevin,

I set the following properties:

On ABusinessObject:
this.RetrieveAutoIncrementPK = true;
this.DatabaseKey = "Address Book";

On the Address businessobject:
public Address()
		{
			this.TableName = "Address";
			this.PrimaryKey = "iAddress_id";
            this.ForeignParentKeyField = "iNames_id";
            this.AutoCancelOnParentCancel = true;
            this.AutoDeleteOnParentDeleted = true;
            this.AutoSaveOnParentSaved = true;
            this.AutoNewOnParentAdded = true;
And on the form:
       public AddressForm()
        {
            oNames = (Names)this.RegisterPrimaryBizObj(new Names());
            oAddress = (Address)this.RegisterBizObj(new Address());
            this.oNames.RegisterChildBizObj(this.oAddress);
I've spent a lot of time tracing the save (best way to learn) and this is the message that's returned:

Displays the Error Provider broken rule dialog
		/// </summary>
		protected virtual void DisplayErrorProviderBrokenRuleDialog()
		{
			mmAppDesktop.MessageBox.Show("Unable to save the current data. See the error icons for details.",
				"Data Entry Error",
				MessageBoxButtons.OK,
				MessageBoxIcon.Information,
				this.CurrentLanguage);
		}
The database is simple. The key fields are identity columns, and the address table has a foreign key from Names- iNames_id. This should work without problems, but I know I'm missing something. I just don't know what.

Jim

>Make sure you set the appropriate properties on the child business object:
>
>AutoDeleteOnParentDeleted
>AutoNewOnParentAdded
>AutoSaveOnParentSaved
>
>Check out the MM .NET Dev Guide topic "Establishing Business Object Relationships" for details.
>
>Best Regards,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform