DateTime.Min/MaxValue as SQL data source default parameter value?

Discussion in 'ASP .Net' started by Homer J. Simpson, Sep 4, 2007.

  1. When I try to use the following:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:csToolbar %>"
    SelectCommand="spGetValuesForDateRange" SelectCommandType="StoredProcedure">
    <SelectParameters>
    <asp:parameter DefaultValue="<%= DateTime.MinValue %>"
    Name="FIRSTDAY" Type="DateTime" />
    <asp:parameter DefaultValue="<%= DateTime.MaxValue %>"
    Name="LASTDAY" Type="DateTime" />
    </SelectParameters>
    </asp:SqlDataSource>

    ....I get an error implying that DateTime.M[in]|[ax]Value is invalid--ASP.NET
    seems to think I'm trying to use strings. I can't figure out the proper
    syntax.
     
    Homer J. Simpson, Sep 4, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    711
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    537
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    392
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    338
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    762
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page