Sorting a Database Alphabetically [C#]

Shaitan00

Well-known member
Joined
Aug 11, 2003
Messages
343
Location
Hell
My application is made to work with either an Excel, Access, or SQL database (I use typical Database select, update, insert, etc.. calls)
In the case of EXCEL or ACCESS the user has the ability to Launch the actual application to view the DB contents - seeing as the user now has the ability to view the RAW DATA I need a way to "cleanup" the information.

The Database has 3 columns ([CLIENTS], [ASSIGNMENTS], [STATUS]) and multiple rows therefore I need a way to SORT the Database Alphabetically by [CLIENTS] and then by [ASSIGNMENTS].
It occurs to me that this must not be that uncommon of a request so I was wondering if anyone had any hints/helps or samples that could pave the way.
Something efficient would be best seeing as there can be a LOT of rows - are there any common methods, algorithms, built in SORTing calls? etc...
 
I think youre only able to do a permanent sorting in Excel. Access and SQL server are database engines and they keep their own sorting based on the primary key and things like that.

/Kejpa
 
I would completly agree (guess sorting those is competly ridiculous).

However my question still stands for EXCEL - the user is able to use excel "as a database", most of the time they will do this because they want to be able to open it in EXCEL also. Therefore, for it to make sense, I need to sort the Excel worksheet.

Is there a way? Some know algorithms or methods?

Couldnt I simply:
- read in memory (dateset) the entire database
- delete all rows in the database
- sort the internal dataset
- write out all the lines (line by line if I have to) into the database.
I know it sounds ugly but wouldnt it work?
 
Last edited by a moderator:
Sorry,
cant help you. Ive never done any database handling with Excel, Im always convicing the people that think Excel is a database that its not and show the benefits of using a "real" database engine.

Good luck!
/Kejpa
 
Back
Top