Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding New Entity in Oracle database
Message
De
27/01/2009 23:16:36
 
 
À
27/01/2009 20:01:55
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
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:
01377589
Vues:
17
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);

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform