Class MySqlParameter
Represents a parameter to a My
Inheritance
Implements
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data.dll
Version: 9.2.0
Syntax
[TypeConverter(typeof(MySqlParameterConverter))]
public sealed class MySqlParameter : DbParameter, IDbDataParameter, IDataParameter, ICloneable
Remarks
Parameter names are not case sensitive. You can read more about it here.
Constructors
MySqlParameter()
Declaration
public MySqlParameter()
MySqlParameter(String, MySqlDbType)
Initializes a new instance of the My
Declaration
public MySqlParameter(string parameterName, MySqlDbType dbType)
Parameters
Type | Name | Description |
---|---|---|
System. |
parameterName | The name of the parameter to map. |
My |
dbType | One of the My |
MySqlParameter(String, MySqlDbType, Int32)
Initializes a new instance of the My
Declaration
public MySqlParameter(string parameterName, MySqlDbType dbType, int size)
Parameters
Type | Name | Description |
---|---|---|
System. |
parameterName | The name of the parameter to map. |
My |
dbType | One of the My |
System. |
size | The length of the parameter. |
MySqlParameter(String, MySqlDbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)
Initializes a new instance of the My
Declaration
public MySqlParameter(string parameterName, MySqlDbType dbType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
parameterName | The name of the parameter to map. |
My |
dbType | One of the My |
System. |
size | The length of the parameter. |
System. |
direction | One of the System. |
System. |
isNullable | true if the value of the field can be null, otherwise false. |
System. |
precision | The total number of digits to the left and right of the decimal point to which Value is resolved. |
System. |
scale | The total number of decimal places to which Value is resolved. |
System. |
sourceColumn | The name of the source column. |
System. |
sourceVersion | One of the System. |
System. |
value | An System. |
Exceptions
Type | Condition |
---|---|
System. |
MySqlParameter(String, MySqlDbType, Int32, String)
Initializes a new instance of the My
Declaration
public MySqlParameter(string parameterName, MySqlDbType dbType, int size, string sourceColumn)
Parameters
Type | Name | Description |
---|---|---|
System. |
parameterName | The name of the parameter to map. |
My |
dbType | One of the My |
System. |
size | The length of the parameter. |
System. |
sourceColumn | The name of the source column. |
MySqlParameter(String, Object)
Initializes a new instance of the My
Declaration
public MySqlParameter(string parameterName, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
parameterName | The name of the parameter to map. |
System. |
value | An System. |
Properties
DbType
Gets or sets the Db
Declaration
public override DbType DbType { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
Direction
Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. As of MySql version 4.1 and earlier, input-only is the only valid choice.
Declaration
public override ParameterDirection Direction { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
IsNullable
Gets or sets a value indicating whether the parameter accepts null values.
Declaration
[Browsable(false)]
public override bool IsNullable { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
MySqlDbType
Gets or sets the My
Declaration
[DbProviderSpecificTypeProperty(true)]
public MySqlDbType MySqlDbType { get; set; }
Property Value
Type | Description |
---|---|
My |
ParameterName
Declaration
public override string ParameterName { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
PossibleValues
Returns the possible values for this parameter if this parameter is of type SET or ENUM. Returns null otherwise.
Declaration
public IList PossibleValues { get; }
Property Value
Type | Description |
---|---|
System. |
Precision
Gets or sets the maximum number of digits used to represent the Value property.
Declaration
public override byte Precision { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
Scale
Gets or sets the number of decimal places to which Value is resolved.
Declaration
public override byte Scale { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
Size
Gets or sets the maximum size, in bytes, of the data within the column.
Declaration
public override int Size { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
SourceColumn
Gets or sets the name of the source column that is mapped to the System.
Declaration
public override string SourceColumn { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
SourceColumnNullMapping
Sets or gets a value which indicates whether the source column is nullable.
This allows System.
Declaration
public override bool SourceColumnNullMapping { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
SourceVersion
Gets or sets the System.
Declaration
public override DataRowVersion SourceVersion { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
Value
Gets or sets the value of the parameter.
Declaration
[TypeConverter(typeof(StringConverter))]
public override object Value { get; set; }
Property Value
Type | Description |
---|---|
System. |
Overrides
Methods
Clone()
Clones this object.
Declaration
public MySqlParameter Clone()
Returns
Type | Description |
---|---|
My |
An object that is a clone of this object. |
ResetDbType()
Resets the DbType property to its original settings.
Declaration
public override void ResetDbType()
Overrides
ToString()
Overridden. Gets a string containing the Parameter
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |
Overrides
Explicit Interface Implementations
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
System. |