0

Ok i am saving my picture localy, each picture gets a unqiue number.
This number is also saved in my sql database together with some other data.
The jpg is saved localy in my project.

What i am having troubles with is.

When i am on my overview form, and i click in the datagrid on a certain person.
I want to load all data from this person including his picture.
The regular data is loading just fine, but thats a simple task since its all just linked through datasources.

The Imagebox however needs to have the name from my unique number textbox(also in the database).
And has to add .jpg to the unique number.

Can anybody give me a example how this could work upon clicking on the person in a datagrid.

Thanks

1
Contributor
1
Reply
3
Views
4 Years
Discussion Span
Last Post by Sevyt
0

This is how its saved automatically

        Dim file_name As String = Application.ExecutablePath
        file_name = file_name.Substring(0, file_name.LastIndexOf("\bin")) & "\" & TxtRijksregisterNr.Text & "."
        Dim bm As Bitmap = EidPicAfspraken.Image
        bm.Save(file_name & "jpg", System.Drawing.Imaging.ImageFormat.Jpeg)

The way i am trying right now is

    Private Sub PatientenDataGridView_CellContentClick_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles PatientenDataGridView.CellContentClick
        EIDPicOverzicht.Image = Image.FromFile(TxtRijksregisterNr.Text & ".jpg")
    End Sub

This gives me this error.
FileNotFoundException was unhandled
80110716128.jpg

Edited by Sevyt

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.