Q:

Applying sorting on datareader while binding to dropdown in asp

Currently I am facing a problem for sorting datareader contents alphabetically. The scenario is I have a datareader that reads department name from database. Then, in while loop, I am binding each datareader row to dropdown (<select><option Value=''>Some Text</option></select>). I want to show contents in alphabetical order. 
How can I achieve this?

A:

You can't really do anything with a datareader besides looping through the records.  You'll need to apply the sort to your source query.
If you get the data into a DataTable, you can apply the sort before binding.

