Store images in database as binary data

8k Views Asked by At

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

2

There are 2 best solutions below

2
On BEST ANSWER

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

5
On

If you are using SQL Server, you can use the Image column type.