S
S
sivabur2015-12-10 19:08:03
C++ / C#
sivabur, 2015-12-10 19:08:03

How to write read data in xml from dataGridView?

Application startup events

ds = new DataSet();
dt = new DataTable();

ds.Tables.Add(dt);
dataGridView1.DataSource = ds.Tables[0];

Save button
ds.WriteXml("1.xml");
events 1.xml (when entering 3 entries)
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <Table1 />
  <Table1 />
  <Table1 />
</NewDataSet>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Evseev, 2015-12-17
@alex1t

Can use DataTable.WriteXml (or any other overload).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question