Re: To serialize or not to serialize?
- From: "Paez" <marco.pais@[IGNORE]gmail.com>
- Date: Wed, 6 Dec 2006 00:28:07 -0000
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
.
- References:
- To serialize or not to serialize?
- From: Paez
- RE: To serialize or not to serialize?
- From: Peter Bromberg [C# MVP]
- To serialize or not to serialize?
- Prev by Date: Re: advantage of boxing and unboxing
- Next by Date: Re: how to re-draw controls on a Form at a regular interval?
- Previous by thread: Re: To serialize or not to serialize?
- Next by thread: RE: To serialize or not to serialize?
- Index(es):
Relevant Pages
|