Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
| Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2007, 08:07 AM
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default Sorting XML in a dropdown list

Hi,
I have a dropdown list on an aspx form which is being populated by distinct values on an XML file.
Now I need to sort the data in alpbabetical order. Any ideas?

Here is my code for populating the dropdown list:

   if (!Page.IsPostBack)
            // load the xml.
        {
            DataSet ds = new DataSet();
            ds.ReadXml(Server.MapPath("Banks.xml"));
            XmlDataDocument XMLDoc = new XmlDataDocument(ds);
            //for populating the ddl_Banks
            foreach (XmlNode XMLNodes in XMLDoc.SelectNodes("//bank[not(.=preceding::bank)]"))
            {

                ddl_Banks.Items.Add(
                    new ListItem(XMLNodes.ChildNodes[0].InnerText.ToString()));

            }
        }
__________________
Thank You
 
Old November 23rd, 2007, 08:09 AM
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default

just realised that ive droped this topic into the wrong area!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting a list by the third element Devlin C# 2008 aka C# 3.0 5 March 12th, 2008 10:47 AM
Sorting a list/dictionary? Devlin C# 2005 6 March 12th, 2008 12:34 AM
List not sorting, round two Devlin C# 2005 1 March 11th, 2008 02:54 PM
Sorting XML data in a dropdown list on asp.net Hughesie78 XML 4 November 27th, 2007 11:50 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.