Querying XML data through a dataset

  • Thread starter Thread starter Al Christoph
  • Start date Start date
A

Al Christoph

I have a whole set of of small, very fixed tables that i'd like to treat in
much the same way.
1) Mock up in XML
2) Create the Schema
3) Populate manually
4) Create the data set
5) Fill the data set with the XML data in the program
6) Use the data.

Steps 1-5 have worked well for me.
I've even used the filter feature of the dataset to get the information i
need.

However, recent MS dog and pony shows have made me very conscious of the
tricks the nasties can do when forms are being used to build queries.

A) Is this an issue with filters? If so what is the work around.

B) What additionaly steps are required to be able to use the XML as an SQL
"database"? i.e. to be able to use the wonders of the sqlcommand, etc
against them. Or is this not allowed.

As this is preliminary work for projects starting later this year I'm
working in VS 2005 beta using VB.

Regards,
Al Christoph
Three Bears Software, LLC
just right software @ just right prices @ 3bears.biz
 
XML is not designed to be your database. Thus, none of
the ADO.NET SqlCommand, OleDbCommand objects
are relevant.

Typically, you'd load an XML document into an XmlDocument
or an XPathNavigator and perform XPath queries against it.

Here are a few xpath examples (the syntax works in .NET even
thought the objects I use in the sample are from the COM parser).

http://www.eggheadcafe.com/articles/20030627d.asp

--
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.mastervb.net/home/ng/forumvbcode/post10017013.aspx
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 
MS Dog and Pony show - That cracked me up :)

Anyway -
XML isn't a database.
Datasets aren't a database.
SQL Server and Oracle are Databases.

They serve different purposes and while you can certainly use them
interchangeably with a certain degree of overlap, you will never be able to
run an amazon.com off an XML file or a dataset.

To use XML as an ADO.NET data source, you'll have to use or write an ADO.NET
provider. Chapter #15 in my book explains how to write your own ADO.NET
provider. Specifically for XML - here is an example -
http://weblogs.asp.net/pwilson/archive/2004/09/18/231185.aspx

So that answers part of your Q. Now I need to ask you what do you mean by
"Filters"?

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 
Back
Top