From: Marc Hillman on
I just discovered XmlDataDocument today, which is the perfect solution to my
problem, but I've just realised that it is obsolete. So what's its
replacement? I wish to access an XML file both via XPath and DataSets. What
options do I have?

From: Mr. Arnold on
Marc Hillman wrote:
> I just discovered XmlDataDocument today, which is the perfect solution
> to my problem, but I've just realised that it is obsolete. So what's its
> replacement? I wish to access an XML file both via XPath and DataSets.
> What options do I have?

Why can't you use Linq-2-XML?

<http://msdn.microsoft.com/en-us/library/bb675156.aspx>

Why do you need a dataset at all? You don't need one if using
Linq-2-XML. You just query the XML and load it into a kind of result set
and you use that instead of the dataset.
From: Marc Hillman on
I've only just realised that I don't need XmlDocument at all. My plan is
that I load the XML into a DataSet, manipulate the data in a DataSet, and
then write the DataSet out in XML when I finish.

Two advantages for me
1. I can bind the dataset tables to datagridviews, and
2. I'm much happier dealing with relational data than navigating XML.

It all seems to be working, so if there is a flaw in my plan, please let me
know.


From: Mr. Arnold on
Marc Hillman wrote:
> I've only just realised that I don't need XmlDocument at all. My plan is
> that I load the XML into a DataSet, manipulate the data in a DataSet,
> and then write the DataSet out in XML when I finish.

You can manipulate the queried result of the Linq-2-XML query, do CRUD
operations against the result, and write the result out as a XML file
all by using Linq-2-XML. You don't need a dataset to do anything.

>
> Two advantages for me
> 1. I can bind the dataset tables to datagridviews, and

You can do that with Linq-2-XML, query the XML using Linq-2-XML, bind
the result to a control, and you don't need a dataset period.


> 2. I'm much happier dealing with relational data than navigating XML.

By using Linq-2-XML, one can treat the XML as relational data.

>
> It all seems to be working, so if there is a flaw in my plan, please let
> me know.
>
>

Linq is the new boy on the block and is very powerful -- very powerful
indeed. Dataset is old technology.
From: Michel Posseth [MCP] on
Hello ,

I use nowadays only use XDocuments when dealing with XML , LINQ makes it
as easy as querying against a database

regards

Michel


"Mr. Arnold" <Arnold(a)Arnold.com> schreef in bericht
news:uZy5shs6KHA.1424(a)TK2MSFTNGP04.phx.gbl...
> Marc Hillman wrote:
>> I've only just realised that I don't need XmlDocument at all. My plan is
>> that I load the XML into a DataSet, manipulate the data in a DataSet, and
>> then write the DataSet out in XML when I finish.
>
> You can manipulate the queried result of the Linq-2-XML query, do CRUD
> operations against the result, and write the result out as a XML file all
> by using Linq-2-XML. You don't need a dataset to do anything.
>
>>
>> Two advantages for me
>> 1. I can bind the dataset tables to datagridviews, and
>
> You can do that with Linq-2-XML, query the XML using Linq-2-XML, bind the
> result to a control, and you don't need a dataset period.
>
>
>> 2. I'm much happier dealing with relational data than navigating XML.
>
> By using Linq-2-XML, one can treat the XML as relational data.
>
>>
>> It all seems to be working, so if there is a flaw in my plan, please let
>> me know.
>>
>>
>
> Linq is the new boy on the block and is very powerful -- very powerful
> indeed. Dataset is old technology.