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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.