Solved

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

Posted on 2013-06-05
2
282 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Javascript Refresh Parent Page from Popup 3 48
How Do I set the Visual Minor Grid Interval Value Programatically? 4 33
VB.Net - CSV to Oracle table 4 51
vb.net 2 37
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

943 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

3 Experts available now in Live!

Get 1:1 Help Now