Well I am using PostgreSQL as backend... and here is the code I am using... let me also save it to a file and check it instead of table...
vb.net Code:
Friend Function CompressBytes(ByVal text As String) As Byte()
Try
Using store As New IO.MemoryStream
Using compressor As New System.IO.Compression.GZipStream(store, IO.Compression.CompressionMode.Compress)
Using writer As New IO.StreamWriter(compressor)
store.Position = 0
writer.Write(text)
Return store.GetBuffer()
End Using
End Using
End Using
Catch ex As Exception
DE(ex)
End Try
End Function
Friend Function DecompressBytes(ByVal bytes() As Byte) As String
Try
Using store As New IO.MemoryStream(bytes)
Using decompressor As New IO.Compression.GZipStream(store, IO.Compression.CompressionMode.Decompress)
store.Position = 0
Using reader As New IO.StreamReader(decompressor)
Return reader.ReadToEnd
End Using
End Using
End Using
Catch ex As Exception
DE(ex)
End Try
End Function