![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jun 2005
Posts: 29
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Sep 2004
Posts: 10
Rep Power: 0
![]() |
There are two ways to show an image from the data base.
Quote:
<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 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|