dcsimg
Results 1 to 4 of 4

Thread: how display image from gridview to picturebox

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    1

    how display image from gridview to picturebox

    Hi guys I need your help


    Hi guys

    I'm not able to display image from tablegridview to picturebox - visual basic 2010 studio.

    I know how to reference text value from a cell on tablegridview to textbox I had been created .

    this the Code shows how to do this :



    Code:
    TextBox2.Text=Table1DataGridView.Rows(0).Cells(2).Value.ToString

    my question is how to do it with image if you have this image on Table1DataGridView


    I tried this code for image but it doesn't work I got error
    Collapse | Copy Code

    Code:
    PictureBox1.image=Table1DataGridView.Rows(0).Cells(2).Value
    also I tried this cod but it doesn't work

    Code:
    PictureBox1.image=CType(Table1DataGridView.Rows(0).Cells(2).Value, Bitmap)
    I get message " Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Bitmap'."

    I hope that some one can solve this complex problem and i will be great full for you .


    thanks
    sndeed

  2. #2
    Addicted Member
    Join Date
    Nov 2012
    Location
    Copenhagen, Denmark
    Posts
    181

    Re: how display image from gridview to picturebox

    Did you ever find a solution to this?

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    100,978

    Re: how display image from gridview to picturebox

    Follow the CodeBank link in my signature below and check out my thread on Saving Images In Databases.

  4. #4
    Addicted Member
    Join Date
    Nov 2012
    Location
    Copenhagen, Denmark
    Posts
    181

    Re: how display image from gridview to picturebox

    Found it the second after you answered. ;-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width