recieving an array to the client

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top