Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

OracleParameter.Size Property

Gets or sets the maximum size, in bytes, of the data within the column.

Namespace: System.Data.OracleClient
Assembly: System.Data.OracleClient (in system.data.oracleclient.dll)

public override int Size { get; set; }
/** @property */
public int get_Size ()

/** @property */
public void set_Size (int value)

public override function get Size () : int

public override function set Size (value : int)

Not applicable.

Property Value

The maximum size, in bytes, of the data within the column. The default value is 0 (to be used when you do not want to specify the maximum size of the value).

Setting Size affects only the input value of a parameter. Return values and output parameters are not affected by this property.

The Size property is used for binary and string types.

For nonstring data types and ANSI string data, the Size property refers to the number of bytes. For Unicode string data, Size 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 DbType, OracleType, and Size properties of a parameter can be inferred by setting Value. Therefore, you are not required to specify them. However, they are not exposed in OracleParameter property settings. For example, if the size of the parameter has been inferred, Size does not contain inferred value after statement execution.

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.

The following example creates a OracleParameter and sets some of its properties.

public void CreateOracleParameter() 
{
   OracleParameter parameter = new OracleParameter("pDescription", OracleType.VarChar);
   parameter.IsNullable = true;
   parameter.Direction = ParameterDirection.Output;
   parameter.Size = 88;
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.