DataSet Read XML Select Where Statement?

I'm very used to interacting with SQL databases and C# DataSets. Now I'm seeing how effectively I can use Datasets and XML files.

Problem: Need to Load only part of an XML file into a Dataset/DataTable

Query: Select * From XML Where PcName = 'work'

I've seen some queries using LINQ, but I'm still too new to it......
pointemanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Problem: Need to Load only part of an XML file into a Dataset/DataTable
you cannot.

however, once the datatable is loaded, you can get a dataview from the datatable, and use the rowfilter property, aka set it to:

DataView dv = YourDataset.DataTables[0].DefaultView;
dv.RowFilter = "PcName = 'work'";

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pointemanAuthor Commented:
I may have another problem saving changes back to the XML file...
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
that should go do a dedicated question, I think...
0
pointemanAuthor Commented:
It worked without any problems, thanks...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.