This deals with images and parent child tables.
I have an app that has a parent table and a child table. The child table will hold images. There is a 1 to (0 to many) relationship between these tables. There can be several images associate with a record in the parent table. I am trying to figure out how to browse for an image, and add it to the dataset and relate it to the parent record. The later part I have done. My issue is with adding adding an image and being able to add multiple image.
This is part of the app that i am adding the images. Obviously the browse opens a file dialog for selecting the image.

This is the code behind the Browse button:
Not sure what to do for the save. I know i have to use something like this:
I know it is something along those lines, but the issue is the ImagePictureEdit.Image.Save(ms, ImagePictureEdit.Image.RawFormat).
Any help would be appreciated.
I have an app that has a parent table and a child table. The child table will hold images. There is a 1 to (0 to many) relationship between these tables. There can be several images associate with a record in the parent table. I am trying to figure out how to browse for an image, and add it to the dataset and relate it to the parent record. The later part I have done. My issue is with adding adding an image and being able to add multiple image.
This is part of the app that i am adding the images. Obviously the browse opens a file dialog for selecting the image.

This is the code behind the Browse button:
VB.NET:
Private Sub BrowseSimpleButton_Click(sender As System.Object, e As System.EventArgs) Handles BrowseSimpleButton.Click
AddtoCardButton.Enabled = False
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Me.CardimageBindingSource.AddNew()
ImagePictureEdit.Image = Image.FromFile(OpenFileDialog1.FileName)
AddtoCardButton.Enabled = True
End If
End Sub
Not sure what to do for the save. I know i have to use something like this:
VB.NET:
Dim ms As New MemoryStream()
ImagePictureEdit.Image.Save(ms, ImagePictureEdit.Image.RawFormat)
Dim data As Byte() = ms.GetBuffer
me.cardimage.bindingsource.endedit
I know it is something along those lines, but the issue is the ImagePictureEdit.Image.Save(ms, ImagePictureEdit.Image.RawFormat).
Any help would be appreciated.