System.Data
1.0.5000.0
2.0.0.0
System.Data.Common.DbParameter
System.ICloneable
System.ComponentModel.TypeConverter("System.Data.Odbc.OdbcParameter+OdbcParameterConverter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
Parameter names are not case sensitive.
When querying an Oracle database using the Microsoft OLE DB Provider for Oracle (MSDAORA) and the ODBC .NET Framework Data Provider, using the LIKE clause to query values in fixed-length fields might not return all expected matches. The reason is that when Oracle matches values for fixed-length fields in a LIKE clause, it matches the entire length of the string, including any padding trailing spaces. For example, if a table in an Oracle database contains a field named "Field1" that is defined as char(3), and you enter the value "a" into a row of that table, the following code will not return the row.
Dim queryString As String = "SELECT * FROM Table1 WHERE Field1 LIKE ?"
Dim command As OleDbCommand = New OleDbCommand(queryString, connection)
command.Parameters.Add("@p1", OleDbType.Char, 3).Value = "a"
Dim reader As OleDbDataReader = command.ExecuteReader()
string queryString = "SELECT * FROM Table1 WHERE Field1 LIKE ?";
OleDbCommand command = new OleDbCommand(queryString, connection);
command.Parameters.Add("@p1", OleDbType.Char, 3).Value = "a";
OleDbDataReader reader = command.ExecuteReader();
This is because Oracle stores the column value as "a " (padding "a", with trailing spaces, to the fixed field length of 3), which Oracle does not treat as a match for the parameter value of "a" in the case of a LIKE comparison of fixed-length fields.
To resolve this problem, append a percentage ("%") wildcard character to the parameter value ("a%"), or use an SQL = comparison instead.
Represents a parameter to an and optionally, its mapping to a . This class cannot be inherited.
Constructor
The base constructor initializes all fields to their default values.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Constructor
To be added.
Initializes a new instance of the class that uses the parameter name and data type.
The name of the parameter.
One of the values.
1.0.5000.0
2.0.0.0
Constructor
Use caution when you are using this overload of the constructor to specify integer parameter values. Because this overload takes a of type , you must convert the integral value to an type when the value is zero, as the following C# example demonstrates.
Parameter = new OdbcParameter("@pname", Convert.ToInt32(0));
If you do not perform this conversion, the compiler assumes that you are trying to call the constructor overload.
Initializes a new instance of the class that uses the parameter name and an object.
The name of the parameter.
An object.
1.0.5000.0
2.0.0.0
Constructor
To be added.
Initializes a new instance of the class that uses the parameter name, data type, and length.
The name of the parameter.
One of the values.
The length of the parameter.
1.0.5000.0
2.0.0.0
Constructor
To be added.
Initializes a new instance of the class that uses the parameter name, data type, length, and source column name.
The name of the parameter.
One of the values.
The length of the parameter.
The name of the source column.
1.0.5000.0
2.0.0.0
Constructor
System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
To be added.
Initializes a new instance of the class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties.
The name of the parameter.
One of the values.
The length of the parameter.
One of the values.
true if the value of the field can be null; otherwise false.
The total number of digits to the left and right of the decimal point to which is resolved.
The total number of decimal places to which is resolved.
The name of the source column.
One of the values.
An that is the value of the .
1.0.5000.0
2.0.0.0
Property
System.Data.DbType
To be added.
The and are linked. Therefore, setting the changes the to a supporting .
For a list of the supported data types, see the appropriate member. For more information, see Using Parameters with a DataAdapter.
is not supported by the Microsoft .NET Framework Data Provider for ODBC.
Gets or sets the of the parameter.
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.Data.ParameterDirection
To be added.
If the is Output, and execution of the associated does not return a value, the will contain a null value. Null values are handled using the class.
Output, InputOut, and ReturnValue parameters returned by calling cannot be accessed until you call or Dispose on the .
Gets or sets a value that indicates whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter.
1.0.5000.0
2.0.0.0
Property
System.Boolean
To be added.
Null values are handled using the class.
Gets or sets a value that indicates whether the parameter accepts null values.
1.0.5000.0
2.0.0.0
Property
System.Data.Common.DbProviderSpecificTypeProperty(true)
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.ComponentModel.DefaultValue(System.Data.Odbc.OdbcType.NChar)
System.Data.Odbc.OdbcType
To be added.
The and are linked. Therefore, setting the changes the to a supporting .
For a list of the supported data types, see the appropriate member. For more information, see Using Parameters with a DataAdapter.
Gets or sets the of the parameter.
1.0.5000.0
2.0.0.0
Property
System.String
To be added.
Instead of named parameters, the ODBC .NET Provider uses positional parameters that are marked with a question mark (?) in the syntax of the command text. Parameter objects in the and the actual parameters accepted by the stored procedure or parameterized SQL statement correspond to each other based on the order in which the objects are inserted into the collection instead of by parameter name. Parameter names can be supplied, but will be ignored during parameter object binding.
Gets or sets the name of the .
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.DefaultValue(0)
System.Byte
To be added.
Setting this property to a value other than the value in the database depends on the implementation of the data provider and may return an error code, truncate, or round data.
The property only affects parameters whose is Decimal or Numeric. For other data types, is ignored.
Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the class that is part of the System namespace prior to assigning a value to the parameter's Value property.
Gets or sets the number of digits used to represent the property.
1.0.5000.0
2.0.0.0
Method
System.Void
When executing a command that includes parameter values, code can either set the type of a parameter explicitly, or the parameter can infer its type from its value. Calling this method resets the parameter so that it can again infer its type from the value passed in the parameter. Calling this method affects both the and properties of the .
Calling resets to its default value (String).
Resets the type associated with this .
2.0.0.0
Method
2.0.0.0
System.Void
When executing a command that includes parameter values, code can either set the type of a parameter explicitly, or the parameter can infer its type from its value. Calling this method resets the parameter so that it can again infer its type from the value passed in the parameter. Calling this method affects both the and properties of the .
Resets the type associated with this .
Property
System.ComponentModel.DefaultValue(0)
System.Byte
To be added.
The property is used only for decimal and numeric input parameters.
The effect of setting this property to a value other than the value in the database depends on the implementation of the data provider and may return an error code, or truncate or round data.
The property only affects parameters whose is Decimal or Numeric. For other data types, is ignored.
When using SQL Server Native Client 10 (or later) to bind a parameter whose type is Decimal, Numeric, VarNumeric, DBDate, or DBTimeStamp, you must manually specify an appropriate Scale value.
Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the class that is part of the System namespace prior to assigning a value to the parameter's Value property.
.NET Framework data providers that are included with the .NET Framework version 1.0 do not verify the scale of parameter values. This can cause modified data being inserted at the data source. If you are using .NET Framework version 1.0, validate the scale of decimal values before setting the parameter value. When you use .NET Framework version 1.1 or later versions, scale values that exceed the decimal parameter scale might only be truncated in scale, if that is the behavior of the underlying ODBC driver.
Gets or sets the number of decimal places to which is resolved.
1.0.5000.0
2.0.0.0
Property
System.Int32
To be added.
The property is used for binary and string types.
For nonstring data types and ANSI string data, the property refers to the number of bytes. For Unicode string data, refers to the number of characters. The count for strings does not include the terminating character.
For variable-length data types, Size describes the maximum amount of data to transmit to the server. For example, for a Unicode string value, Size could be used to limit the amount of data sent to the server to the first one hundred characters.
For bidirectional and output parameters, and return values, you must set the value of Size. This is not required for input parameters, and if not explicitly set, the value of is inferred from the actual size of the specified parameter when a parameterized statement is executed.
The , , and properties of a parameter can be inferred by setting . Therefore, you are not required to specify them. However, they are not exposed in property settings. For example, if the size of the parameter has been inferred, Size does not contain inferred value after statement execution.
For an OdbcParameter with a of ParameterDirection.Output, ParameterDirection.InputOutput, or ParameterDirection.ReturnValue, an exception is thrown when the command is executed if the size of the value returned by the data source exceeds the specified Size of the .
For fixed-length data types, the value of Size is ignored. It can be retrieved for informational purposes, and returns the maximum amount of bytes the provider uses when transmitting the value of the parameter to the server.
Gets or sets the maximum size of the data within the column.
1.0.5000.0
2.0.0.0
Property
System.String
To be added.
When is set to anything other than an empty string, the value of the parameter is retrieved from the column with the SourceColumn name. If is set to Input, the value is taken from the . If Direction is set to Output, the value is taken from the data source. A Direction of InputOutput is a combination of both.
For more information about how to use the property, see Using Parameters with a DataAdapter and Updating the Database with a DataAdapter and the DataSet.
Gets or sets the name of the source column mapped to the and used for loading or returning the .
1.0.5000.0
2.0.0.0
Property
System.Boolean
To be added.
is used by the to correctly generate update commands when dealing with nullable columns. Generally, use of is limited to developers inheriting from .
uses this property to determine whether the source column is nullable, and sets this property to true if it is nullable, and false if it is not. When is generating its Update statement, it examines the for each parameter. If the property is true, generates a WHERE clauses like the following example. In this query expression, "FieldName" represents the name of the field:
((@IsNull_FieldName = 1 AND FieldName IS NULL) OR
(FieldName = @Original_FieldName))
If for the field is false, generates the following WHERE clause:
FieldName = @OriginalFieldName
In addition, @IsNull_FieldName contains 1 if the source field contains null, and 0 if it does not. This mechanism allows for a performance optimization in SQL Server, and provides for common code that works across multiple providers.
Sets or gets a value which indicates whether the source column is nullable. This lets correctly generate Update statements for nullable columns.
2.0.0.0
Property
System.Data.DataRowVersion
To be added.
The SourceVersion is used by during an operation to determine whether the parameter value is set to Current or Original. This allows primary keys to be updated.
This property is set to the version of the used by either the Item property (DataRow indexer), or the method.
Gets or sets the to use when you load .
1.0.5000.0
2.0.0.0
Method
1.0.5000.0
2.0.0.0
System.Object
This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
For a description of this member, see .
A new that is a copy of this instance.
Method
System.String
To be added.
Gets a string that contains the .
A string that contains the .
1.0.5000.0
2.0.0.0
Property
System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))
System.Object
To be added.
For input parameters, the value is bound to the that is sent to the server. For output and return-value parameters, the value is set on completion of the and after the is closed.
When you send a null parameter value to the server, the user must specify , not null. A null value in the system is an empty object that has no value. is used to represent null values. If the parameter is used to call a stored procedure with parameters that have default values, setting to null causes the default value to be used.
If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. The provider tries to convert any type of value if it supports the interface. Conversion errors may result if the specified type is not compatible with the value.
Both the and properties can be inferred by setting . If applicable, the size, precision, and scale is also inferred from when the parameterized statement is executed. However, inferred values are not exposed to the user.
The property is overwritten by the Update method.
Gets or sets the value of the parameter.
1.0.5000.0
2.0.0.0