Freigeben über


AdoDotNetParameter Class

Represents a data parameter that is derived from a data source command, or that is passed with a command to a data source whose underlying technology is ADO.NET.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.DataParameter
    Microsoft.VisualStudio.Data.AdoDotNet.AdoDotNetParameter

Namespace:  Microsoft.VisualStudio.Data.AdoDotNet
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Public Class AdoDotNetParameter _
    Inherits DataParameter
public class AdoDotNetParameter : DataParameter
public ref class AdoDotNetParameter : public DataParameter
type AdoDotNetParameter =  
    class
        inherit DataParameter
    end
public class AdoDotNetParameter extends DataParameter

The AdoDotNetParameter type exposes the following members.

Constructors

  Name Description
Public method AdoDotNetParameter(String) Class constructor. Initializes a parameterized instance of the AdoDotNetParameter class, along with the name of the ADO.NET data provider being serviced by the connection.
Public method AdoDotNetParameter(String, IDataParameter) Class constructor. Initializes a parameterized instance of the AdoDotNetParameter class, providing a parameter for a Command object and the name of the DDEX provider.
Public method AdoDotNetParameter(String, IDataParameter, Boolean) Class constructor. Initializes a parameterized instance of the AdoDotNetParameter class, providing a parameter for a Command object, the name of the DDEX provider, and an indication whether the parameter is derived using the DeriveParameters method.

Top

Properties

  Name Description
Protected property DefaultPrecision Retrieves a byte value specifying the default precision for the current parameter type. (Inherited from DataParameter.)
Protected property DefaultScale Retrieves a byte value specifying the default scale for the current parameter type. (Inherited from DataParameter.)
Protected property DefaultSize Retrieves and integer value specifying the default size for the current parameter type. (Inherited from DataParameter.)
Public property Direction Retrieves or sets a DataParameterDirection object specifying the direction of the parameter. (Inherited from DataParameter.)
Public property IsDerived Retrieves a Boolean value that indicates whether this parameter was derived from the data source. (Inherited from DataParameter.)
Protected property IsFixedPrecision Retrieves a Boolean value indicating whether the precision for the current parameter type is fixed. (Overrides DataParameter.IsFixedPrecision.)
Protected property IsFixedScale Retrieves a Boolean value indicating whether the scale for the current parameter type is fixed. (Overrides DataParameter.IsFixedScale.)
Protected property IsFixedSize Retrieves a Boolean value indicating whether the size for the current parameter type is fixed. (Overrides DataParameter.IsFixedSize.)
Public property IsNullable Retrieves a Boolean value indicating whether this parameter can have a nulla null reference (Nothing in Visual Basic) value. (Inherited from DataParameter.)
Public property IsOptional Retrieves a Boolean value indicating whether this parameter is optional, in cases where this parameter is a derived parameter. (Inherited from DataParameter.)
Public property Name Retrieves or sets the string literal name of the parameter. (Inherited from DataParameter.)
Public property Parameter Retrieves the IDataParameter object representing the command parameter.
Public property Precision Retrieves or sets a byte value specifying the precision of the parameter. (Inherited from DataParameter.)
Public property Scale Retrieves or sets a byte value specifying the scale of the parameter. (Inherited from DataParameter.)
Public property Size Retrieves or sets an integer value specifying the size of the parameter. (Inherited from DataParameter.)
Public property Type Retrieves or sets the data-source-specific type of the parameter. (Inherited from DataParameter.)
Public property Value Retrieves or sets the value of the parameter. (Inherited from DataParameter.)

Top

