Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Bizarre error in cmd.CreateParameter

Reply
Thread Tools

Bizarre error in cmd.CreateParameter

 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      05-01-2006
Kevin Audleman wrote:
> My stored procedure
> has 14 parameters. The fourth one is state, which I had as a
> varchar(10), but turns out sometimes people were putting in
> "Pennsylvania".


.... which gets us back to the point I was making about validating the
user-supplied data before attempting to use it.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      05-01-2006
> Bob, you're a genius. That's exactly what it was. My stored procedure
> has 14 parameters. The fourth one is state, which I had as a
> varchar(10), but turns out sometimes people were putting in
> "Pennsylvania".


Well, why isn't state a CHAR(2), and constrained in some way? I wonder how
much bad data has made it into your table?

Bob is completely right: VALIDATE USER INPUT, ALWAYS. And when you can,
take away the opportunity for free text when in reality there is a finite
number of options. Calendar controls and drop-down lists are very easy ways
to avoid the inevitable typo (or intentional abuse).


 
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
Bizarre literal.text error Neo Geshel ASP .Net 4 02-26-2007 02:52 AM
Bizarre error with cmd.CreateParameter audleman@quasika.net ASP .Net 0 04-18-2006 07:15 PM
RE: Bizarre error from help() Delaney, Timothy (Tim) Python 14 08-11-2005 10:20 PM
Bizarre error from help() Roy Smith Python 0 08-10-2005 03:02 AM
need help with bizarre error caught in debugger. execution is hanging omission9 Python 3 02-23-2004 08:42 AM



Advertisments