Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > this should be easy...

Reply
Thread Tools

this should be easy...

 
 
purdy_ra@yahoo.com
Guest
Posts: n/a
 
      01-13-2006
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,64 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.

 
Reply With Quote
 
 
 
 
S. Justin Gengo [MCP]
Guest
Posts: n/a
 
      01-13-2006
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
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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,64 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gems should *not be case sensitive.. or should they? botp Ruby 6 10-04-2010 11:42 PM
What the FAQs should and should not contain Josef 'Jupp' SCHUGT Ruby 0 08-19-2005 01:46 PM
Should I Bridge? =?Utf-8?B?Zmx1ZmZ5IHRoZSB3b25kZXIga2l0dGVu?= Wireless Networking 1 07-21-2005 01:25 AM
taking 70-290 should i be scared? What should i expect??? Raymond Munyan MCSE 31 12-01-2004 02:34 PM
How should control images should be handled? ~~~ .NET Ed ~~~ ASP .Net Building Controls 1 11-03-2004 12:30 PM



Advertisments