Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Display Image from Database in Image Control

Reply
Thread Tools

Display Image from Database in Image Control

 
 
chrispragash@hotmail.com
Guest
Posts: n/a
 
      08-25-2005
Hello Everybody,

I have a server control that stores an image in the database as an
image datatype. I would like to display this image (may be in an image
control) along with other text in a page. What is the best way to
achieve this functionality. Thanks for all the help in advance.
Regards, Chris

 
Reply With Quote
 
 
 
 
Metalore Metalore is offline
Junior Member
Join Date: Oct 2006
Posts: 2
 
      10-18-2006
Hi All,

I also have the same problem, can anyone give some advice please??

I have an image datafield in my database and am able to take this picture and display it on a page. Using Response.WriteBinary to do this.

However, I also have text which should be going to the page but all I get is the image. When i comment out the response.writebinary line I get the text!!

Below is my code...


Dim adapt As New SqlDataAdapter(cmd)
Dim table As New Data.DataTable

adapt.Fill(table)

Dim row As Data.DataRow
For Each row In table.Rows

Dim ID As String = (row("ID"))
lblID.Text = ID
Dim Name As String = (row("Name"))
lblName.Text = empName

'this above code works and does output the text to the screen as I would expect, the problem is below when I try output the image.....

Response.BinaryWrite(row("Photo"))

Next

'When I include the above line, the image is the only thing being written to the screen, dont know what happened to the ID and Name, anyone any ideas?

I would appreciate any thoughts or advice on this.

Kind Regards,

Tony
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Display Image from Database in an Image control chrispragash@hotmail.com ASP .Net Web Services 1 08-25-2005 07:38 PM
choosing to display or not to display a checkbox in repeater control. Imran Aziz ASP .Net 4 08-11-2005 05:00 PM
HOWTO: display database without refresh web page to query database =?Utf-8?B?U1M=?= ASP .Net 3 05-15-2005 08:22 PM



Advertisments