473,385 Members | 1,922 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,385 software developers and data experts.

retrieving xml value

below is my xml structure, how can I use Xquery to query for a specific
username?

<?xml version="1.0" encoding="utf-8" ?>
<users>
<user>
<username></username>
<pwd></pwd>
</user>
</users>
Nov 19 '05 #1
1 801
Your XML:

<?xml version="1.0" encoding="utf-8" ?>
<users>
<user>
<username>John</username>
<pwd></pwd>
</user>
<user>
<username>Steve</username>
<pwd></pwd>
</user>
<user>
<username>Kate</username>
<pwd></pwd>
</user>
</users>
And you code :)

XPathDocument xpd = new XPathDocument(Server.MapPath(@"~/user.xml"));
XPathNavigator xpn = xpd.CreateNavigator();
XPathNodeIterator i = xpn.Select(@"//username");
while (i.MoveNext())
Response.Write(i.Current.Value);
--
C# Dev
"Asha" wrote:
below is my xml structure, how can I use Xquery to query for a specific
username?

<?xml version="1.0" encoding="utf-8" ?>
<users>
<user>
<username></username>
<pwd></pwd>
</user>
</users>

Nov 19 '05 #2

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

Similar topics

10
by: Girish | last post by:
Hi Everyone, I am passing a form to a php script for further processing. I am able to retrieve the last value set for that given form variable using $variable=$_REQUEST;
1
by: Olaf Rabbachin | last post by:
Hi folks, I'm looking for a way of retrieving the default-value of a table's field within an Access 2003 MDB. Any hints on how to accomplish this from ASP.Net? Thanks, Olaf -- My .02:...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
15
by: gunnar.sigurjonsson | last post by:
I´m having some problem retrieving identity value from my newly inserted row into a view. I have two tables T1 and T2 which I define as following CREATE TABLE T1 ( id BIGINT GENERATED ALWAYS...
2
by: 4Ankit | last post by:
hello all, i am having some difficulty retrieving information from my form. I want to add content in my table but the content i want to add to the table is what the user inputs in my form. ...
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the...
4
by: kaisersose1995 | last post by:
Hi, I'm trying to get Novell Netware information using vba into my access database and have no idea how to progress. Basically when i right click the properties on my computer the free space of a...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
2
by: SV | last post by:
I have a login form with “Remember me on this computer” checkbox. I am creating cookie if checkbox is checked. My code is: If chk_remember.Checked = True Then Dim ckUserName As HttpCookie =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.