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 4092128
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:27:10+00:00 2026-05-20T19:27:10+00:00

Using ASP/VB, I’m trying to get rid of some duplication in a list box

  • 0

Using ASP/VB, I’m trying to get rid of some duplication in a list box that is coming from an XML document.

Sorry if this is a daft question, I’m new to this.

I’ve tried various things, but nothing has worked. Here is the code – thanks for any help / assistance!

Function getAssets(ByVal siteid As String) As String

    Dim oAssets As New Xteam.XteamWebService
    Dim strAssets As String = ""
    Dim oDoc As New XmlDocument
    'Dim oNode As XmlNode

    strAssets = oAssets.ReadHAssetCodes(siteid)

    oDoc.LoadXml(strAssets)

    For Each Node As XmlNode In oDoc.SelectSingleNode("XteamAssets")
        lstHAssets.Items.Add(New ListItem(Node("hassetdescription").InnerText, Node("hassetcode").InnerText))




    Next

    lstHAssets.Items.Insert(0, "--Please Select--")


    Return "ToSender"

End Function
  • 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-20T19:27:11+00:00Added an answer on May 20, 2026 at 7:27 pm

    There’s probably a more efficient way but this will work.

    Function getAssets(ByVal siteid As String) As String        
    Dim oAssets As New Xteam.XteamWebService      
    Dim strAssets As String = ""      
    Dim oDoc As New XmlDocument      '
    Dim oNode As XmlNode        
    strAssets = oAssets.ReadHAssetCodes(siteid)        
    oDoc.LoadXml(strAssets)   
    Dim strAryUniqueValues as string() 
    Dim strUniqueValues as string = ""
    Dim i as int = 0
    Dim strSearchPair as string   
    For Each Node As XmlNode In oDoc.SelectSingleNode("XteamAssets") 
        strSearchPair = "~" & Node("hassetdescription").InnerText & "/" & Node("hassetcode").InnerText & "~"
        ' see if these values have been included already, if not then add them
        if instr(strUniqueValues,strSearchPair) = -1 then         
            strAryUniqueValues(i) = strSearchPair
            strUniqueValues = strUniqueValues & strAryUniqueValues(i)    
            i = i + 1
        end if   
    Next  
    'now loop back through and build your listbox
    Dim strAryPair as string()
    For each strPair in strAryUniqueValues 
        strAryPair = split(strPair,"/") 
        lstHAssets.Items.Add(New ListItem(Replace(strAryPair(0),"~",""),Replace(strAryPair(1),"~","")) 
    Next 
      lstHAssets.Items.Insert(0, "--Please Select--")         
      Return "ToSender"    
    End Function  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using ASP.NET MVC when trying to get the information stored on my Session[objectName] from
When using ASP.Net routing, how can you get the RouteData from the code-behind? I
Using Asp.net MVC, I have one view that's strongly bind to List , and
Using ASP.NET MVC 2.0, I have an actionlink that is used for comments on
Using ASP.NET MVC + jQuery : I need to use some values owned by
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
Using ASP.NET membership, if I want to get information for the current user, I
using ASP.NET MVC 1.0 and I have a action that returns a JsonResult and
Using ASP.NET MVC and Entity Framework, I encounter some attach/detach errors when I need
Using ASP.Net MVC 1.0 I have a form with some input control on it.

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.