Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Get Data From DB, Sort From Smallest To Largest

$
0
0
In my dataset at location dshistory.Tables("History").Rows(x).Item(0) I record names and at location dshistory.Tables("History").Rows(x).Item(4)

I want to build a form that displays rankings but I'm unsure how to retrieve the data in the order I want it. So the steps I need to take are:

1. Iterate through dshistory.Tables("History").Rows(x).Item(4)
2. Get the 10 largest numbers from dshistory.Tables("History").Rows(x).Item(4)
3. Sort those 10 results from Largest to Smallest
3. Display the sorted results in a control be it a label, listbox, whatever.

So I would have something like:

Code:

For x = 0 To dshistory.Tables("History").Rows.Count - 1
'get the list
'do the sorting
Next

'display the results
Label1.Text = results

How to do steps 2 and 3?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>