Re: Cast from String To Date

Discussion in 'ASP .Net' started by S. Justin Gengo, Jul 16, 2003.

  1. Are you validating the entry before the cast occurs?

    My guess would be that someone is entering a string that couldn't possible
    be a date.

    Try using a compare validator on the date entry field:

    Set the validator's "Operator" parameter to "DataTypeCheck" and its "Type"
    to "Date".

    (This will validate the text box client side. To make sure a browser that
    doesn't support client side validation doesn't still submit a non-date also
    check Page.IsValid before submitting to database.)

    I hope this helps,

    --
    S. Justin Gengo, MCP
    Web Developer / Programmer

    Free Code Library At:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Vrushal" <> wrote in message
    news:007501c34bb9$4768f680$...
    > Hi Guys..
    >
    > I m getting error "Cast From String to Date Not Valid"
    >
    > We have around 100 ASP.Net Pages and error comes on some
    > pages and works fine with other pages While Inserting
    > Data, Update Data...
    >
    > For updation and Insertion i have written procedures, and
    > all the field Type is have DateTime.
    >
    > what could be possible cause...
    >
    > Thnkx in Advance...
    > vrushal
    >
    >
    S. Justin Gengo, Jul 16, 2003
    #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. Kiran
    Replies:
    1
    Views:
    507
    =?Utf-8?B?ZG90bmV0a3VtYXI=?=
    Aug 4, 2005
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,229
    Michael Borgwardt
    May 30, 2004
  3. MSG

    to cast or not to cast malloc ?

    MSG, Feb 6, 2004, in forum: C Programming
    Replies:
    38
    Views:
    1,062
    Dan Pop
    Feb 10, 2004
  4. EvilRix
    Replies:
    8
    Views:
    623
    Martin Dickopp
    Feb 14, 2004
  5. Pavel
    Replies:
    7
    Views:
    515
    Pavel
    Sep 19, 2010
Loading...

Share This Page