Command Parameters

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

When calling a stored procedure and building the SqlParameter object, Is it
required to specify the data type of the parameter (String, Integer, etc.)?
When would in not be required?
 
No, it is not required. The command will take a look at the type of the
value and use that for the dbtype. It actually does a nice job doing this,
so technically you only need to pass the param name and value. I would
recommend, if you can, passing the type and size though.
 
Thanks
Greg said:
No, it is not required. The command will take a look at the type of the
value and use that for the dbtype. It actually does a nice job doing this,
so technically you only need to pass the param name and value. I would
recommend, if you can, passing the type and size though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top