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......
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor 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

pointemanAuthor Commented:
I may have another problem saving changes back to the XML file...
Guy Hengel [angelIII / a3]Billing EngineerCommented:
that should go do a dedicated question, I think...
pointemanAuthor Commented:
It worked without any problems, thanks...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.