There HAS to be an easy way to get started...

  • I'm going to be writing an app in C# that stores scanned invoice images in a database along with some other information about the invoices in the record.  If there were no images involved, I'd already be halfway done, but I just don't know how to work with them yet. 

    I've been working with SQL Server at an admin and development level for about 4 years now and I am pretty proficient, but never have I had cause to learn how to store and work with images in a SQL Server database.  I know it may sound rudimentary to anyone who does it regularly, but I don't even know where to begin.  How to get images in there?  What format? How to view?  I simply don't even know what questions to ask, much less the answers.

    Does anyone know where I might find a helpful FAQ or tutorial about working with images in SQL Server that can get me started in this endeavor?


  • Try this link for an introduction to storing and retrieving images from SQL Server using C#

  • We've found that it's typically much easier to store the image as a regular file on the disk, and store it's filename in the database. _Usually_ there is not a reason to actually store the binary image data in the database itself, since it isn't something the SQL server can perform searches against, etc.


  • Actually, there is one decent argument against storing files in the file system and just storing pointers to the files in SQL...and that is that if someone or something ever messes with the file names or paths, the pointers in SQL would be useless.

  • That's my primary motivation for doing it in the database.  That, and the fact that backing up the database covers all the bases, and there's only one "space issue" to keep an eye on.  And the database is totally portable in it's entirety that way.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply