ORMEntityOutOfSyncException????

Posts   
 
    
Reginald
User
Posts: 24
Joined: 20-Jan-2006
# Posted on: 10-May-2006 06:20:06   

Below is only partial code but I keep getting an ORMEntityOutOfSyncException. I looked at other postings here and saw that you've said many times that you cant access a property of a newly created entity because it hasnt been set. So below I set it first to see what would happen and I still get the error message.

Database is firebird.

What am I doing wrong. I've got similar code just like this in other classes.

Is it maybe because the PropertyId field in the database has a foreign key reference to the Property Table?

Please help.


        public override void ActionSaveEntity(int EntityID)
        {
            using (DataAccessAdapter da = new DataAccessAdapter(true))
            {
                UnitEntity entUnit;     

                if (EntityID == 0)
                {
                    entUnit = new UnitEntity();
                    da.FetchEntity(entUnit);
                    
                    entUnit.PropertyId = 3;

                    // This line of code gives me the exception.
                    int intSeeIfThisWorks = entUnit.PropertyId;

Reginald
User
Posts: 24
Joined: 20-Jan-2006
# Posted on: 10-May-2006 06:35:29   

never mind. I got it to work.