Re: To serialize or not to serialize?



I assume that your "teacher" is placing this arbitrary restriction that
you
cannot return a DataSet.

Unfortunatly, that is true! His reason is: "we must think in low rate
networks. A dataset is way to large!... Blah, blah, blah..."

Create a class that mirrors the datatable(s) return, with fields that
mirror
the columns in the dataset.

I was thinking about that... but an array with, let's say, hundreds of this
class elements is too large also, or am I wrong? Maybe iste smaller than a
XML Dataset, but can it resolve my problem? I was thinking in paging this
array, sending smaller portions of data in several times... but I don't
figure how to do it....

Thanks to you all!

Paez

"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxx> wrote in message
news:6DCE1E50-7523-41B5-8CE0-46ADAF17FCFA@xxxxxxxxxxxxxxxx
--That is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous Xml,
Or to take arms against the BinaryFormatter,
And by opposing end them?


I assume that your "teacher" is placing this arbitrary restriction that
you
cannot return a DataSet.

Create a class that mirrors the datatable(s) return, with fields that
mirror
the columns in the dataset.

Iterate over your datatable, creating an instance of this class and
populating the fields from the column values of each row in your
DataTable.
Then, return the array of these "row" class objects as the return value of
the WebMethod.

Peter


--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Paez" wrote:

Hello there.

My teacher asked me to do a job and I don't know how..

This is the scenario:

I must create a client/server application. The server application is a c#
web server and the client is a c# windows aplication. The web service
will
connect with a access database.

So, when the client asks for some data, the web service queries the
database
and sends the data to the cliente. This is where my problem begins. How
can
I send the data????

Initially, I was sending the client the dataset, but I am not allowed to
do
it. So, how can I send the data?

Shall I create a class "DataToSend" similary to the data that I want to
send
and then create an "DataToSend" array and finally send that array?
Shall I serialize that class?
Shall I think in another way?

Which is the best practice?

Thanks in advance.

Paez





.



Relevant Pages

  • Re: How to display in-memory image?
    ... Instead of using the web service to transfer the byte array back to the ... client, it generates a URL with a uniqueue key and feed that back to the ... > Hello Olav, ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: To serialize or not to serialize?
    ... SOAP serializers from other platforms don't speak "DataSet". ... So, when the client asks for some data, the web service queries the database ... and then create an "DataToSend" array and finally send that array? ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: To serialize or not to serialize?
    ... So, when the client asks for some data, the web service queries the database ... Shall I create a class "DataToSend" similary to the data that I want to send ... and then create an "DataToSend" array and finally send that array? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Simple Question (regarding runtime)
    ... Koshy, ... elements of the array. ... between the webservice and your ASP>Net server (client). ... > web service returns me an Array of elements with each array element as ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Text terminal rendering design
    ... it is a fundamental element of the UI design. ... The management of that array's content by the client is quite a ... The array and the terminal are more tightly tied ... to do that because of the need to map into flavors of terminals. ...
    (comp.object)