this should be easy...


P

purdy_ra

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.
 
Ad

Advertisements

S

S. Justin Gengo [MCP]

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
 

Top