datatable write to xml file - visual studio 2003

O

Orr

hi
can anybody pls help me?
i am trying to write a datatable to xml file
in visual studio 2005 it goes like this:
datatable dt = new datatable();
dt.writexml(saveFileDialog1.FileName);

in visual studio 2003 dt doesn'n have this property "writexml"

how do i do it?
 
W

W.G. Ryan - MVP

C

Cor Ligthert [MVP]

Orr,

dataset ds = new dataset();
datatable dt = new datatable(); ds.Add(dt);
ds.writexml(saveFileDialog1.FileName);

The result is the same as in 2005 this is done automatic there.

I hope this helps,

Cor
 
C

Cor Ligthert [MVP]

small correction.

ds.tables.Add(dt);

Cor


Cor Ligthert said:
Orr,

dataset ds = new dataset();

The result is the same as in 2005 this is done automatic there.

I hope this helps,

Cor
 
O

Orr

W.G. Ryan - MVP כתב:
You can stick it in a DataSet and call the writexml on the dataset. You can
then strip out the elements you don't need (or leave them in depending on
how they'll affect your app).

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1

Thanks to anybody who helped me!!!
Orr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top