?
Solved

Help with filtering data in a table

Posted on 2012-08-18
3
Medium Priority
?
900 Views
Last Modified: 2012-08-18
Hi,

This is a follow up to the following case:

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_27827475.html#a38307414

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"
        C1NSN.DataBind()

but it does not work.


Linkssadb.xml

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Root>
  <LinkA>
    <LinkAID>0</LinkAID>
    <Fuze_ID>0</Fuze_ID>
    <NSN_ID>0</NSN_ID>
  </LinkA>
  <LinkA>
    <LinkAID>1</LinkAID>
    <Fuze_ID>1</Fuze_ID>
    <NSN_ID>1,2</NSN_ID>
  </LinkA>
  <LinkA>
    <LinkAID>2</LinkAID>
    <Fuze_ID>1</Fuze_ID>
    <NSN_ID>1,2</NSN_ID>
  </LinkA>
</Root>
0
Comment
Question by:vcharles
  • 2
3 Comments
 

Author Comment

by:vcharles
ID: 38308256
Hi,

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

V.
0
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 2000 total points
ID: 38308310
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
            Next

Open in new window

0
 

Author Comment

by:vcharles
ID: 38308336
It works!

Thanks!

Victor
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

864 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