Properties vs. fields

M

Morten

Hi!

I've created a web service that sends an array of custom objects to the
client. My object is defined with 2 public properties. When I receive the
XML on the client and instantiate my objects these properties are apparently
fields (I don't know the difference but this is what I've read). This means
that I can't bind the array of objects to a datagrid. Is it possible to
convert the fields into properties on the client? If so could someone please
provide an example that shows how this is done?

Help is appreciated.

Morten

My class definition looks like this:

public class SiteClass
{
private string sitename;
public string Sitename
{
get
{
return sitename;
}
set
{
sitename = value;
}
}
private StringCollection hostheaders;
public StringCollection Hostheaders
{
get
{
return hostheaders;
}
set
{
hostheaders = value;
}
}
}
 
J

John Saunders

Morten said:
Hi!

I've created a web service that sends an array of custom objects to the
client. My object is defined with 2 public properties. When I receive the
XML on the client and instantiate my objects these properties are
apparently fields (I don't know the difference but this is what I've
read). This means that I can't bind the array of objects to a datagrid. Is
it possible to convert the fields into properties on the client? If so
could someone please provide an example that shows how this is done?

When you say that the properties become fields, do you mean that the proxy
class generated from the WSDL only has fields?

If so, I don't know how to solve that, but I wish I did!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top