RE: To serialize or not to serialize?



I agree, but I have already seen this before - where the professor,
instructor, etc. insists that your Webservice cannot return a Dataset because
SOAP serializers from other platforms don't speak "DataSet". Which of
course, is ludicrous, since a Dataset via SOAP is nothing but legitimate XML
following a perfectly fine schema - which schema is freely available.
But you have your purists.
Cheers,
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Peter Bromberg [C# MVP]" wrote:

--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?
    ... array, sending smaller portions of data in several times... ... So, when the client asks for some data, the web service queries the ...
    (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)