• I think the important concept here is that you want to view it, that means it is in the front end. It relatively trivial to do this in .NET or any number of other programming languages. The basic gist is that when you select the binary column you are returned a byte array. Then you just need to assemble that byte array into something usable by your presentation layer.

    Here is an example of this in C# from some of our web code. In this particular case it is only dealing with images and I have a column that stores the ContentType. In my case I don't bother with the original file name because these are streamed directly to the response and never intended to be saved. You could some sort of method for determining which type of image you may have. If you have the filename stored that would be a good place to start.

    DataTable dt = Some method to fill your datatable here

    if (dt.Rows.Count > 0)

    {

    if (dt.Rows[0]["Image"] != DBNull.Value)

    {

    Bitmap bmp = new Bitmap(new MemoryStream((byte[])(dt.Rows[0]["Image"])));

    if (bmp == null)

    {

    Response.Clear();

    Response.StatusCode = 404;

    Response.End();

    return;

    }

    Response.ContentType = dt.Rows[0]["ContentType"].ToString();

    if (dt.Rows[0]["ContentType"].ToString() == "image/gif")

    {

    bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);

    }

    else

    {

    bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);

    }

    bmp.Dispose();

    }

    }

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/