The Schema collections return metadata for the Advanced SQL Engine objects. The notable metadata columns for the Byte data type are:
Column Name | Description |
---|---|
COLUMN_TYPE or DATA_TYPE |
Set to BYTE. |
CHARACTER_OCTET_LENGTH | Returns length of the column in Bytes. |
PROVIDERDBTYPE | It is set to TdType.Byte. |
The TdDataReader.SchemaTable returns result set metadata. The notable metadata columns for the Byte data type are:
Column Name | Description |
---|---|
ColumnSize | Returns length of the column in Bytes. |
DataType | System.Type object for the System.Byte[] type. |
ProviderType | Set to TdType.Byte. |
Format | Format assigned to the SQL Engine object. |
ProviderSpecificDataType | System.Type object for the System.Byte[] class. |
The following example shows how to configure a Byte parameter using TdType type declaration and a BCL value. The value is set to a System.Byte[] instance.
C# |
Copy Code |
---|---|
TdParameter customerPicture = new TdParameter(); customerPicture.ParameterName = "customerPicture"; customerPicture.TdType = TdType.Byte; customerPicture.Value = pictureBuffer; |
The TdParameter.Value must be set to an Array of Bytes (Byte[]).
![]() |
---|
The Data Provider will zero-fill the data when the length of the input parameter value is less than the TdParameter.Size property value. |
The TdParameter.Size property must be set to a number greater than Zero for InputOutput or Output Parameters. The Data Provider will throw an exception when TdParameter.Direction property is set to ParameterDirection.Output or ParameterDirection.InputOutput and TdParameter.Size property is set to Zero. The TdParameter.Size property specifies the number of Bytes the Data Provider will send to the SQL Engine and/or receive from the SQL Engine. We recommend to set the TdParameter.Size property to the corresponding SQL Engine object size (e.g. Column or Stored Procedure Parameter size) for Input, InputOutput or Output parameters.
![]() |
---|
The Data Provider will truncate the data when the TdParameter.Size property value is less than the length of the Data received from the SQL Engine. |
![]() |
---|
TdParameter.Size is not required for Input parameters. However it will improve the overall performance of Batch Updates. Therefore the general guideline is to always set the TdParameter.Size property. |
The syntax for the BYTE Literal is 'hexadecimal digits'XBF. For example 'C1C0'XBF declares a BYTE(2) literals; the first byte is set to C1 and and the second byte is set to C0.
![]() |
---|
We recommend to always use Parameters in order to take advantage of the SQL Engine's Request Cache. |
The following methods and properties return the column or parameter value as a System.Byte[] object.
The following methods return the column or parameter value as a System.Stream object.
Accessor Methods for Retrieving Data
Configuring Parameters and Parameter Data Types