Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 27th, 2005, 2:04 AM   #1
raikkonen
Newbie
 
Join Date: Jun 2005
Posts: 29
Rep Power: 0 raikkonen is on a distinguished road
Displaying images from database

How do i display images from my database using asp? The rest of my records are able to be displayed,but the images are not coming out.
what should the datatype for my image field be? At present i have set it at varchar,and entered the value for my image field as "images/cake.jpg"
is there anything wrong with this? i just need to extract out and display my images the same way i display others,without having to pass through the ID or something. is that possible? i've seen some websites and they used Response.binarywrite.
raikkonen is offline   Reply With Quote
Old Jan 30th, 2006, 9:19 AM   #2
java_roshan
Professional Programmer
 
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4 java_roshan is on a distinguished road
What u need to do is possibly change the datatype to a binary one and use some code (probably from the internet) to read the image as a binary format and use Response.binarywrite to write it to your database.

Similarly, while retrieve u may use Request.binaryread and some other code to display the image as it should be!
__________________
Visit: http://www.somaiya.edu
java_roshan is offline   Reply With Quote
Old Apr 14th, 2006, 1:03 PM   #3
mycplus
Newbie
 
Join Date: Sep 2004
Posts: 10
Rep Power: 0 mycplus is on a distinguished road
There are two ways to show an image from the data base.
Quote:
At present i have set it at varchar,and entered the value for my image field as "images/cake.jpg"
then you have to upload the image to the images folder. and you will show it like
<img src="<%=objRs("ImageFieldName")%>">

The other way is the binary write. For that you have to use field type like blob, image depending on the database you are using. I think its a bit slower task so you better use the first type.

Thanks
__________________
Muhammad Saqib
MYCPLUS Online Community Website
Programming resources for C/C++, Visual C++ and C# .Net Programmers - MYCPLUS
mycplus is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:36 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC