Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Get fields xml from tp_fields in database.

$
0
0

Good day.

I want to get xml data from tp_field of AllList table in database.

I've all ready read data from this column and i want to decompress it.

Here is a code

SqlBytes bytes = reader.GetSqlBytes(i);

Stream

 

stream = bytes.Stream;

 

for (int

i = 0; i < 14; i++)

stream.ReadByte();

 

System.IO.Compression.

DeflateStream deflateStream = new System.IO.Compression.DeflateStream(stream, System.IO.Compression.CompressionMode.Decompress,true

);

 

StreamReader sr = newStreamReader

(deflateStream);

 

string fields = sr.ReadToEnd();



On some lists(not all) this code not working throwing on sr.ReadToEnd() exception

System.IO.InvalidDataException: Unknown block type. Stream might be corrupted.at System.IO.Compression.Inflater.Decode() at System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length) at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.StreamReader.ReadBuffer()  at System.IO.StreamReader.ReadToEnd()



How can i fix it?

Best regards,

Chernobrivec.


Viewing all articles
Browse latest Browse all 11508


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>