Re: stupid american system

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 02/18/04


Date: Wed, 18 Feb 2004 10:16:13 -0000

Sput <sputspamnomore@post.htnet.hr> wrote:
> Application is rather large and I noticed problem when I started writting
> reports for it.
>
> Data field in database is datetime. When opened in access it can be sorted
> properly in it.
>
> When I get it into C#, I use command as
> sql="SELECT code,name,item1,item2,date WHERE blah blah ORDER by date"
>
> same happens when using GROUP BY date

If you're doing that, it should correctly be sorted to start with,
before you tell the grid to sort the results at all.
 
> In datagrid, as I have asked several times everywhere, which is populated by
> data from same database, when I click on column that contains dates or decimal
> numbers, it is sorted just by "dd" of "dd.MM.yyyy", while decimal is sorted by "#" of
> "#,##0.00"

It sounds like it's DataGrid's (or possibly even DataView's) sorting
that's at fault then, sorting it by formatted string rather than by
actual value. I'll look into it a bit... it sounds like there's no need
for an actual database to be involved at all.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: accessing database fields
    ... >>A data field can be access with by using the FieldByName ... >slight performance advantage over user FieldbyName but I use Fieldbyname because ... >>mask of a database field, I do create and instance of the field, so that I ... >When you define persistent tfields delphi can only use the fields you have ...
    (borland.public.delphi.database.ado)
  • Re: Contact Database Search a Year
    ... "Jeff Boyce" wrote: ... value) or contained the characters "1999" in some data field. ... Microsoft Office/Access MVP ... The rest is the same a basic database ...
    (microsoft.public.access.forms)
  • rendering images from a database
    ... If you have a table in a database with an ID field, ... (varchar), a content-type field ... you have binary data in the data field, ...
    (comp.lang.perl.misc)
  • Re: Contact Database Search a Year
    ... You described the names of some of the objects in your database. ... value) or contained the characters "1999" in some data field. ... Microsoft Office/Access MVP ... "Jeff Boyce" wrote: ...
    (microsoft.public.access.forms)
  • Re: find position of row in set of rows
    ... alternative - this usually means retrieving an unordered result set into ... returned from the database. ... application design is wrong. ... my point was that sorting the result set at the ...
    (comp.databases.oracle.server)