Question Create XML File With Datagridview?

jcharles12

New member
Joined
Nov 3, 2014
Messages
1
Programming Experience
Beginner
I am making a receipt template with vb.net.

I would like to store the receipts attributes and values in an xml file and also be able read it back .

There will only need to be two columns in the data grid view. The attribute name and the value.

EX:

Attribute | Value
--------------------------
StoreName | MyStore
Address | 1234 street dr
...
....


I have been able to write to an xml file , but cannot figure out how to read/write to and from datagridview
 
You may not want to go this way but the simplest option is to use a DataTable and bind it to the grid. The DataTable has ReadXml and WriteXml methods so reading and writing files takes one line each. You also need no code to get data between the table and the grid other than one line to bind.
 
Back
Top