Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 18th, 2008, 03:56 AM
Authorized User
 
Join Date: Dec 2006
Location: Accra, , Ghana.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retrieve and Display Image

How do i retrieve and display an Image in a picturebox from SQL Server Database.

I tried using the code below.
I got the error "Cast from type 'Byte() to type 'String' is not valid"

code:

Try
  Connect()
  jesacon.Open()
  jesacmd = New SqlCommand("SELECT PER_SIGN FROM PER_INFO_SIGN WHERE PER_NAME = '" & CheqOwnerComboBox.SelectedItem.ToString & "'", jesacon)

jesadr = jesacmd.ExecuteReader

While jesadr.Read

    DisplaySignPictureBox.Image.FromFile(jesadr(0))

End While

Catch ex As Exception
    MsgBox(ex.Message)
End Try


I just can't understand how to get this work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
How to insert and retrieve image? hlchuah77 SQL Server 2000 3 February 13th, 2005 11:41 AM
retrieve and display selected results babywind BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 February 11th, 2005 05:23 AM
Qry to retrieve from 2 tables and display tsimsha Classic ASP Databases 3 October 29th, 2004 02:03 AM
Retrieve and display data without tbl messed up lxu Access 0 March 21st, 2004 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.