Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New to .NET
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01126997
Message ID:
01127248
Vues:
24
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,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform