I have some database data written with Unidac component (from Delphi). In MSSQL table (varbinary field) I have stored some "xml files" (using TBlobStream).
Now I want to read that data from .NET code. But it looks that data in field is somewhat compressed. If I read data from .NET as byte array, and save data to file, text is started with:
PKZ#900Z...
So question is. Is there any way to read/decode/decompress that data (stored with Unidac) from .NET?
TBlobStream data, read from .NET
Re: TBlobStream data, read from .NET
matejgolob wrote: ↑Mon 24 Dec 2018 11:13
Re: TBlobStream data, read from .NET
I have some database data written with Unidac component (from Delphi). In MSSQL table (varbinary field) I have stored some "xml files" (using TBlobStream).
Now I want to read that data from .NET code. But it looks that data in field is somewhat compressed. If I read data from .NET as byte array, and save data to file, text is started with:
PKZ#900Z...
So question is. Is there any way to read/decode/decompress that data (stored with Unidac) from .NET?
Hi matejgolob,
Have you tried to disable compression?
I tried to use the GZIP algorithm (in SQL Server 2016). Anyway, you will need to create a table for decompressed data storage.
Cheers,
Steve
Re: TBlobStream data, read from .NET
By default, UniDAC does not perform compression for saving values of the BLOB fields. UniDAC utilizes the Zlib library for data compression. Please try saving values of the BLOB field without compression with UniDAC and then read this value in .NET.
To prevent TUniQuery/TUniTable from saving values of the BLOB fields in the compressed form on the server, set the CompressBlobMode option to cbNone, for example:
Learn more about the CompressBlobMode option:
https://www.devart.com/unidac/docs/deva ... obmode.htm
To prevent TUniQuery/TUniTable from saving values of the BLOB fields in the compressed form on the server, set the CompressBlobMode option to cbNone, for example:
Code: Select all
uses
MemData;
...
UniQuery1.Options.CompressBlobMode := cbNone;
https://www.devart.com/unidac/docs/deva ... obmode.htm