recieving an array to the client

G

Guest

Hello!

I've got a little problem here. I'm sending an array with customers to the
client who takes care of the array prints it out on the screen. The problem
is that only the last element is being printed out and not the whole array.

the return statement from the proxy looks like this:

return (Person[])ar.ToArray(typeof(Person));

ar is an ArrayList that is filled with customers.

the client side looks like this:

Person[] ar= cl.getData();
// the return statement is landing in ar.

foreach(Person pers in ar)
{
mLstLista.Items.Add(pers.Fnamn);
}

regards Johan
 
R

Richard Blewett [DevelopMentor]

Is this remoting or web services?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hello!

I've got a little problem here. I'm sending an array with customers to the
client who takes care of the array prints it out on the screen. The problem
is that only the last element is being printed out and not the whole array.

the return statement from the proxy looks like this:

return (Person[])ar.ToArray(typeof(Person));

ar is an ArrayList that is filled with customers.

the client side looks like this:

Person[] ar= cl.getData();
// the return statement is landing in ar.

foreach(Person pers in ar)
{
mLstLista.Items.Add(pers.Fnamn);
}

regards Johan
 
G

Guest

forget my question.... I had the problem just in front of me and it was a
silly thing. duh.. It was in a loop. I forgot to instanciate a new object
each loop so it only took the last element.

Johan said:
We're using remoting.

Richard Blewett said:
Is this remoting or web services?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hello!

I've got a little problem here. I'm sending an array with customers to the
client who takes care of the array prints it out on the screen. The problem
is that only the last element is being printed out and not the whole array.

the return statement from the proxy looks like this:

return (Person[])ar.ToArray(typeof(Person));

ar is an ArrayList that is filled with customers.

the client side looks like this:

Person[] ar= cl.getData();
// the return statement is landing in ar.

foreach(Person pers in ar)
{
mLstLista.Items.Add(pers.Fnamn);
}

regards Johan
 

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

Top