Solved

dataset & vb.net & row order

Posted on 2004-04-06
4
1,286 Views
Last Modified: 2007-12-19
I have a dataset.  One of the columns is "DIRECTORPositionheld".  I need to move the row where DIRECTORPositionheld = "President" to the top of this dataset, before I bind it to a datalist object.
0
Comment
Question by:dbyrne03
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:EBatista
ID: 10769542
you have to refill the datatable of the dataset with "order by DIRECTORPositionheld". you have to requery the database if is that what you want to know
0
 

Author Comment

by:dbyrne03
ID: 10769767
right now the sql that I'm using to fill the dataset is :
"SELECT * FROM DIRECTOR"
If I use :
"SELECT * FROM DIRECTOR ORDER BY DIRECTORPositionheld"
it will put the accountant above the director above the  president above the treasurer .  What sql would I use to place the president at the top?
0
 
LVL 10

Accepted Solution

by:
EBatista earned 100 total points
ID: 10771322
there is not sql sentece avaible to do what you want, you are forced to use some kind of trick, you could add a column to the database table that express the category and the values could be numbers or letters:
DIRECTORPositionheld    Category
accountant                          4
director                              2
president                            1

then set the order by to that category column  



0
 

Author Comment

by:dbyrne03
ID: 10771941
thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
.net and XML report from SCCM 5 23
Help with error when uploading excel file 3 27
VB: Convert 2 dates to specific format 24 48
Help with exporting to excel 4 27
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question