Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I am new in XML and have some problems to execute queries on xml db. I am using exist native xml db. Can you write sample insert, update,delete queries and how to execute them.
this is my sample xml file:

HTML
<users>
    <user>
        <fullname>
		Frederick
	</fullname>
        <username>
		Fred
	</username>
        <password>
		123
	</password>
    </user>
</users>


Thanks in advance
Posted
Comments
Orcun Iyigun 29-Dec-11 14:39pm    
Have a look at these 2 links, it is a bit advanced but it might help you
Link 1[^]
Link 2[^]

You can use Xml.Linq for your query.
C#
using using System.Xml.Linq;
//...
//...
//...
private void QueryFromXml(string xmlFilePath)
{
XDocument xmlDoc = XDocument.Load(xmlFilePath);
var myNode= (from p in xmlDoc.Descendants("user")
             select p.Element("fullname").Value);
//....
// Place code here to do whatever you want to do with the query.
//....


}
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900