ComponentOne DataObjects for .NET
NativeDbType Property (Field)

C1.Data.2 Assembly > C1.Data.SchemaObjects Namespace > Field Class : NativeDbType Property
Gets or sets the field data type as a native data type of the underlying database.
Syntax
'Declaration
 
Public Overridable Property NativeDbType As System.Integer
public virtual System.int NativeDbType {get; set;}
Remarks
NativeDbType contains the numeric value corresponding to one of the values of the enumerated type describing all possible data types for the database access provider. These enumerations are:

for OleDb: System.Data.OleDb.OleDbType,

for SqlServer: System.Data.SqlDbType,

for Oracle: Oracle.DataAccess.Client.OracleDbType,

for MSOracle: System.Data.OracleClient.OracleType,

for others (Custom): enumeration type is specified in the CustomProviderInfo.NativeTypeTypeName property.

This property is used for database update, to specify the type of command parameters containing field values that are written to the database. Sometimes it is essential to specify the type for database update more exactly than it can be inferred from the .NET type of the field (from DataType). For example, DataType = String can be further specialized to be a Unicode or ASCII string. When you create a schema importing it from database structure, Field.NativeDbType is automatically set to the actual type of the database field. In those rare cases when you need to change it, you can set the Field.NativeDbType property to a specific native type you need, or you can use Field.NativeDbType = Any (-1) to indicate that inferring parameter type from DataType is good enough (or not needed at all, as, for example, in calculated fields).

See Also

Reference

Field Class
Field Members