10 Years
Discussion Span
Last Post by JerryShaw

If you use Microsoft SQL Server 2008 there is FileStream datatype.
If you use Microsoft SQL Server 2000/2005 the optimal solution is to save file path rather file itself.


You can save any size file, or image or anything else that you want into an SQL database.
This capability has been around even back when SQL was SyBase.
The Text field is a BLOB field. Use a byte[] array, and stream the file into the field through a memorystream or filestream. When you want to get it back our, again, use a byte array to stream it out. Check out how to store and retireve images, and you use the same method for files.

There are lots of document companies that store zip files, PDF, and Word Doc files (and other types) directly into SQL databases. Storing to the hard drive is not a good option because it opens a security hole if the customer has to have a network share to retireve the file.


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.