Is it possible to serialize any file with extensions like .exe,.pdf,.mp3,etc,.. into a binary format and then store it in SQL Server using ADO.NET & C#?
Posted on 2010-09-08
I am looking for the code if this is possible.. I have done this for an image. by first converting the image to a byte array like so :
public static Byte Image2Bytes(Image img)
Byte arr = new Byte;
using(MemoryStream ms = new MemoryStream())
arr = ms.ToArray();
using the above method i can convert an Image to binary but i need to convert other types to binary and these are our day-to-day commonly used files.