PC Review


Reply
Thread Tools Rate Thread

Display image from DB

 
 
DavidC
Guest
Posts: n/a
 
      2nd Aug 2010
I have an asp.net page that has an image control (named ImgSignature) inside
a Panel. When the panel is visible, I want to get the image from the database
varbinary(MAX) column and insert it into the asp Image control. I have the
following code but is not working. Can someone help? Thanks.

Using conData As SqlConnection = New
SqlConnection(DBClass.GetCoreConnectionString)
intPeopleLinkID =
Convert.ToInt32(Request.QueryString("plid"))
Const SQL As String = "SELECT [MIMEType],
[SignatureImage] FROM [ClientSignatures] WHERE [ClientID] = @ClientLinkID"
Dim myCommand As New SqlCommand(SQL, conData)
myCommand.Parameters.AddWithValue("@ClientLinkID",
intPeopleLinkID)

conData.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader

If myReader.Read Then
Response.ContentType = myReader("MIMEType").ToString()
ImgSignature.ImageUrl = myReader("SignatureImage")
End If

myReader.Close()
conData.Close()

End Using
--
David
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
How to call an aspx that accepts parameters through HTTP POST and returns an image, and then display the image in my html? computer_guy Microsoft ASP .NET 3 20th Jul 2007 05:25 AM
Display image on form (image stored on web server)? deBassMan via AccessMonster.com Microsoft Access 1 4th Aug 2006 09:32 AM
Form an image from received bytes from server and display that image into the picturebox nishi.hirve@gmail.com Microsoft C# .NET 2 25th Jul 2006 07:17 AM
Display the image into picturebox without saving image files into Hard disk Dev Microsoft C# .NET 1 21st Jul 2003 10:14 PM
Display the image into picturebox without saving image files into Hard disk. Dev Microsoft Dot NET Framework Forms 0 21st Jul 2003 03:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:35 PM.