473,491 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Comparing Object Values

GBR
I have a WebService method that sends to the client an object array received
from the server as a collection. Each element in the object array is a class
entity object. I would like to cache each of these class entities on the
client which is a windows forms. When ready to send back, I would like to
check if any of the class entity field values have changes.

I tried to implement .Equals but does not work. Since the Web Service
stripped the methods. What is the best way I can compare if the class entity
field values have changed?
Nov 23 '05 #1
3 1546
Hello GBR,
Create a helper class that does the comparison. Anything that involves
generated classes will be lost when they are regenerated

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
I have a WebService method that sends to the client an object array
received from the server as a collection. Each element in the object
array is a class entity object. I would like to cache each of these
class entities on the client which is a windows forms. When ready to
send back, I would like to check if any of the class entity field
values have changes.

I tried to implement .Equals but does not work. Since the Web Service
stripped the methods. What is the best way I can compare if the class
entity field values have changed?


Nov 23 '05 #2
GBR
Hi Dilip,

Could you please explain what you mean by Helper Class?

For now, I have implemented an alternate solution. I wanted to write
something generic to compare the object entity values received on the client
through web services. Since none of the object enetity methods cannot be
accesses on the client, I wrote a small function that uses reflection to peep
into the object entity class and compare the values associated with the
object entity fields.

I am not sure if this is a good way of doing it but it works. I pass 2
objects into this new function and it does the rest of the comparison.

Thanks,

"Dilip Krishnan" wrote:
Hello GBR,
Create a helper class that does the comparison. Anything that involves
generated classes will be lost when they are regenerated

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
I have a WebService method that sends to the client an object array
received from the server as a collection. Each element in the object
array is a class entity object. I would like to cache each of these
class entities on the client which is a windows forms. When ready to
send back, I would like to check if any of the class entity field
values have changes.

I tried to implement .Equals but does not work. Since the Web Service
stripped the methods. What is the best way I can compare if the class
entity field values have changed?


Nov 23 '05 #3
Hello GBR,
I am not sure if this is a good way of doing it but it works. I pass 2
objects into this new function and it does the rest of the comparison.


Exactly what I meant by a Helper class.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

Nov 23 '05 #4

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

Similar topics

4
1325
by: - Steve - | last post by:
The following line of vb.net code works fine: if(strAnswer.toUpper() = strUserAnswer.toUpper()) However in an ASP.net page I'm told Object reference not set to an instance of an object ...
2
3318
by: Manny Chohan | last post by:
Hi, i have two datetime values in format 11/22/04 9:00 AM and 11/22/04 9:30 AM. How can i compare dates .net c# or if there is any other way such as Javascript. Thanks Manny
5
1791
by: George | last post by:
How do I compare the values of two objects when Option Strict is On? One of the objects is the Tag property from some control (declared as object but holding a value, e.g. an Integer or a String...
19
2616
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor =...
5
3785
by: Kermit Piper | last post by:
Hello, I am comparing two date values, one from a database and one that has been converted from a hard-coded string into an actual Date type. So far so good. The problem I'm having is that one...
20
2120
by: Bill Pursell | last post by:
This question involves code relying on mmap, and thus is not maximally portable. Undoubtedly, many will complain that my question is not topical... I have two pointers, the first of which is...
2
3361
by: Pugi! | last post by:
hi, I am using this code for checking wether a value (form input) is an integer and wether it is smaller than a given maximum and greater then a given minimum value: function...
25
12982
by: J Caesar | last post by:
In C you can compare two pointers, p<q, as long as they come from the same array or the same malloc()ated block. Otherwise you can't. What I'd like to do is write a function int comparable(void...
2
1835
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi mister, I have an object with two properties, of type DateTime? (Nullable). Which is the best way for comparing ? The value of datetime can be null, and another value cannot be null, or two...
0
7118
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
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...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.