Export (0) Print
Expand All
Expand Minimize

DbType Enumeration

Specifies the data type of a field, a property, or a Parameter object of a .NET Framework data provider.

[Visual Basic]
<Serializable>
Public Enum DbType
[C#]
[Serializable]
public enum DbType
[C++]
[Serializable]
__value public enum DbType
[JScript]
public
   Serializable
enum DbType

Remarks

The type of a parameter is specific to the .NET Framework data provider. Specifying the type converts the value of the Parameter to the data provider Type before passing the value to the data source. If the type is not specified, ADO.NET infers the data provider Type of the Parameter from the Value property of the Parameter object.

You can also generically specify the type of a Parameter by setting DbType property of a Parameter object. For more information, see Using Parameters with a DataAdapter.

Members

Member name Description
AnsiString

Supported by the .NET Compact Framework.

A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters.
AnsiStringFixedLength

Supported by the .NET Compact Framework.

A fixed-length stream of non-Unicode characters.
Binary

Supported by the .NET Compact Framework.

A variable-length stream of binary data ranging between 1 and 8,000 bytes.
Note   ADO.NET cannot correctly infer the type if the byte array is larger than 8,000 bytes. Explicitly specify the DbType when working with byte arrays larger than 8,000 bytes.
Boolean

Supported by the .NET Compact Framework.

A simple type representing Boolean values of true or false.
Byte

Supported by the .NET Compact Framework.

An 8-bit unsigned integer ranging in value from 0 to 255.
Currency

Supported by the .NET Compact Framework.

A currency value ranging from -263 (or -922,337,203,685,477.5808) to 2 63 -1 (or +922,337,203,685,477.5807) with an accuracy to a ten-thousandth of a currency unit.
Date

Supported by the .NET Compact Framework.

Date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds.
DateTime

Supported by the .NET Compact Framework.

A type representing a date and time value.
Decimal

Supported by the .NET Compact Framework.

A simple type representing values ranging from 1.0 x 10-28 to approximately 7.9 x 10 28 with 28-29 significant digits.
Double

Supported by the .NET Compact Framework.

A floating point type representing values ranging from approximately 5.0 x 10-324 to 1.7 x 10 308 with a precision of 15-16 digits.
Guid

Supported by the .NET Compact Framework.

A globally unique identifier (or GUID).
Int16

Supported by the .NET Compact Framework.

An integral type representing signed 16-bit integers with values between -32768 and 32767.
Int32

Supported by the .NET Compact Framework.

An integral type representing signed 32-bit integers with values between -2147483648 and 2147483647.
Int64

Supported by the .NET Compact Framework.

An integral type representing signed 64-bit integers with values between -9223372036854775808 and 9223372036854775807.
Object

Supported by the .NET Compact Framework.

A general type representing any reference or value type not explicitly represented by another DbType value.
SByte

Supported by the .NET Compact Framework.

An integral type representing signed 8-bit integers with values between -128 and 127.
Single

Supported by the .NET Compact Framework.

A floating point type representing values ranging from approximately 1.5 x 10-45 to 3.4 x 10 38 with a precision of 7 digits.
String

Supported by the .NET Compact Framework.

A type representing Unicode character strings.
StringFixedLength

Supported by the .NET Compact Framework.

A fixed-length stream of Unicode characters.
Time

Supported by the .NET Compact Framework.

Date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds.
UInt16

Supported by the .NET Compact Framework.

An integral type representing unsigned 16-bit integers with values between 0 and 65535.
UInt32

Supported by the .NET Compact Framework.

An integral type representing unsigned 32-bit integers with values between 0 and 4294967295.
UInt64

Supported by the .NET Compact Framework.

An integral type representing unsigned 64-bit integers with values between 0 and 18446744073709551615.
VarNumeric

Supported by the .NET Compact Framework.

A variable-length numeric value.

Requirements

Namespace: System.Data

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System.Data (in System.Data.dll)

See Also

System.Data Namespace

Show:
© 2014 Microsoft