Help with filtering data in a table

Posted on 2012-08-18
Last Modified: 2012-08-18

This is a follow up to the following case:

when NSN_ID in my  linkssadb file contains the same data (listed below), I receive 4 rows from LinkAID = 1 and LinkAID = 2 in my list box instead of only for data for LinkAID = 1. Is there a way to filter by LinkAID instead of NSN_ID?

I tried changing the filter from  NSN_ID to LinkAID:

MsgBox("keyNsn" & keyNsn)
        Dim _table As DataView = dtMaster.DefaultView
        _table.RowFilter = "LinkAID in (" & keyNsn & ")"
        C1NSN.DataSource = _table
        C1NSN.DataTextField = "NSN"
        C1NSN.DataValueField = "NSN_ID"

but it does not work.


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
Question by:vcharles

    Author Comment


    As an alternate solution, how do you also avoid duplicate rows in a listbox?

    LVL 18

    Accepted Solution

    Just change these lines ,  it will work for u .
     For Each xnNSN As Xml.XmlNode In xdNSN.SelectNodes("/Root/NSNTable[contains('," & NSNID & ",', concat(',', NSN_ID, ','))]") 'NSN.xml
                    NSNID2 = xnNSN.SelectSingleNode("NSN_ID").InnerText
                    If dtMaster.Select("NSN_ID in (" & NSNID2 & ")").Length = 0 Then
                        Name = xnNSN.SelectSingleNode("NSN").InnerText
                        dtMaster.Rows.Add({fuze_Nsn_id, LinkAID, NSNID2, Name})
                    End If

    Open in new window


    Author Comment

    It works!



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now