473,387 Members | 1,517 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,387 software developers and data experts.

Display Image From Database Table

I am trying to build an ASP.NET application which includes the capability to
allow users to save pictures to a SQL Server 2000 database table and then
later to display selected photos (usually JPG files). I found some sample
code via a google search which showed how to upload a jpg file using ASP
(HtmlInputFile) and save it in an Access database and I've tried to adapt
that to work with ASP.NET/SQL Server and I am able to get the file data into
my SQL table (Hope it is valid?) My table structure is as follows:
============ Table Structure ====================
CREATE TABLE [UnitPhotos] (
[UnitID] [int] NOT NULL ,
[Filename] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FileSize] [int] NULL ,
[ContentType] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FileData] [image] NULL ,
CONSTRAINT [PK_UnitPhotos] PRIMARY KEY CLUSTERED
(
[UnitID]
) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
================================================== =

The original Access version had a type of "OLE Object" for the "FileData"
field - I guessed that "image" was appropriate in SQL Server?

I have been able to upload an image file and save a row of data but now I am
looking for pointers to information on how to retrieve an image from that
table and display it. A sample of the data for the saved row is as follows:

UnitID - 235
FileName - myImage1.jpg
Filesize - 15671
ContentType - image/pjpeg
FileData - <Binary>

Any suggestions or pointer greatly appreciated.

Wayne
Nov 18 '05 #1
2 2369
Raghavendra;

Thank you very much. Those were very helpful.

Wayne
"raagz" <ra*****@yahoo.com> wrote in message
news:e1**************************@posting.google.c om...
Hi Wayne,

Check this links

http://www.akadia.com/services/dotnet_load_blob.html

http://www.dotnetbips.com/displayarticle.aspx?id=60

http://www.dotnetbips.com/displayarticle.aspx?id=101

Hope this helps you.

Thanks
Raghavendra
http://raagzcd.blogspot.com

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: adam | last post by:
Hi, I have an issue that i just cant seem to figure out hope some one can help. right i am getting people to input the own images directly into a blob within a mysql database. then on the next...
3
by: Ken | last post by:
I have a database called autographs.mdb that is in the "XYZ" folder in the "database" folder. I have a form in the database that I want to display a photo of the celeb on. The photos are in a...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
3
by: Neo Geshel | last post by:
Greetings. I am making an admin interface, which allows me to upload photos to an access DB. The admin interface also needs to display the uploaded photos, but only needs to show them at a...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
1
by: Objectifnet | last post by:
What I really want to do is to be able to link two pages together using an ID, The table involved displays an image stored on the File Server that has the image details stored in the Database called....
5
by: mukeshrasm | last post by:
Hi I am facing problem while displaying the images dynamically on the webpage from database. Actually I am saving the path of the Image in database and it is displaying it from there .but it is...
1
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for...
1
by: swethak | last post by:
Hi, I write the code to display images.But it will not display image.And also gives the error like that error : Notice: Undefined index: gim in F:\Facebook\pic_up.php on line 59 plz tell...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.