Now this is weird...

Posts   
 
    
Jeff M
User
Posts: 250
Joined: 04-Aug-2004
# Posted on: 20-Mar-2006 20:24:07   

This problem is really baffling me. Using VS.Net 2005 and adapter. Latest version.

  1. I created a simple bool property on the entity called "Applied".
#region Customized Code     
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
        private bool applied ; // InitClassEmpty sets value to TRUE
        /// <summary>
        /// Placeholder for pick list flag.  Not persisted.  Used for iterative update of collection.
        /// </summary>
        public bool Applied
        {
            get { return applied; }
            set { applied = value; }
        }
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
  1. On the client I set the value of the Applied property for several entities in a collection.
entity1.Applied = true;  entity2.Applied = false;
  1. I test the collection on the client to make sure that the values are property set.
 On the client...
            foreach(TestEntity entity in testEntityCollection)
            {
                if(entity.Applied)
                {
                    Console.WriteLine(entity.Description + " is applied");
                }
                else
                {
                    Console.WriteLine(entity.Description + " is NOT applied");
                }
            }
Results: "entity1 is applied" and "entity2 is NOT applied" // this is CORRECT
  1. I remote the collection to another process.
RemoteDataManager.TestAppliedValues(testEntityCollection);
  1. I test the values of each entity on the server process.

[code]

 On the server
            foreach(TestEntity entity in testEntityCollection)
            {
                if(entity.Applied)
                {
                    Console.WriteLine(entity.Description + " is applied");
                }
                else
                {
                    Console.WriteLine(entity.Description + " is NOT applied");
                }
            }
Results: "entity1 is applied" and "entity2 is applied" // DOESN'T MATCH CLIENT!!!
  1. Values don't match!!

It really is just as simple as that! Isn't that odd?

Help, please?

Thanks!

Jeff

mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 20-Mar-2006 20:37:01   

I think you need to copy the 'Applied' member over in the GetObjectData and deserialization constructor. so, something like:


info.AddValue("applied", applied)

in GetObjectData.


applied = info.GetString("applied")

in the deserialization constructor.

Jeff M
User
Posts: 250
Joined: 04-Aug-2004
# Posted on: 20-Mar-2006 21:02:57   

Serialization! Oh course!

Thanks!!

Jeff