C# Object Binary Serialization

What you’re really asking for is a safe way of representing arbitrary binary data as text and then converting it back again. The fact that it stores a serialized object is irrelevant.

The answer is almost to use Base 64 (e.g. Convert.ToBase64String and Convert.FromBase64String). Do not use Encoding.UTF8.GetString or anything similar – your binary data is not encoded text data, and shouldn’t be treated as such.

However, does your database not have a data type for binary data? Check for BLOB, IMAGE and BINARY types…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)