Methods

  Name Description
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected method GetDirectionImpl Retrieves the parameter direction. (Overrides DataParameter.GetDirectionImpl().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Protected method GetIsNullableImpl Retrieves a Boolean value indicating whether this parameter can be nulla null reference (Nothing in Visual Basic). (Overrides DataParameter.GetIsNullableImpl().)
Protected method GetIsOptionalImpl Retrieves a Boolean value indicating whether this parameter is optional. (Inherited from DataParameter.)
Protected method GetNameImpl Retrieves the name of the parameter. (Overrides DataParameter.GetNameImpl().)
Protected method GetPrecisionImpl Retrieves a byte value specifying the precision of the parameter. (Overrides DataParameter.GetPrecisionImpl().)
Protected method GetScaleImpl Retrieves a byte value specifying the scale of the parameter. (Overrides DataParameter.GetScaleImpl().)
Protected method GetSizeImpl Retrieves an integer value specifying the size of the parameter. (Overrides DataParameter.GetSizeImpl().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method GetTypeFrom Returns a AnsiString for a nulla null reference (Nothing in Visual Basic) or DBNull value; alternatively maps the value type to a DbType value and returns the string equivalent. (Overrides DataParameter.GetTypeFrom(Object).)
Protected method GetTypeImpl Retrieves the data-source-specific type of the parameter. (Overrides DataParameter.GetTypeImpl().)
Protected method GetValueImpl Retrieves the value of a specified parameter. (Overrides DataParameter.GetValueImpl().)
Protected method IsSupportedDirection Retrieves a Boolean value indicating whether the specified parameter direction is supported. (Inherited from DataParameter.)
Protected method IsValidType Retrieves a Boolean value indicating whether the specified data-source-specific type is a valid type. (Overrides DataParameter.IsValidType(String).)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnDirectionChanged Called when the Direction property is changed to signal a change in the parameter direction. (Inherited from DataParameter.)
Protected method OnDirectionChanging Called when the Direction property is about to change. (Inherited from DataParameter.)
Protected method OnNameChanged Called when the Name property has changed. (Inherited from DataParameter.)
Protected method OnNameChanging Called when the Name property is about to change. (Inherited from DataParameter.)
Protected method OnPrecisionChanged Called when the Precision property has changed. (Inherited from DataParameter.)
Protected method OnPrecisionChanging Called when the Precision property is about to change. (Inherited from DataParameter.)
Protected method OnScaleChanged Called when the Scale property has changed. (Inherited from DataParameter.)
Protected method OnScaleChanging Called when the Scale property is about to change. (Inherited from DataParameter.)
Protected method OnSizeChanged Called when the Size property has changed. (Inherited from DataParameter.)
Protected method OnSizeChanging Called when the Size property is about to change. (Inherited from DataParameter.)
Protected method OnTypeChanged Called when the Type property has changed. (Inherited from DataParameter.)
Protected method OnTypeChanging Called when the Type property is about to change. (Inherited from DataParameter.)
Protected method OnValueChanged Called when the Value property has changed. (Inherited from DataParameter.)
Protected method OnValueChanging Called when the Value property is about to change. (Inherited from DataParameter.)
Public method Parse Gets the DbType and attempts to parts the input string value into the correct type using primitive type conversions (like Byte.Parse and Int32.Parse). (Overrides DataParameter.Parse(String).)
Protected method SetDirectionImpl Sets the direction of the parameter using the DataParameterDirection enumeration. (Overrides DataParameter.SetDirectionImpl(DataParameterDirection).)
Protected method SetNameImpl Sets the name of the parameter. (Overrides DataParameter.SetNameImpl(String).)
Protected method SetPrecisionImpl Sets a byte value specifying the precision of the parameter. (Overrides DataParameter.SetPrecisionImpl(Byte).)
Protected method SetScaleImpl Sets a byte value specifying the scale of the parameter. (Overrides DataParameter.SetScaleImpl(Byte).)
Protected method SetSizeImpl Sets an integer value specifying the size of this parameter. (Overrides DataParameter.SetSizeImpl(Int32).)
Protected method SetTypeImpl Attempts to parse the string type into a DbType enumeration value using Enum.Parse and if this fails it assumes DbType.Object as the correct DbType. (Overrides DataParameter.SetTypeImpl(String).)
Protected method SetValueImpl Sets the value of this parameter. (Overrides DataParameter.SetValueImpl(Object).)
Public method ToString Retrieves a string representation of the value of this parameter. (Inherited from DataParameter.)
Protected method TryConvertValue Attempts to convert the specified value to the specified type. (Inherited from DataParameter.)

Top

Remarks

This class provides a complete managed implementation that will be created by default from the AdoDotNetConnectionSupport class. The base implementation will deal in terms of the DbType enumeration when referencing parameter types. This is less than ideal, so it is recommended that a provider derive their own class from this one that overrides the various methods and properties to more closely represent their back-end-specific types and restrictions.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Data.AdoDotNet Namespace

DataParameter

DbType