Image Display after saving into sql2005 as varbinary using Fileupload

image Display , Varbinary , fileupload , HttpPostedFile Johannesburg, South Africa
  • 10 years ago

    Goodday to you all fellow coders after saving a pic in a sql2005 database using this line of code in vb Iam using the fileupload control how can I then display the picture? the image column in the database is of varbinary type should I even be saving the pics in a database anyway? help needed here asap if anyone can assist I would be very gratefull , thanx in advance. this is how Iam saving into the dbase Dim filedata As Byte() = New Byte(FileUpload1.PostedFile.ContentLength - 1) {} Dim uploadedPostedFile As HttpPostedFile = FileUpload1.PostedFile() uploadedPostedFile.InputStream.Read(filedata, 0, CInt(FileUpload1.PostedFile.ContentLength)) myCommand.Parameters.AddWithValue("@PropPic", filedata)

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill