FieldUtils

Overview

The FieldUtils class is a static helper class that provides methods to convert .NET types to corresponding Data Abstract for .NET types or enumerations. Such conversions are needed to map the .NET types to corresponding serializable types used by the Data Abstract for .NET.

For internal use only.

Location

 

CanConvertTypeToDataType

Returns true if provided .NET type can be successfully mapped to one of the DataType types supported by the Data Abstract for .NET

 

class method CanConvertTypeToDataType(databaseType: Type; isAutoIncrement: Boolean): Boolean

 

static Boolean CanConvertTypeToDataType(Type databaseType, Boolean isAutoIncrement)

 

Shared Function CanConvertTypeToDataType(databaseType As Type, isAutoIncrement As Boolean) As Boolean

Parameters:

  • databaseType:
  • isAutoIncrement: Flag that denotes if the aType .NET type should be processed as an auto-incement type

DataParamDirectionToRoParamDirection

 

class method DataParamDirectionToRoParamDirection(direction: ParameterDirection): ParameterDirection

 

static ParameterDirection DataParamDirectionToRoParamDirection(ParameterDirection direction)

 

Shared Function DataParamDirectionToRoParamDirection(direction As ParameterDirection) As ParameterDirection

Parameters:

  • direction:

DataTypeNeedsSize

Returns true if Data Abstract for .NET requres data size to be set for Schema Fields and Schema Parameters of type aDataType. Data size is required by ADO.NET or underlying database access drives to proprly process ADO.NET command parameters.

Currently field size is required for the fields and parameters of type DataType, DataType, DataType and DataType.

 

class method DataTypeNeedsSize(aDataType: DataType): Boolean

 

static Boolean DataTypeNeedsSize(DataType aDataType)

 

Shared Function DataTypeNeedsSize(aDataType As DataType) As Boolean

Parameters:

  • aDataType: Data type to check

DataTypeToDbType

Returns the DbType value corresponding to the provided DataType value.

This method raises an exception if it is not possible to map the provided DataType value.

 

class method DataTypeToDbType(aDataType: DataType): DbType

 

static DbType DataTypeToDbType(DataType aDataType)

 

Shared Function DataTypeToDbType(aDataType As DataType) As DbType

Parameters:


DataTypeToType

Returns true if provided .NET type can be successfully mapped to one of the DataType types supported by the Data Abstract for .NET.

Argument aDataType will contain mapped DataType value.

 

class method DataTypeToType(dataType: DataType): Type

 

static Type DataTypeToType(DataType dataType)

 

Shared Function DataTypeToType(dataType As DataType) As Type

Parameters:


DbTypeToDataType

Returns the DataType value corresponding to the provided DbType value.

This method raises an exception if it is not possible to map the provided DataType value.

 

class method DbTypeToDataType(aDbType: DbType): DataType

 

static DataType DbTypeToDataType(DbType aDbType)

 

Shared Function DbTypeToDataType(aDbType As DbType) As DataType

Parameters:

  • aDbType: DbType value to convert

GetColumnSize

Returns the maximal length of the data in the provided aColumn column.

Always returns 38 for columns of type System.Guid.

 

class method GetColumnSize(aColumn: DataColumn): Int32

 

static Int32 GetColumnSize(DataColumn aColumn)

 

Shared Function GetColumnSize(aColumn As DataColumn) As Int32

Parameters:

  • aColumn: Data column

IsNumericType

 

class method IsNumericType(type: DataType): Boolean

 

static Boolean IsNumericType(DataType type)

 

Shared Function IsNumericType(type As DataType) As Boolean

Parameters:

  • type:

RoParamDirectionToDataParamDirection

 

class method RoParamDirectionToDataParamDirection(direction: ParameterDirection): ParameterDirection

 

static ParameterDirection RoParamDirectionToDataParamDirection(ParameterDirection direction)

 

Shared Function RoParamDirectionToDataParamDirection(direction As ParameterDirection) As ParameterDirection

Parameters:

  • direction:

TryConvertTypeToDataType

Returns true if provided .NET type can be successfully mapped to one of the DataType types supported by the Data Abstract for .NET.

Argument aDataType will contain mapped DataType value.

 

class method TryConvertTypeToDataType(databaseType: Type; isAutoIncrement: Boolean; out schemaDataType: DataType): Boolean

 

static Boolean TryConvertTypeToDataType(Type databaseType, Boolean isAutoIncrement, out DataType schemaDataType)

 

Shared Function TryConvertTypeToDataType(databaseType As Type, isAutoIncrement As Boolean, <OutAttribute> ByRef schemaDataType As DataType) As Boolean

Parameters:

  • databaseType: .NET type to convert
  • isAutoIncrement: Flag that denotes if the aType .NET type should be processed as an auto-incement type
  • schemaDataType: If the method returns true then this argument will contain the result of the aType .NET type conversion

TypeToDataType

Convert the provided aType .NET type to corresponding DataType type.

This method raises an exception if the provided .NET type cannot be mapped to a DataType type.

 

class method TypeToDataType(aType: Type; IsAutoIncrement: Boolean): DataType

 

static DataType TypeToDataType(Type aType, Boolean IsAutoIncrement)

 

Shared Function TypeToDataType(aType As Type, IsAutoIncrement As Boolean) As DataType

Parameters:

  • aType: .NET type to convert
  • IsAutoIncrement: Flag that denotes if the aType .NET type should be processed as an auto-incement type

UnionSourceTableFieldName

 

const UnionSourceTableFieldName: String = "@SourceTable";

 

const String UnionSourceTableFieldName = "@SourceTable"

 

Dim UnionSourceTableFieldName As String = "@SourceTable"

 

UnionSourceTableFieldName

 

const UnionSourceTableFieldName: String = "@SourceTable";

 

const String UnionSourceTableFieldName = "@SourceTable"

 

Dim UnionSourceTableFieldName As String = "@SourceTable"

 

CanConvertTypeToDataType

Returns true if provided .NET type can be successfully mapped to one of the DataType types supported by the Data Abstract for .NET

 

class method CanConvertTypeToDataType(databaseType: Type; isAutoIncrement: Boolean): Boolean

 

static Boolean CanConvertTypeToDataType(Type databaseType, Boolean isAutoIncrement)

 

Shared Function CanConvertTypeToDataType(databaseType As Type, isAutoIncrement As Boolean) As Boolean

Parameters:

  • databaseType:
  • isAutoIncrement: Flag that denotes if the aType .NET type should be processed as an auto-incement type

DataParamDirectionToRoParamDirection

 

class method DataParamDirectionToRoParamDirection(direction: ParameterDirection): ParameterDirection

 

static ParameterDirection DataParamDirectionToRoParamDirection(ParameterDirection direction)

 

Shared Function DataParamDirectionToRoParamDirection(direction As ParameterDirection) As ParameterDirection

Parameters:

  • direction:

DataTypeNeedsSize

Returns true if Data Abstract for .NET requres data size to be set for Schema Fields and Schema Parameters of type aDataType. Data size is required by ADO.NET or underlying database access drives to proprly process ADO.NET command parameters.

Currently field size is required for the fields and parameters of type DataType, DataType, DataType and DataType.

 

class method DataTypeNeedsSize(aDataType: DataType): Boolean

 

static Boolean DataTypeNeedsSize(DataType aDataType)

 

Shared Function DataTypeNeedsSize(aDataType As DataType) As Boolean

Parameters:

  • aDataType: Data type to check

DataTypeToDbType

Returns the DbType value corresponding to the provided DataType value.

This method raises an exception if it is not possible to map the provided DataType value.

 

class method DataTypeToDbType(aDataType: DataType): DbType

 

static DbType DataTypeToDbType(DataType aDataType)

 

Shared Function DataTypeToDbType(aDataType As DataType) As DbType

Parameters:


DataTypeToType

Returns true if provided .NET type can be successfully mapped to one of the DataType types supported by the Data Abstract for .NET.

Argument aDataType will contain mapped DataType value.

 

class method DataTypeToType(dataType: DataType): Type

 

static Type DataTypeToType(DataType dataType)

 

Shared Function DataTypeToType(dataType As DataType) As Type

Parameters:


DbTypeToDataType

Returns the DataType value corresponding to the provided DbType value.

This method raises an exception if it is not possible to map the provided DataType value.

 

class method DbTypeToDataType(aDbType: DbType): DataType

 

static DataType DbTypeToDataType(DbType aDbType)

 

Shared Function DbTypeToDataType(aDbType As DbType) As DataType

Parameters:

  • aDbType: DbType value to convert

GetColumnSize

Returns the maximal length of the data in the provided aColumn column.

Always returns 38 for columns of type System.Guid.

 

class method GetColumnSize(aColumn: DataColumn): Int32

 

static Int32 GetColumnSize(DataColumn aColumn)

 

Shared Function GetColumnSize(aColumn As DataColumn) As Int32

Parameters:

  • aColumn: Data column

IsNumericType

 

class method IsNumericType(type: DataType): Boolean

 

static Boolean IsNumericType(DataType type)

 

Shared Function IsNumericType(type As DataType) As Boolean

Parameters:

  • type:

RoParamDirectionToDataParamDirection

 

class method RoParamDirectionToDataParamDirection(direction: ParameterDirection): ParameterDirection

 

static ParameterDirection RoParamDirectionToDataParamDirection(ParameterDirection direction)

 

Shared Function RoParamDirectionToDataParamDirection(direction As ParameterDirection) As ParameterDirection

Parameters:

  • direction:

TryConvertTypeToDataType

Returns true if provided .NET type can be successfully mapped to one of the DataType types supported by the Data Abstract for .NET.

Argument aDataType will contain mapped DataType value.

 

class method TryConvertTypeToDataType(databaseType: Type; isAutoIncrement: Boolean; out schemaDataType: DataType): Boolean

 

static Boolean TryConvertTypeToDataType(Type databaseType, Boolean isAutoIncrement, out DataType schemaDataType)

 

Shared Function TryConvertTypeToDataType(databaseType As Type, isAutoIncrement As Boolean, <OutAttribute> ByRef schemaDataType As DataType) As Boolean

Parameters:

  • databaseType: .NET type to convert
  • isAutoIncrement: Flag that denotes if the aType .NET type should be processed as an auto-incement type
  • schemaDataType: If the method returns true then this argument will contain the result of the aType .NET type conversion

TypeToDataType

Convert the provided aType .NET type to corresponding DataType type.

This method raises an exception if the provided .NET type cannot be mapped to a DataType type.

 

class method TypeToDataType(aType: Type; IsAutoIncrement: Boolean): DataType

 

static DataType TypeToDataType(Type aType, Boolean IsAutoIncrement)

 

Shared Function TypeToDataType(aType As Type, IsAutoIncrement As Boolean) As DataType

Parameters:

  • aType: .NET type to convert
  • IsAutoIncrement: Flag that denotes if the aType .NET type should be processed as an auto-incement type