473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

retrieve and display picture from a sql server

4
Hi Guys!

I need help to retrieve a picture stored in a sql server DB.
In the upload process I have converted an image to Binary Data, but I have problems converting it back to a .jpg image... and display it in a form as a picture.

I'm working with asp.net c# visual studio 2010

Please help me!
Thanks!
Apr 1 '12 #1
3 2845
PsychoCoder
465 Expert Mod 256MB
Show us the code you're using to retrieve your image and display it and someone will help you find a solution to your problem.
Apr 1 '12 #2
dgaIL
4
thanks man!, but I will just save the picture as a picture inside a folder, according to what you had recommended in this other thread.
Thanks :)
Apr 11 '12 #3
Frinavale
9,735 Expert Mod 8TB
It's really not that hard to retrieve it from a database.

You would need a column in a table that is a blob/image/something-that-can-hold-bytes (depending on the database that you're using). In your case the column would be an Image type since you're using Microsoft's Sql Server

When you save the image into the database, you would read the bytes in the image into memory (a byte array) and then save that into the column in your database.

When you retrieve the image, you will have to grab the byte array from the column and convert it into the image type of your choice. The image type that you create really all depends on the type of application you're developing...in the case of a web application, you would just write it to the response.output stream and change the headers to indicate to the browser that you are sending an image (as apposed to HTML that is usually sent).

-Frinny
Apr 11 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bill Agee | last post by:
In my VBA code, I have the following: Dim TimeIn as Date TimeIn = Now() ' I would like to retrieve time from the Server clock rather than the local PC clock. ' Any suggestions as to...
3
by: Gopal Krish | last post by:
I need to display uniqueidentifier (GUID) from a table in SQL Server into a ASP.NET Web Page (Combo box). I'm using C#. When I tried to display GUIDs in a combo box I get "System.Byte" for all...
1
by: Brian Henry | last post by:
Here is a simple problem, havent worked much with HTTP streams so haven't done this yet... I want to access a picture located at http://www.somesite.com/images/imagename.jpg then save it to a local...
1
by: GpOscar | last post by:
Hey whats up.. i have created a form which does calculations i have installed it on the server and run on it all the other workstations. Now on this form there are some rates that change...
0
by: Bauhaus | last post by:
I have a table with an OLE field that contains a picture. Unfortunately, when I make a form, the picture isnt visible on it, I only see a description and must double click the pic to open it (an...
1
by: software student | last post by:
i need to select a picture from sql server, picture is stored as path and have to display it in the picture box. now i dont understand how to covert it to picture box type
46
by: OldBirdman | last post by:
What a mess this question is. I have spent 2 weeks trying to make it concise and clear, and I can't. I do not have the vocabulary for the question. I cannot even TITLE it correctly. Here is my...
4
kirubagari
by: kirubagari | last post by:
Can anyone help me on how display image...i already upload but cannot view or display the image....please help on it
0
Sl1ver
by: Sl1ver | last post by:
Hi there in my settings section i created a place for company details, Uploading a picture means it will load a picture and save the string of where it can be found to the db(access). Now on my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.