Search code examples
c#databaseimagedata-storage

Store images in database as binary data


What's the best way to store an image in a database in binary format, and how can I implement it using C#?


Solution

  • You can find the answer to converting your image to binary here:

    Convert image to binary?

    You would need a BLOB column in your SQL database in order to be able to insert it.

    EDIT:

    If you want to retrieve it back from the database, you can use the following article to do so:

    http://support.microsoft.com/kb/326502