Storing images to a class property and to a dataset


Active member
Dec 29, 2010
Programming Experience
What is the best way to store images to a property in a class and/or to a datatable?

I have a class like this:
Public Class Person
    Property pictures As List(Of Byte())

End Class

...where I want to store a collection of .jpg/.bmp/.gif/.png pictures that the user can select from the computer.
I use OpenFileDialog as an interface to select the pictures but how can I store them to my class property?
I would also like to store them to a datatable, where I have a column named "picture" with the type defined as system.byte[]

I then have an image control on the window which should display these pictures one at a time (this is a WPF project) based on the selected row on the datagrid control.

What is the best way to do it?
Top Bottom