A Parameter object represents a parameter or argument associated with a Command object based on a parameterized query or stored procedure.
Collections
Methods
Properties
Attributes, Direction, Name, NumericScale, Precision, Size, Type, Value
Remarks
Many providers support parameterized commands. These are commands where the desired action is defined once, but variables (or parameters) are used to alter some details of the command. For example, an SQL SELECT statement could use a parameter to define the specific columns requested, and another parameter to define the matching criteria of the WHERE clause.
Parameter objects represent parameters associated with parameterized queries, and the in/out arguments and return values of stored procedures. Depending on the functionality of the provider, some collections, methods, or properties of a Parameter object may not be available.
With the collections, methods, and properties of a Parameter object, you can do the following:
If you know the names and properties of the parameters associated with the stored procedure or parameterized query you wish to call, you can use the CreateParameter method to create Parameter objects with the appropriate property settings and use the Append method to add them to the Parameters collection. This lets you set and return parameter values without having to call the Refresh method on the Parameters collection to retrieve the parameter information from the provider, a potentially resource-intensive operation.
To refer to a Parameter object in a collection by its ordinal number or by its Name property setting, use any of the following syntax forms:
command.Parameters.Item(0)
command.Parameters.Item("name")
command.Parameters(0)
command.Parameters("name")
command(0)
command("name")
command![name]
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.