|
-
Aug 4th, 2004, 04:22 PM
#1
Thread Starter
Junior Member
Distinct on a datatable
I need to run this:
Select Distinct(Role) From Member
on a datatable I loaded from an XML file. How do I do this when I am not running the database on a sql server to run the statement on, I tried the filter property of the dataview but that is only for the statements in the WHERE clause of a sql statement.
Chris
-
Aug 4th, 2004, 06:32 PM
#2
I wonder how many charact
Try this link (its in c#, but if you need the VB code, i translated it below)
http://www.mastercoder.net/viewtopic.php?t=44
VB Code:
Dim distinctVal As Integer = 0
Dim row As DataRow
For Each row in testDT
If distintVal != row("column")
newTable.AddRow(row)
distintVal = row("column")
End If
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|