Solved

dataset & vb.net & row order

Posted on 2004-04-06
4
1,285 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now