Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New to .NET
Message
From
10/06/2006 16:10:47
 
 
To
08/06/2006 13:26:33
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
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:
01128297
Views:
18
Jason/Kevin,

After setting the right breakpoints I pinpointed where things are going wrong. The child bizobj is not having its foreign key populated, despite having set the ForeignParentKeyField property. It was my understanding that setting this field to the correct value would automatically get the parent id and populate the dataview field with the correct value. Am I missing something?

>Jim,
>
>In line with what Kevin suggested, when SaveDataSet is called in Names, does it get to the point where it tries to call Address.SaveDataSet()? If so, does it get past the rules check? And what is the mmSaveDataResult returned from the Address save attempt?
>
>---J
>
>>That's the part that really has me stumped: there are no error icons. I tried creating a new form with the same controls, and now the data is read only. I can't edit any of the data! I'm almost ready to scrap the whole project and start over from scratch.
>>
>>>Jim,
>>>
>>>What error messages are displayed at the icons? Sounds like it's getting broken rules somewhere and the save is aborted. Keep in mind that rules are checked before the save happens.
>>>
>>>---J
>>>
>>>
>>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform