PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET datatable write to xml file - visual studio 2003

Reply

datatable write to xml file - visual studio 2003

 
Thread Tools Rate Thread
Old 20-06-2006, 04:17 PM   #1
Orr
Guest
 
Posts: n/a
Default datatable write to xml file - visual studio 2003


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?

  Reply With Quote
Old 20-06-2006, 04:40 PM   #2
W.G. Ryan - MVP
Guest
 
Posts: n/a
Default Re: datatable write to xml file - visual studio 2003

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/07...=books&v=glance
http://search.barnesandnoble.com/bo...735622779&itm=1
"Orr" <orrrachman@gmail.com> wrote in message
news:1150816647.230011.110890@b68g2000cwa.googlegroups.com...
> 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?
>



  Reply With Quote
Old 20-06-2006, 04:47 PM   #3
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: datatable write to xml file - visual studio 2003

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


  Reply With Quote
Old 21-06-2006, 05:29 AM   #4
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: datatable write to xml file - visual studio 2003

small correction.

ds.tables.Add(dt);

Cor


"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> schreef in bericht
news:%23kDfSCIlGHA.1640@TK2MSFTNGP02.phx.gbl...
> 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
>



  Reply With Quote
Old 25-06-2006, 01:29 PM   #5
Orr
Guest
 
Posts: n/a
Default Re: datatable write to xml file - visual studio 2003


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/07...=books&v=glance
> http://search.barnesandnoble.com/bo...735622779&itm=1
> "Orr" <orrrachman@gmail.com> wrote in message
> news:1150816647.230011.110890@b68g2000cwa.googlegroups.com...
> > 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?
> >


Thanks to anybody who helped me!!!
Orr

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off