Import picture based on SQL DB field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I'm new to VB.NET, just switching from access.

On a large database for furniture i would like to just have the picture
location information, and have a form or report import the picture from a
file folder based on the location information in the database record, how can
i do that?

Would appriciate if anyone could show me the trick?

regards
Morten Tapestry
 
You can store path to the picture in the database and load it to Bitmap
class:

Dim myBitmap As Bitmap
myBitmap = New Bitmap(path_to file)

Gaidar
 
Or you can create Image object insimilar way:

Dim myImage As New Image
myImage.FromFile(fileName)

Gaidar
 
Thanks for your reply, can i ask one further question:
If the path to the picture files are : SERVER\TECH\ITEMPICTURES\ and the
file name is the same as the value of a field called "ItemCode", how can i
get the picture box apdated automatic when the record changes? do i make a
sub rutine to call after each navigation?
And will the same way work on a Pocket Pc?
 
Back
Top