|
-
Apr 2nd, 2003, 07:12 AM
#1
Thread Starter
Fanatic Member
SP parameters
Hi,
What is the difference between
command.parameters.add("@Email",txtEmail.text)
and
command.parameters.add("@Email",sqldb.char,10)
command.parameters("@Email").value=txtEmail.text
-
Apr 4th, 2003, 04:47 PM
#2
Registered User
Not much actually. I personally prefer the second method because it forces the declaration of the parameter type in code (thus if you pass a value of the wrong type VB will raise the error instead of SQL...the error message is usually a little more intuitive in VB than in SQL since SQL error handling leaves a lot to be desired). Not only that but the second method is good coding practice. When other developers are looking through your code, they can see right away what the parameter datatype is instead of having to pull up the SP in SQL to make sure the value being passed is correct. Hope that helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|