Hi,
By default DataSet does not support any queries. What you could do is to
query database directly or to simulate query using XSL stylesheet. Here is an
example how to do this (assuming the Book3.xml is a DataSet file)
------------ VB code to run *query*
Dim loSourceXML As XPath.XPathDocument
Dim loTransform As Xsl.XslTransform
Dim loDataSet As DataSet
Dim loNewDataStream As MemoryStream
Dim loFilteredDataSet As DataSet
loDataSet = New DataSet()
loDataSet.ReadXml("Book3.xml")
loSourceXML = New XPath.XPathDocument(New
StringReader(loDataSet.GetXml()))
loTransform = New Xsl.XslTransform()
loTransform.Load("Transform.xsl")
loNewDataStream = New MemoryStream()
loTransform.Transform(loSourceXML, Nothing, loNewDataStream)
loFilteredDataSet = New DataSet()
loNewDataStream.Position = 0
loFilteredDataSet.ReadXml(loNewDataStream, XmlReadMode.Auto)
loFilteredDataSet.WriteXml("Filtered.xml")
--------------- Transform.xsl file content. It is actual *query*
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/MY_DATASET">
<xsl:element name="MY_FIELD_NAME">
<xsl:copy-of select="DETAIL[FIELD_TO_FILTER='XXXXX']" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>