Storing arraylist to database in Visual Basic 2008

Hi I have an arraylist named Objects:

Dim Objects As New ArrayList

which stores an array of my class.

I want to store it to the access database. (OLE object field)

How can I get/save this arraylist from/to database?

LVL 12
Who is Participating?
anvConnect With a Mentor Commented:
ok. make this class serializable as well
what does the arraylist contains?
you need to serialze the list and store the data to the field
Also, if you are storing a collection of a user defined class objects then you would need to make that calss serializable as well.
jet-blackAuthor Commented:
The arraylist contains user defined class product

Public Class product
    Public id As Integer
    Public name As String
    Public content As String
    Public is_selected As Boolean
    Public price As Decimal
End Class
jet-blackAuthor Commented:
Thanks, Thats true, but also writing serialize/deserialize functions needed to store the objects and convert them to byte array before sending to database. (which I found it another source)
All Courses

From novice to tech pro — start learning today.