First record not saved using Self Service general classes

Posts   
 
    
Posts: 11
Joined: 30-Nov-2010
# Posted on: 14-Dec-2010 06:26:14   

Hi Dear Friend(s)

i have generated self servicing orm classes using llblgenpro. everything works fine if there is a minimum single record exists in the sqlserver database table but if there is no record in the table, new inserted record does not get saved in the table.

(if the table is not empty insert,edit,update,delete everything works fine)

same login (binding source control with dataset) working fine and it also insert the first record without any problem, that means the problem is with llblgen pro generated classes, may be some initialization problem when table is empty

what could be the cause of this problem ?

CertificateMasterCollection certTracker = new CertificateMasterCollection();

page load event code

        CertMastColl1.GetMulti(null);
        CertMastColl1.RemovedEntitiesTracker = certTracker;
        CertMastBS.RaiseListChangedEvents = false; //(binding source which is binded with           
                                                                                   CertMastColl1)

end

save command code

        this.Validate();
        this.CertMastBS.EndEdit();
        certTracker.DeleteMulti();
        CertMastColl1.SaveMulti(true);

end

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Dec-2010 09:41:33   

Please place a breakPoint at CertMastColl1.SaveMulti(); and check the collection. Does it have entities? Are they dirty (IsDirty == true)? Do they have changed fields (entity.Fields["AnyField"].IsChanged == true)?

Posts: 11
Joined: 30-Nov-2010
# Posted on: 14-Dec-2010 10:09:22   

dirtyentry count shows me 0

but i m adding a new record using bindingnavigation control and this problem occurs when there is 0 records in the table

if i insert manually a record to sql table and then i add new record using the app it works fine

what could be the reason ?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Dec-2010 10:20:30   

I don't know. But I'm sure it's not an LLBLGen issue. Could you please attach a small repro project that only has one entity mapped, and attach the DDL SQL script of that entity.

Posts: 11
Joined: 30-Nov-2010
# Posted on: 14-Dec-2010 12:23:11   

the cause of the problem was...

CertMastBS.RaiseListChangedEvents = false;

why ?, i dont know

ok leave it

can u tell me how could i check the deleted record count before savemulti or deletemulti method ?

if yes the how ?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 14-Dec-2010 20:42:53   

You can check the .Count property of the RemovedEntitiesTracker collection.

Matt