We help IT Professionals succeed at work.
Get Started

ASP.net filter on a data table to read unique items

Murray Brown
Murray Brown asked
Last Modified: 2012-08-21

I usually use the following SQL statement coupled with a reader to populate an ASP.net DropDownList. In my latest solution I am trying to read the same items using a filter.
I'm not quite sure how to use Distinct or create get unique items from the following code  
How would I adjust the following line marked XXXX  ?

  xSQLTable_Accounts.DefaultView.RowFilter = "[Segment 1 Desc]=*"  'XXXX

                With Me.Category1.Items
                    For i As Integer = 0 To xSQLTable_Accounts.DefaultView.Count - 1
                        .Add(xSQLTable_Accounts.DefaultView.Item(i).Item("Segment 1 Desc"))
                End With
Watch Question
Most Valuable Expert 2012
Top Expert 2014
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE