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?

Thanks.
LVL 12
jet-blackAsked:
Who is Participating?
 
anvConnect With a Mentor Commented:
ok. make this class serializable as well
0
 
anvCommented:
what does the arraylist contains?
0
 
anvCommented:
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.
0
 
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
0
 
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)
0
All Courses

From novice to tech pro — start learning today.