Skip to content
Advertisement

VB.NET > How to insert an image with Using statement and retrieve it to be displayed?

This is the code I’m working on it to insert an image into database. I think there is nothing wrong with the first part. However, somehow this code is not functioning as it supposed to (no image inserted into database). I’m not sure whether the commented part of code is related to the execution or not. How should I develop it in a more viable manner? This command is intended to be executed along with saving a list of typed in data into database. Any help would be nice.

This is the code I’m using to retrieve image from database and display it. There is a glitch with this code. If no image found related to the specific Pid, it would pop-up error 'There is no row at position 0.'(means no image was uploaded). But this doesn’t affects the overall program execution much, as long as the image is uploaded along with the typed in data together successfully, it would be fine.

Advertisement

Answer

I fixed the issue and this is the code for it. Do feel free to check it out and hope it helps someone in future 🙂

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement