.NET Framework Class Library DbType Enumeration Specifies the data type of a field, a property, or a Parameter object of a .NET Framework data provider.
Namespace:
System.Data
Assembly:
System.Data (in System.Data.dll)

Syntax
Public Enumeration DbType

Members
| Member name | Description |
|---|
.gif) | AnsiString | A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters. | .gif) | Binary | A variable-length stream of binary data ranging between 1 and 8,000 bytes. | .gif) | Byte | An 8-bit unsigned integer ranging in value from 0 to 255. | .gif) | Boolean | A simple type representing Boolean values of true or false. | .gif) | Currency | A currency value ranging from -2 63 (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. | .gif) | Date | A type representing a date value. | .gif) | DateTime | A type representing a date and time value. | .gif) | Decimal | A simple type representing values ranging from 1.0 x 10 -28 to approximately 7.9 x 10 28 with 28-29 significant digits. | .gif) | Double | 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. | .gif) | Guid | A globally unique identifier (or GUID). | .gif) | Int16 | An integral type representing signed 16-bit integers with values between -32768 and 32767. | .gif) | Int32 | An integral type representing signed 32-bit integers with values between -2147483648 and 2147483647. | .gif) | Int64 | An integral type representing signed 64-bit integers with values between -9223372036854775808 and 9223372036854775807. | .gif) | Object | A general type representing any reference or value type not explicitly represented by another DbType value. | .gif) | SByte | An integral type representing signed 8-bit integers with values between -128 and 127. | .gif) | Single | 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. | .gif) | String | A type representing Unicode character strings. | .gif) | Time | A type representing a SQL Server DateTime value. If you want to use a SQL Server time value, use Time. | .gif) | UInt16 | An integral type representing unsigned 16-bit integers with values between 0 and 65535. | .gif) | UInt32 | An integral type representing unsigned 32-bit integers with values between 0 and 4294967295. | .gif) | UInt64 | An integral type representing unsigned 64-bit integers with values between 0 and 18446744073709551615. | .gif) | VarNumeric | A variable-length numeric value. | .gif) | AnsiStringFixedLength | A fixed-length stream of non-Unicode characters. | .gif) | StringFixedLength | A fixed-length string of Unicode characters. | .gif) | Xml | A parsed representation of an XML document or fragment. | .gif) | DateTime2 | Date and time data. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. | .gif) | DateTimeOffset | Date and time data with time zone awareness. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. Time zone value range is -14:00 through +14:00. |

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. ADO.NET cannot correctly infer the type if a byte array is larger than 8,000 bytes. Explicitly specify the DbType when working with byte arrays larger than 8,000 bytes.

Version Information
.NET FrameworkSupported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client ProfileSupported in: 4, 3.5 SP1

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also
|
Biblioteca de clases de .NET Framework DbType (Enumeración) Especifica el tipo de datos de un campo, una propiedad o un objeto Parameter de un proveedor de datos de .NET Framework.
Espacio de nombres:
System.Data
Ensamblado:
System.Data (en System.Data.dll)

Sintaxis
Public Enumeration DbType

