this should be easy...

Discussion in 'ASP .Net' started by purdy_ra@yahoo.com, Jan 13, 2006.

  1. Guest

    really simple.
    the DBA gives you a field called txtEntry.
    it's an integer field in sql 2000.

    make a form that has the txtEntry field and validate that only integers
    are passed thru on that
    form when you save it.

    well, i tried this.
    i used the CompareValidator control.
    make it to DataTypeCheck to Integer.

    it lets thru
    9999999999
    that is ten 9's.
    it shouldn't because an integer's max value is

    int
    Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 -
    1 (2,147,483,647). Storage size is 4 bytes. The SQL-92 synonym for int
    is integer

    why does it let this pass thru? am i doing something wrong?

    then on top of that
    if i try to pass
    2,147,483,647 it won't work because it has comma's.

    there has to be a better way to do this.
    help, thx.
     
    , Jan 13, 2006
    #1
    1. Advertising

  2. Purdy,

    Use a range validator instead. With it you can set minimum and maximum
    values. It won't allow commas either though. If you really need to allow
    commas and check the min/max you'll want to use a regular expression
    validator.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    <> wrote in message
    news:...
    > really simple.
    > the DBA gives you a field called txtEntry.
    > it's an integer field in sql 2000.
    >
    > make a form that has the txtEntry field and validate that only integers
    > are passed thru on that
    > form when you save it.
    >
    > well, i tried this.
    > i used the CompareValidator control.
    > make it to DataTypeCheck to Integer.
    >
    > it lets thru
    > 9999999999
    > that is ten 9's.
    > it shouldn't because an integer's max value is
    >
    > int
    > Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 -
    > 1 (2,147,483,647). Storage size is 4 bytes. The SQL-92 synonym for int
    > is integer
    >
    > why does it let this pass thru? am i doing something wrong?
    >
    > then on top of that
    > if i try to pass
    > 2,147,483,647 it won't work because it has comma's.
    >
    > there has to be a better way to do this.
    > help, thx.
    >
     
    S. Justin Gengo [MCP], Jan 13, 2006
    #2
    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. Hazzard
    Replies:
    2
    Views:
    683
    Hazzard
    Apr 6, 2004
  2. Mark Sandfox

    This should be easy, but...

    Mark Sandfox, Jan 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    335
    Mark Sandfox
    Jan 28, 2005
  3. Chad
    Replies:
    2
    Views:
    5,817
    Chad Dokmanovich
    Dec 28, 2005
  4. Tom McCallum

    This should be easy...

    Tom McCallum, Jan 20, 2005, in forum: Java
    Replies:
    6
    Views:
    4,110
    Virgil Green
    Jan 20, 2005
  5. Bruno Desthuilliers
    Replies:
    5
    Views:
    418
    Bruno Desthuilliers
    Aug 29, 2007
Loading...

Share This Page