I'm not concerned with the order of the rows, it's the columns I'm having trouble with. My table shows monthly rent payments for each tenant in an apartment complex, e.g. "TenantID | JanDate | JanAmountPaid | FebDate | FebAmountPaid". But when I fill my datatable and display the data in a datagrid, instead of being in the correct order, the columns are in alphabetical order. My database isn't sorted in this way, nor is there an ORDER BY clause in my SQL statement. I just don't get it.
Oh.. ehhehhe. Now you make sense
ORDER BY orders ROWS, not columns.. Sorry! (When you said "the columns are sorted alphabetically, I thought you meant a column of data was sorted alpha).
To change the order of columns, you must change the order of their appearance in the SQL
i.e. the following two select the same columns but a very different order:
SELECT JanDate, DecDate, FebAMount, MyCol, ZZZ, ABC FROM Table
SELECT MyCol, ZZZ, ABC, JanDate, DecDate, FebAMount FROM Table
Change the order of columns in your query, wherever it is! ANd if youre using SELECT *, then try explicitly naming them