dcsimg
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Home » Tip Bank » XML
Language: XML
Expertise: Beginner
Jun 9, 2004

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Perform a Case-sensitive Search in .NET Using XPath

The following code shows to how to perform a case-sensitive search in .NET using XPath.

XML File:


<?xml version="1.0" encoding="utf-8"?>
<Users>
  <User>
    <Name>sonu</Name>
    <Password>sonu</Password>
  </User>
</Users>
</code></pre>
Code File:

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>
<%@ Page Language="C#" Debug="true" %>

<script  runat="server">
void Page_Load(object sender, System.EventArgs e){
    if(!Page.IsPostBack){
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(Server.MapPath("user.xml"));
	
	XmlNodeList nodeList = xmlDoc.SelectNodes("Users/User[Name = translate
('SONU', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]");

	Response.Write(nodeList.Count.ToString());
    }
}
</script>
Sonu Kapoor
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date