Sort Datetime

Posted on 2004-11-14
Last Modified: 2011-09-20
I'm using web application. I have this code to sort data in a datagrid. The data comes from sql 2000 database.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If IsPostBack Then
            Ds1 = CType(Session("Ds"), ds)
            Session("ds") = Ds1
            dg.DataSource = Ds1.mytable.DefaultView
            dg.DataMember = ""
        End If
    End Sub

    Private Sub dg_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles dg.SortCommand
        dg.DataSource = Dsschedview1.schedule.DefaultView
        Ds1.schedule.DefaultView.Sort = e.SortExpression
    End Sub

This Works for all my columns except it will not sort my datetime column.
Any idea why?
Question by:Donnie4572
    LVL 5

    Accepted Solution

    what does the e equal when you are sorting by datetime?
    LVL 12

    Author Comment

    Thanks for reply. I have corrected this. The Dataadapter had a sort for my date column.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    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…

    734 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

    21 Experts available now in Live!

    Get 1:1 Help Now