Solved

Save and then re-load a dataset to/from XML file

Posted on 2013-06-05
2
280 Views
Last Modified: 2013-06-12
Experts,

I have a Series of Properties created for a DataGridView generator I wrote some time back.  It works well and now I was thinking of adding the ability to write the structure to an XML file and then read it back in.

I have the following sets of Public Properties I want to store:
strVarStructure
strVarLayout
strVarProperties
strVarSettings

The strVarProperties and strVarSettings relate to DataGridView fields so there can be several of these as Public Property arrays.

I don't want to store the actual DataGridView data, but the basic structure of the DataGridView and its properties including all field properties.  This ability would allow me to setup a Default view and allow the user to change fields being displayed as needed with options.

With XML there is ReadXML and WriteXML.

Can I create a dataset including the above Public Properties and write that using the statements above which relate to the dataset?

OR do I need to write some additional code to create the dataset structure I want to write and then read back in?

Thank you for your assistance.
0
Comment
Question by:Peter Allen
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 39239546
You will need to define the datatable structure with columns. Then populate the datatable with property values and write to xml file.
0
 

Author Closing Comment

by:Peter Allen
ID: 39242248
Got it!  Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

21 Experts available now in Live!

Get 1:1 Help Now