Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Zip the typed Dataset returned from webservice

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19405 |

    Hi Guys,

    I am returning a huge Typed dataset (1MB) from web service to my Pocket PC Application Now I wanted to zip/compress the Dataset in web service and return the compressed dataset to my PPC (Pocket PC) Application and uncompress the dataset in PPC application, I tried looking at the documentation couldn’t find any sample. Is it possible with exceed? If so can I see the sample as well.

    Regards

    Salim

    Imported from legacy forums. Posted by sgbelim (had 2233 views)

    User (Old forums)
    Member
    Post count: 23064

    You could try this (untested code):
    <code>
    // CompressDataSet: compresses a DataSet and returns a byte[] with the compressed data
    public byte[] CompressDataSet(System.Data.DataSet ds)
    {
    System.IO.MemoryStream memStream = new System.IO.MemoryStream();
    ds.WriteXml(memStream);
    byte[] data = memStream.GetBuffer();
    return Xceed.Compression.QuickCompression.Compress(data);
    }

    // DecompressDataSet: decompresses a byte[] back to a DataSet
    public void DecompressDataSet(System.Data.DataSet ds, byte[] data)
    {
    data = Xceed.Compression.QuickCompression.Decompress(data);
    System.IO.MemoryStream memStream = new System.IO.MemoryStream(data);
    ds.ReadXml(memStream);
    }
    </code>

    Imported from legacy forums. Posted by Tommy (had 3120 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.