Storing arraylist to database in Visual Basic 2008

Posted on 2009-12-17
Last Modified: 2012-06-27
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?

Question by:jet-black
    LVL 10

    Expert Comment

    what does the arraylist contains?
    LVL 10

    Expert Comment

    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.
    LVL 12

    Author Comment

    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
    LVL 10

    Accepted Solution

    ok. make this class serializable as well
    LVL 12

    Author Closing Comment

    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)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now