General information
Category:
The Mere Mortals .NET Framework
You need to issue a NewEntity() first to establish the addition of a new row, fill in the appropriate values and then issue SaveEntity().
>For the last 3 hours I could not get this to work:
>
>I have a table "MalGlavNext" with a primary key consisting in 3 fields "sifra_trgovine", "broj_kase", "vrsta_prometa"
>
>I'm calling a stored procedure MalGlavNextSelectByPK (created by BLG), when there is a record to be returned all works OK, but if there is no record for the given primary key I would like to insert that record.
>
>For that I call SaveEntity() after setting all properties. SaveEntity() returns RulePassed, but the data is not saved to the table.
>
>What am I doing wrong ?
>
>here is the code:
>
> MalGlavNextEntity ent = this.GetEntity("MalGlavNextSelectByPK",
> new IDbDataParameter[] { dao.CreateParameter("@sifra_trgovine", sifra_trgovine),
> dao.CreateParameter("@broj_kase", broj_kase),
> dao.CreateParameter("@vrsta_prometa", vrsta_prometa)});
>
> if (ent.br_racuna == null)
> {
> ent.br_racuna = "1";
> ent.sifra_trgovine = sifra_trgovine;
> ent.broj_kase = broj_kase;
> ent.vrsta_prometa = vrsta_prometa;
> mmSaveDataResult result=this.SaveEntity();
> }
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only