473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Weird problems with objects deseralizing from XML

I'm a newbie to serializing/deserializing objects to XML... with this
problem being a huge nightmare.

II have object_A and object_B and write "if object_A is object_B then..."
(object_A and object_B are the same type):

- If I've created object_A and object_B through code (Dim object_A as ...)
the above statement will be evaluated as true
- If object_A and object_B have been deserialized from XML, it will be false
(even though both object_A and object_B are the same type)

Why would this problem be occurring? Even though in both cases both objects
are the same type, it seems there is some problem with from where the object
was created.

I can post my code if this isn't clear :)
Nov 20 '05 #1
3 838
"Nathan" <na****@email.com.nospam> wrote...
Why would this problem be occurring? Even though in both cases both objects are the same type, it seems there is some problem with from where the object was created.


The Is operator is used to test if two references are to the same object.
It doesn't test if the objects are of the same type.

Tom

Nov 20 '05 #2
Ahh... hence my problem.

The reason I was using 'is' was to find an object within a collection.
Instead, how would I accomplish this (to retrieve the desired object from
within a collection)?

Thanks Tom for that pointer...

"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
"Nathan" <na****@email.com.nospam> wrote...
Why would this problem be occurring? Even though in both cases both

objects
are the same type, it seems there is some problem with from where the

object
was created.


The Is operator is used to test if two references are to the same object.
It doesn't test if the objects are of the same type.

Tom

Nov 20 '05 #3
"Nathan" <na****@email.com.nospam> wrote...
The reason I was using 'is' was to find an object within a collection.
Instead, how would I accomplish this (to retrieve the desired object from
within a collection)?


Hi again,

You are trying to find the same object or one that contains the same values?
If you are looking to find a common reference then I think you stick with Is
but then it shouldn't surprise you that the clone is a different object.

I'm not certain exactly what you searching for of course but if you are
trying to see if you placed an object with a certain value in the collection
I think you'll have to check the value of the property for each object in
the collection.

Tom

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin Doyle | last post by:
Ok, I'm building a JS-based limitless-sublevel dynamic menu and am making it cross browser as well - 3 packs of aspirin so far and counting ;) I'm having a weird rendering problem using Opera...
1
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the...
0
by: Kaneda | last post by:
Hello everyone! I have some weird(?) problems, and I am not quite sure if there are due to my errors or maybe a limitation in the .Net framework. I have a ComboBox I need to fill with the...
1
by: Tim Shih | last post by:
Hi, I am encountering a really subtle error which I have been trying to isolate for a while and I am still not able to find it. The problem boils down to this: I have a button which marshals two...
5
by: Peter Oliphant | last post by:
I'm drawing graphics using the Graphics object one can grab in a Form's Paint event. But I'm getting a weird thing happening... These graphic shapes flicker (even if unchanged). UNLESS- I created...
5
by: Jim Strathmeyer | last post by:
So I'm having some weird problems with file output. If I try to boil this problem down to a small, simple program to just show what problems I'm having, I can't get the same problematic behavior. I...
12
by: sparks | last post by:
My boss and I both have access 97 and access 2003 installed on our systems. Lately he has been having a lot of problems. Databases that won't close. The database looks like it closes but access...
14
by: WStoreyII | last post by:
the following code is supposed to read a whole line upto a new line char from a file. however it does not work. it is producing weird results. please help. I had error checking in there for...
20
by: ongaro.admin | last post by:
Hi, I'm experiencing a strange problem with .mdb files. We have two buildings connected by optical fiber (a single LAN). Everything works perfect with any file, any size, any application...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.