Displaying an image from a SQL Database without creating a file on the hard drive.

Posted on 2005-04-09
Last Modified: 2010-04-23
I'd like to load an image from a SQL database without creating a file on the hard drive. It there a way to do this?
Question by:mdbarker813
    LVL 48

    Expert Comment

    Use MemoryStream class instead of FileStream. Load image from database to MemoryStream. Create Bitmap from MemoryStream using Bitmap(Stream) constructor and display it.

    Author Comment

    Do you have any sample code?Or do you know where I may find some?
    LVL 48

    Expert Comment

    This is C# sample:

    See code fragment: "Display the image". I will try to find VB .NET sample which does the same.
    LVL 48

    Accepted Solution


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now