troubleshooting Question

Listview sorting issue

Avatar of cstephen100
cstephen100 asked on
Visual Basic.NET
1 Comment1 Solution300 ViewsLast Modified:
Hi
   I have got a form, that displays a list of categories, These categorise are sorted by a priority number, I have a two buttons up and down so, when I click on category from listview, by pressing ip/down I can move them up list and adjust priority.  The issue I am having is explained below:

I am populating a listview using an SqlDataReader. When loading the information from the database I am using a sort by ‘column’ in the SQL statement. (The column being an integer column).  However when the information gets loaded into the listview the information is not displayed the way I would wish.

The best way of describing it is using the following example of results….

Actual Output                Output Desired
1                                  1
10                                 2
11                                 3
12                                 4
2                                  5
3                                  6
4                                  7
5                                  8
6                                  9
7                                  10
8                                  11
9                                  12

Any help to get the output looking like the second column would be greatly appreciated,
The statement works fin when i run it using sql server or other windows controll i.e datagrid.

Hope someone can help,
Regards
Stephen


ASKER CERTIFIED SOLUTION
gladiatorno9

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros