Murray Brown
asked on
ASP.net filter on a data table to read unique items
Hi
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.Default View.RowFi lter = "[Segment 1 Desc]=*" 'XXXX
With Me.Category1.Items
.Clear()
For i As Integer = 0 To xSQLTable_Accounts.Default View.Count - 1
.Add(xSQLTable_Accounts.De faultView. Item(i).It em("Segmen t 1 Desc"))
Next
End With
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.Default
With Me.Category1.Items
.Clear()
For i As Integer = 0 To xSQLTable_Accounts.Default
.Add(xSQLTable_Accounts.De
Next
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Minor alteration: had to take square brackets out to get it to work
Dim dTemp As DataTable = xSQLTable_Accounts.Default View.ToTab le(True, "Segment 1 Desc")
Thanks again!
Dim dTemp As DataTable = xSQLTable_Accounts.Default
Thanks again!
ASKER