Re: One DS, two tables and two XML files? by Miha
Miha
Fri Dec 05 03:21:18 CST 2003
Hi,
In that case you might want to copy dataset (see DataSet.Copy() method) and
manipulate on the copy.
--
Miha Markic - DXSquad/RightHand .NET consulting & software development
miha at rthand com
Developer Express newsgroups are for peer-to-peer support.
For direct support from Developer Express, write to support@devexpress.com
Bug reports should be directed to: support@devexpress.com
Due to newsgroup guidelines, DX-Squad will not answer anonymous postings.
"al" <grawsha2000@yahoo.com> wrote in message
news:66edfd3c.0312041603.5b65d34c@posting.google.com...
> Kalpesh Shah <kalpesh@disc.microsoft.com> wrote in message
news:<O9nHzTluDHA.3196@TK2MSFTNGP11.phx.gbl>...
> > Check out if this helps
> >
> > Since you have both the tables inside a single dataset & you want to
create 2 seperate xml file (each for a table)
> >
> > // this will write xml for table 1
> > DataTable dt2 = ds.Tables("Table2")
> > ds.Tables.Remove(dt2);
> >
> > ds.Writexml("c:\table1.xml");
> >
> > // after this is done, add table2 & remove table1
> > ds.Tables.Add(dt2);
> >
> > DataTable dt1 = ds.Tables("Table1")
> > ds.Tables.Remove(dt1);
> >
> > ds.Writexml("c:\table2.xml");
> >
> > // after both the things are done, add back table1
> > ds.Tables.Add(dt1);
> >
> > HTH :-)
> > Kalpesh
>
> Kalpesh,
>
> Thanks for your help. The problem I see with your solution is that
> there is an open form bound to that dataset at the moment of XML
> writing. That is, when I remove Table2 from dataset, the data bound to
> the form will disappear too. I guess I will just create two datasets.
>
> Grawsha