S
spowel4
Here's my code thus far:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim objxmldoc As New Xml.XmlDataDocument()
'Load all customer numbers
objxmldoc.Load("s:\sw7\nc\custnum.xml")
Dim onode As Xml.XmlNode
Dim custNum As Xml.XmlNodeList
custNum =
objxmldoc.GetElementsByTagName("AR11_CUSTOMER_NUMBER")
For Each onode In custNum
If onode.HasChildNodes Then
Dim inode, inodes As Integer
inodes = onode.ChildNodes.Count
For inode = 0 To inodes - 1
ComboBoxCustNum.Items.Add(onode.ChildNodes(inode).InnerText)
Next
End If
Next
End Sub
I'm using this to load data into a combobox and it's working but my
problem is there are duplicate entries in the xml file and so
duplicates are being created in the combobox. How do I suppress/
eliminate duplicates? This is with VB2005.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim objxmldoc As New Xml.XmlDataDocument()
'Load all customer numbers
objxmldoc.Load("s:\sw7\nc\custnum.xml")
Dim onode As Xml.XmlNode
Dim custNum As Xml.XmlNodeList
custNum =
objxmldoc.GetElementsByTagName("AR11_CUSTOMER_NUMBER")
For Each onode In custNum
If onode.HasChildNodes Then
Dim inode, inodes As Integer
inodes = onode.ChildNodes.Count
For inode = 0 To inodes - 1
ComboBoxCustNum.Items.Add(onode.ChildNodes(inode).InnerText)
Next
End If
Next
End Sub
I'm using this to load data into a combobox and it's working but my
problem is there are duplicate entries in the xml file and so
duplicates are being created in the combobox. How do I suppress/
eliminate duplicates? This is with VB2005.