473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

where clausule in xml file

hi,
i know how to save table content (example: select * from products) to a xml
file

the code below opens the xml file read all records.
i would like to know how i can filter the records like in a query?
can i do something like:
select * from PRODUCTS.XML where id >100 or something????

DataSet ds = new DataSet();
string myXMLfile = @"products.xml";
System.IO.FileStream fsReadXml = new System.IO.FileStream
(myXMLfile, System.IO.FileMode.Open);
try
{
ds.ReadXml(fsReadXml);
XmlReader xrdr = testCommand.ExecuteXmlReader();
xrdr.Read();
Console.WriteLine(xrdr.ReadOuterXml());
foreach (DataRow row in ds.Tables[0].Rows)
{
MessageBox.Show(row["DESCRIPTION"].ToString());
}
......
Sep 15 '08 #1
1 1036
On Sep 15, 11:26*am, "Smart Software" <i...@smart-software.orgwrote:
i know how to save table content (example: select * from products) to a xml
file

the code below opens the xml file read all records.
i would like to know how i can filter the records like in a query?
can i do something like:
select * from PRODUCTS.XML where id >100 or something????
If you're using .NET 3.5, the best way of working would be to either
use a typed dataset and LINQ to DataSet, or LINQ to XML directly.
Either way, you can write your queries in C# 3 with a query
expression. If you're not using .NET 3.5 life becomes a bit harder,
unfortunately. You can probably do it without *too* much effort, but I
wouldn't like to say how off the top of my head. (I don't use datasets
much.)

Jon
Sep 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robert Misiorowski | last post by:
Hello, Everything started with me wanting to write a little command line php script that uses some gd functions. After a little research, I realized I need to unccomment the line in my php.ini...
8
by: Micha³ Wo¼niak | last post by:
Ok, I have a nice iface, I have a (hopefully) good user authentication, I have a DB up-and-running, and I have PHP 4.3.4 (yeah, I know, I will update...). What I need is a logging utility. And...
15
by: Viviana Vc | last post by:
How can I programatically do the equivalent of the following: cacls "C:\Program Files\test" /T /G Everyone:f ? Thanks, Viv
8
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
10
by: vwd2005eeb | last post by:
Visual Web Developer 2005 Express Edition Beta I did Build | Build Web site, where are the DLLs? I was expecting to see maybe one dll for each Web page in a directory (maybe still "bin") under...
1
by: rdemyan via AccessMonster.com | last post by:
I'm trying to implement a licensing scheme. There are three types of licenses: Trial - good for 30 to 60 days Interim - good for 1 year Fully Paid - no expiration Everything is working fine...
10
by: Paul Cheetham | last post by:
Hi, I am developing an application that needs to store some machine-specific settings. The application is going to be published on the network in order to keep the clients on the latest version....
15
by: amit.man | last post by:
Hi, i have newbie qestion, when i write #include <somthing.h> the precompiler subtitue that line with the lines from "somthing.h" header file. when, where and how the compiler insert the...
6
by: littlelisper | last post by:
I want to open an XML file with my browser. The file contains the following line: <?xml-stylesheet type="text/xsl" href="/new.xsl"?> which points to the root node to look for the stylesheet....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.