huge dataset over the internet

  • Thread starter Thread starter Darie Florin
  • Start date Start date
D

Darie Florin

I have a web method that return a huge dataset (2Mb). I am interested to
know if there is a method to maximize the transfer speed of this dateset
over the internet.
 
Darie Florin said:
I have a web method that return a huge dataset (2Mb). I am interested to
know if there is a method to maximize the transfer speed of this dateset
over the internet.

Wait for the next release :) DataSets can be converted to binary for task such
as yours.

Mythran
 
Darie,

There are a couple of workarounds.

In a simple remoting scenario, you could use a different (custom) formatter
to format the dataset as binary (true binary) over the HTTP channel. Note
that even using the binaryformatter in .NET 1.1 will still serialize the
dataset as XML. It is fairly easy to write the formatter yourself, or you
can download an out of the box version from
http://www.freewebs.com/compactFormatter/downloads.html. You might not like
this approach since this will start formatting everything whereas you might
want to apply this trick to only a specific webmethod.

Therefore there is another solution, and that is Knowledgebase article
#829740 that can be accessed at
http://support.microsoft.com/default.aspx?scid=kb;en-us;829740 . In the
adjoining code download at that site, you will see that there is an
alternative approach to using Dataset, called "DataSetSurrogate". You can
then use BinaryFormatter on that to "true" binaryformat your dataset, and
you would have to replace your calls with simple dataset to New
DataSetSurrogate(Ds) and DataSetSurrogate.ConvertToDataset() on either side.
In practical experience, I found that datasetsurrogate is less forgiving if
you forget to call BeginInits etc. or your strongly typed datasets (if that
is what you are sending across the wire), donot have the right default
values (for example - it compares 0.0 with 0.0F and fails). ... but for the
most part it works.

Thirdly, it is not too difficult to create your own serialization routine
for the dataset - similar to the customformatter upstairs. Albeit thats a
little more work than approach #1 and #2.

Hope this helped :)

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/
 
Another kink I'd like to mention is that when you start sending datasets as
true binary, the timezone handling becomes different than sending them xml
serialized.

If you are sending strongly typed datasets, one of which columntypes is
datetime, you might want to verify it's behavior across timezones.

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/
 
Back
Top