Miembros
| Nombre de miembro | Descripción |
|---|
.gif) | AnsiString | Secuencia de longitud variable de caracteres no Unicode comprendida entre 1 y 8.000 caracteres. | .gif) | Binary | Secuencia de longitud variable de datos binarios comprendida entre 1 y 8.000 bytes. | .gif) | Byte | Entero de 8 bits sin signo cuyo valor está comprendido entre 0 y 255. | .gif) | Boolean | Tipo simple que representa los valores booleanos true o false. | .gif) | Currency | Valor de moneda comprendido entre -2 63 (o -922,337,203,685,477.5808) y 2 63 -1 (o +922,337,203,685,477.5807), con una precisión de una diezmilésima de unidad de moneda. | .gif) | Date | Tipo que representa un valor de fecha. | .gif) | DateTime | Tipo que representa un valor de fecha y hora. | .gif) | Decimal | Tipo simple que representa los valores comprendidos entre 1,0 x 10 -28 y aproximadamente 7,9 x 10 28, con 28-29 dígitos significativos. | .gif) | Double | Tipo de punto flotante que representa los valores comprendidos entre aproximadamente 5,0 x 10 -324 y 1,7 x 10 308, con una precisión de 15-16 dígitos. | .gif) | Guid | Identificador único global (GUID). | .gif) | Int16 | Tipo integral que representa enteros de 16 bits con signo con valores comprendidos entre -32768 y 32767. | .gif) | Int32 | Tipo integral que representa enteros de 32 bits con signo con valores comprendidos entre -2147483648 y 2147483647. | .gif) | Int64 | Tipo integral que representa enteros de 64 bits con signo con valores comprendidos entre -9223372036854775808 y 9223372036854775807. | .gif) | Object | Tipo general que representa cualquier tipo de valor o referencia no representado de forma explícita por otro valor DbType. | .gif) | SByte | Tipo integral que representa enteros de 8 bits con signo con valores comprendidos entre -128 y 127. | .gif) | Single | Tipo de punto flotante que representa los valores comprendidos entre aproximadamente 1,5 x 10 -45 y 3,4 x 10 38, con una precisión de 7 dígitos. | .gif) | String | Tipo que representa cadenas de caracteres Unicode. | .gif) | Time | Tipo que representa un valor DateTime de SQL Server. Si desea utilizar un valor time de SQL Server, use Time. | .gif) | UInt16 | Tipo integral que representa enteros de 16 bits sin signo con valores comprendidos entre 0 y 65535. | .gif) | UInt32 | Tipo integral que representa enteros de 32 bits sin signo con valores comprendidos entre 0 y 4294967295. | .gif) | UInt64 | Tipo integral que representa enteros de 64 bits sin signo con valores comprendidos entre 0 y 18446744073709551615. | .gif) | VarNumeric | Valor numérico de longitud variable. | .gif) | AnsiStringFixedLength | Secuencia de longitud fija de caracteres no Unicode. | .gif) | StringFixedLength | Cadena de longitud fija de caracteres Unicode. | .gif) | Xml | Representación analizada de un documento o fragmento XML. | .gif) | DateTime2 | Datos de fecha y hora. El intervalo de valores de fecha comprende desde el 1 de enero de 1 d.C. hasta el 31 de diciembre de 9999 d.C. El intervalo de valor horario está comprendido entre 00:00:00 y 23:59:59,9999999 con una precisión de 100 nanosegundos. | .gif) | DateTimeOffset | Datos de fecha y hora con conocimiento de la zona horaria. El intervalo de valores de fecha comprende desde el 1 de enero de 1 d.C. hasta el 31 de diciembre de 9999 d.C. El intervalo de valor horario está comprendido entre 00:00:00 y 23:59:59,9999999 con una precisión de 100 nanosegundos. El intervalo horario es -14: 00 hasta +14:00. |

Comentarios
El tipo de un parámetro es específico del proveedor de datos de .NET Framework. Al especificar el tipo, el valor de Parameter se convierte en el tipo del proveedor de datos de .NET Framework antes de pasar el valor al origen de datos. Si no se especifica el tipo, ADO.NET deduce el tipo de proveedor de datos del Parameter a partir de la propiedad Value del objeto Parameter. También se puede especificar de forma genérica el tipo de un Parameter estableciendo la propiedad DbType de un objeto Parameter. ADO.NET no puede inferir correctamente el tipo si una matriz de bytes tiene más de 8.000 bytes. Especifique de forma explícita el DbType al trabajar con matrices de bytes que tengan más de 8.000 bytes.

Información de versión
.NET FrameworkCompatible con: 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client ProfileCompatible con: 4, 3.5 SP1

Plataformas
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Vea también
|