Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7686629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:31:24+00:00 2026-05-31T19:31:24+00:00

<asp:XmlDataSource ID=XmlDataSource2 runat=server DataFile=~/App_Data/XMLFile1.xml TransformFile=XSLTFile1.xslt></asp:XmlDataSource> <asp:DropDownList ID=DropDownList1 runat=server DataSourceID=XmlDataSource2 DataTextField=author DataValueField=author onselectedindexchanged=DropDownList1_SelectedIndexChanged AutoPostBack=True> </asp:DropDownList>

  • 0
<asp:XmlDataSource ID="XmlDataSource2" runat="server" 
            DataFile="~/App_Data/XMLFile1.xml" TransformFile="XSLTFile1.xslt"></asp:XmlDataSource>        
        <asp:DropDownList ID="DropDownList1" runat="server" 
            DataSourceID="XmlDataSource2" DataTextField="author" 
            DataValueField="author" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged"
            AutoPostBack="True">
        </asp:DropDownList>

<?xml version="1.0"?>
<catalog>
  <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <genre>Computer</genre>
    <price>44.95</price>
    <publish_date>2000-10-01</publish_date>
    <description>
      An in-depth look at creating applications
      with XML.
    </description>
  </book>
  <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
    <genre>Fantasy</genre>
    <price>5.95</price>
    <publish_date>2000-12-16</publish_date>
    <description>
      A former architect battles corporate zombies,
      an evil sorceress, and her own childhood to become queen
      of the world.
    </description>
  </book>
  <book id="bk103">

i am loading from xml to dropdownlist
list of all the authors
problem is this not distinct am geting more then one of each author
how do i make this dropdownlist distinct ??
i tryed to google about it and found selectcommand but i could not get it to work
it seems to be like a sql query but am not sure
hope someone here can help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:31:25+00:00Added an answer on May 31, 2026 at 7:31 pm

    Not sure if this will work for you, but you can specify the XPath property to the Xml data source: XPath=”//author[not(.=preceding::author)]”.

    <asp:XmlDataSource ID="XmlDataSource2" runat="server" 
                DataFile="~/App_Data/XMLFile1.xml" XPath="//author[not(.=preceding::author)]"></asp:XmlDataSource>    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use XmlDataSource like this : <asp:XmlDataSource ID=xmlDataSource1 runat=Server DataFile=https://myurl.xml ></asp:XmlDataSource> as a datasource
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
ASP Declaration: <asp:LinkButton ID=LinkButton1 runat=server Text=edit item onclick='AddItem.aspx?catid=<%# Eval(CollectionID)%>'></asp:LinkButton> I get Error: The server
I have a DataGrid that looks like this (slightly simplified here): <asp:DataGrid ID=grdQuotas runat=server
Using a <asp:SiteMapPath> control with the Web.sitemap file below: <asp:SiteMapDataSource ID=SiteMapDataSource1 runat=server /> <asp:SiteMapPath
I'm generating a menu with a Repeater control bound to an XmlDataSource. <asp:Repeater ID=myRepeater
Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView
ASP.NET server-side controls postback to their own page. This makes cases where you want
ASP.NET MVC, VB.NET, SQL Server 2008 R2, Entity Framework v4 I created a stored
Okay so I'm pulling in an XML feed from feedburner, using an XMLDataSource and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.