Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's missing?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Database:
MS SQL Server
Miscellaneous
Thread ID:
01162436
Message ID:
01162804
Views:
21
>>I have this code in the click event of a button:
>>
>> int seriesNo = oGSN.iGenerateSeriesNo("CEK");
>> oPsDatacenter.NewRow();
>> oAppsysUsers.NewRow();
>> oPsPersonaldata.NewRow();
>> oPsDatacenter.Entity.dcno = seriesNo;
>> oPsDatacenter.Entity.fullname = oPName.PersonFullName;
>> oPsDatacenter.Entity.fullname = oPName.PersonFullName2;
>> oPsDatacenter.Entity.customname = oPName.PersonCustomName;
>> oAppsysUsers.Entity.userdcno = seriesNo;
>> oPsPersonaldata.Entity.dcno = seriesNo;
>> Save();
>> Close();
>>
>>
>>It seems that the memory variable values didn't save to its proper column/field because the error says that dcno is not allowed to be null. The error is pointing to the Save() method of the mmForm.
>
>Again, this code should "just work". I see that two of your entity objects have a dcno property. Which object is it erroring out on? You are calling the form-level Save() method which by default saves to the primary business object. Do you have these other objects registered as children so their data is automatically saved too?

Yes they're registered as child bizobjects (oPsPersonaldata and oAppsysUsers) to oPsDatacenter.

I tried changing the property of Psdatacenter.dcno from non-identity column to identity column and it is saving now but the child objects didn't. It seems to me that if the primary key is not an identity column, there is a problem in saving.

>P.S. I see you are in the Phillipines. If you're reading this message soon after I post it send me an e-mail to let me know. I may be able to get on your computer with a GoToMeeting session (we don't need voice because we can use the chat window) and I can figure it out in just a few minutes.
>
>Best Regards,
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform