Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8309363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:05:40+00:00 2026-06-08T19:05:40+00:00

I have a project where the data is arriving from the network (not a

  • 0

I have a project where the data is arriving from the network (not a database) and has it’s own parsing peculiarities.

The parsing process stores the data in a array of objects of a class that is full of Public Property.

This class and it’s array is used as an object data source to a BindingSource that shows the values as a nice table in a DataGridView on the screen.

Now I need to save this data to disk (and be able in a later moment to retrieve it back to be sent back to the network).

I’ve worked before with DataSet saving to XML and it’s a breeze to implement, but this one is puzzling me.

All this information is already in the code, so I don’t think I should be typing line by line, each one of the properties to be able to save it.
I’ve been trying without success some way to get the data out of the binder to a new DataSet so I can use the XML method, or some way to get from the binder to disk, or even directly access the DataSource objects.

I really don’t care if even it’s readable as a plain text in disk, as long as I can read it back to the DataSource objects at a later point.

any ideas how to accomplish that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:05:41+00:00Added an answer on June 8, 2026 at 7:05 pm

    Why not just use a XmlSerializer to save your object?


    Example:

    Class MyData
        Public Property Data1 As String
        Public Property Data2 As Int32
        Public Property Data3 As String()
    End Class
    
    Sub Main
    
        Dim d = New MyData() With { _
            .Data1 = "FooBar", _
            .Data2 = 1337, _
            .Data3 = new String(){"Foo", "Bar"} _
        }
    
        Dim serializer = new System.Xml.Serialization.XmlSerializer(gettype(MyData))
    
        '' Saving an object
        Using fs = new System.IO.FileStream("c:\users\username\mydata.xml", System.IO.FileMode.Create)
            serializer.Serialize(fs, d)
        End Using
    
        '' Loading the saved data to a new object        
         Using fs = new System.IO.FileStream("c:\users\username\mydata.xml", System.IO.FileMode.Open)
            Dim new_one = CType(serializer.Deserialize(fs), MyData)
            '' Do something
        End Using
    
    End Sub
    

    Resulting file content:

    <?xml version="1.0"?>
    <MyData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <Data1>FooBar</Data1>
      <Data2>1337</Data2>
      <Data3>
        <string>Foo</string>
        <string>Bar</string>
      </Data3>
    </MyData>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this test Core Data project, I have a one to many relationship from
I have a SSIS project that queries a database and get item level data.
I have a Access Data Project that connects to an SQL server database. Recently
I have a project that involves recording data from a device directly into a
I have hosted my cakePhp project on hostgator. Its not able to retrieve data
I have inherited a project that logs data from a single board computer to
I have a Data project that has all my nhibernate mappings, and my Repositories
I have a new Visual Studio 2008 Database Project (Data Dude). It was generated
I have a project called Data which is a data layer. In this project,
We have a project where data is written to a logging table. Now, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.