Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

dataset & vb.net & row order

Posted on 2004-04-06
4
Medium Priority
?
1,293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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:…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 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