• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 505
  • Last Modified:

show image in asp.net vs 2010.. gridview vb.net

hi i want to use a gridview(asp.net) and show the pictures in the gridview

im showing the data of table (Sql 2005) manufactures which has (col names:Name, deleted, PicturedID:(Int),etc)

and images are stored in picture table  column consists of (PictureID,PictureBinar-varbinary(max))
Manufacture(Pictureid and Picture table(Pictureid) is both key which can be joined..

So i need to show the data in the gridview with Picture(Image contrl), fetching from the manfuture table

appreciated.. if any code is there.. should have good peformance..
  • 2
1 Solution
Alfredo Luis Torres SerranoDevelopment Director / DBACommented:
bsarahimAuthor Commented:
the image are stored in the database.. not the file url method
Alfredo Luis Torres SerranoDevelopment Director / DBACommented:

Dim arrayImage() As Byte = CType(YourPictureField, Byte())
Dim ms As New MemoryStream(arrayImage)
With Containerofpicture ' Example Me.PictureBox1
      .Image = Image.FromStream(ms)
      .SizeMode = PictureBoxSizeMode.CenterImage
End With

Hope this help
One option is to add a page to your site which takes a pictureID in query string and returns the picture. Then you can use that URL in the src of your image columns.



Using HTTPHanlder approach

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now