A
ad
I want to uplad a dataset to server by WebService,
But the dataset is to huge (50 fields in 50000 rows)
I want to compress it before upload,
Now my steps are
In Client
1. DataSet1.WriteXml("c:\my.xml")
2. Zip c:\my.xml to my.zip
3. Delete my.xml
4. Reade my.zip into FileSteam
5. Write the FileStream to Byte[]
6.Upload Byte[] by WebService
In Server
7. Save the Byte[] to disk files (my.zip)
8. unzip my.zip to my.xml
9. delete my.zip
10. Reade my.xml to a DataSet
11 Bulk copy Dataset to DataBase Server.
It is to tedious.
I want to change to
In Clinet
1. DataSet1.WriteXml(Stream myStream)
2. zip myStream.
3. Write myStream to Byte[]
4. Upload Byte[] by WebService
In Server
5 Write Byte[] to Stream
6. unzip Stream
7. read the stream into a DataSet
8 Bulk copy to Database Server.
But the problem is :
How to zip/unzip Stream?
or How to zip/unzip Byte[]?
How can I do that?
But the dataset is to huge (50 fields in 50000 rows)
I want to compress it before upload,
Now my steps are
In Client
1. DataSet1.WriteXml("c:\my.xml")
2. Zip c:\my.xml to my.zip
3. Delete my.xml
4. Reade my.zip into FileSteam
5. Write the FileStream to Byte[]
6.Upload Byte[] by WebService
In Server
7. Save the Byte[] to disk files (my.zip)
8. unzip my.zip to my.xml
9. delete my.zip
10. Reade my.xml to a DataSet
11 Bulk copy Dataset to DataBase Server.
It is to tedious.
I want to change to
In Clinet
1. DataSet1.WriteXml(Stream myStream)
2. zip myStream.
3. Write myStream to Byte[]
4. Upload Byte[] by WebService
In Server
5 Write Byte[] to Stream
6. unzip Stream
7. read the stream into a DataSet
8 Bulk copy to Database Server.
But the problem is :
How to zip/unzip Stream?
or How to zip/unzip Byte[]?
How can I do that?