How to store documents and files on remote SQL server 2005

Posted on 2008-11-18
Last Modified: 2013-11-26
Hello all
I have been trawling the web looking for articles and tutorials on "How to store documents and files on remote SQL server 2005" but have found nothing of any relevance so i have decided to post my question to you the experts. I have an intermediate to advanced knowledge of sql and 2005/2008. I want to be able to store all types of files on the sql server through the program i have made. all the connections are setup and working and I am currently storing images and text remotely into the server through my program but i dont know how to store actual documents into the database like .mp3 , .doc , .pdf etc. i have an ingcling that i have to convert the documents to binary then store the binary in the database then when i want to read it i then rebuild the binary back into a document. But i don't have a clue how to do this  can you please help.
Question by:jjwarr
    LVL 53

    Expert Comment

    Storing Binary Files Directly in the Database Using ASP.NET 2.0

    Store and retrieve objects as BLOBs in SQL Server 2000 and 2005 using ASP.NET 2.0

    Storing and Retrieving Image (or documents)  in SQL Server

    Storing Binary Data to Database using ASP.NET 2.0

    Store audio in Sql Server 2005 and retrieve it and play it in windows application .net
    LVL 1

    Author Comment

    thanks for quick response and i have read all these before and they are all related and i mainly want to to store documents and exe files
    LVL 53

    Accepted Solution

    The easiest solution will be to save them into a directory on your filesystem, and just store the filepath and filename into the database

    How To Read and Write BLOB Data by Using ADO.NET with Visual Basic .NET
    (I wouldn't recommend using BLOB's. They're slow and very fidely to code for. If you ever need to store files, I'd alwyas recommend the filesystem. Much more easier to manage. Just store the filename in the database.)

    Although the article above refers to image files, the concept for storing doc files is the same.
    Doc files will be saved into the database as blob data in the same way as image files are.
    The important point to understand in the article above is the way in which the FileStream object is used to save and retrieve and the files.  

    LVL 53

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Good resource for accessibility implementation 1 28
    Aspnet xml 2 27 Excel Add-in TaskPane not opening 3 34
    GridDataView 6 13
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now