Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding New Entity in Oracle database
Message
De
28/01/2009 09:10:56
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
27/01/2009 23:16:36
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Database:
Oracle
Application:
Desktop
Divers
Thread ID:
01377558
Message ID:
01377686
Vues:
19
Vidya,

>Tim,
>
> I fixed the previous issue by replacing
>
>ClientMasterEntity ODEntity = clientMaster.NewEntity(); with
>
>ClientMasterEntity ODEntity = clientMaster.NewEntity(ClientMasterEntity)();
>
>but, when i try to save the entity
>mmSaveDataResult Result = clientMaster.SaveEntity(ODEntity);

Is this a Windows forms application?
Are you making these calls inside a form?
Is the ClientMasterEntity the only Entity object you created for the ClientMaster business object?

If these are all true, what is triggering the creation of a new entity? Is this from a button?

In a business form you can just call
this.NewRow();
or if you are calling this on a business object other than the primary business object you can call the overload
this.NewRow(ClientMaster);
After all the edits, etc are complete you can just call the forms save
mmSaveDataResult result = this.Save();
or for business objects other than the primary you can call the overload
mmSaveDataResult result = this.Save(ClientMaster);
Can you fill me in a bit on what you are trying to do, maybe we can simplify the process a bit. By the way, are you using an evaluation version of MM?
Tim
>
>i get an error
>
>MMEval.AAppTest.InsertNewClientMaster:
>System.NullReferenceException : Object reference not set to an instance of an object.
>
>Stack trace
>at OakLeaf.MM.Main.Business.mmBusinessRule.CheckRules[EntityType](mmBindingList`1 entityList)
>at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.CheckRules(mmBusinessObjectGeneric`1 businessObject, mmBindingList`1 entityList)
>at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.SaveEntity(EntityType entity)
>at MMEval.AAppTest.InsertNewClientMaster() in C:\vidya\dev\Other Appr\MMEval\MM Business Object Library1\AAppTest.cs:line 99
>
>
>The function used is as follows:
>
> public void InsertNewClientMaster()
> {
>
> ClientMaster clientMaster = new ClientMaster();
>
> clientMaster.TransactionBegin();
>
> ClientMasterEntity ODEntity = clientMaster.NewEntity(ClientMasterEntity)();
>
> ODEntity.CLIENT_ID = 3059;
> ODEntity.NAME = "MM Test";
> ODEntity.SHORT_NAME = "Short Name";
> ODEntity.CREATED = DateTime.Now;
>
> mmSaveDataResult Result = clientMaster.SaveEntity(ODEntity);
> if (Result == mmSaveDataResult.RulesBroken)
> {
> string BrokenRules = clientMaster.Rules.GetAllBrokenRules();
> }
>
> clientMaster.TransactionCommit();
> }
>
>Thanks & Kind Regards,
>Vidya
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform