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.
 
Back
Top