System. Data. sqltypes namespace

Source: Internet
Author: User
Http://msdn2.microsoft.com/en-us/library/system.data.sqltypes.aspx

System. Data. sqltypes namespace

The System. Data. sqltypes Namespace provides classes for native data types withhin SQL Server 2005. these classes provide a safer, faster alternative to the data types provided by. net Framework Common Language Runtime (CLR ). using the classes in this namespace helps prevent type conversion errors caused by loss of precision. because other data types are converted to and from Sqltypes Behind the scenes, explicitly creating and using objects within this namespace also yields faster code.

Each data type inSqltypesHas its equivalent data type in SQL Server 2005, with the same underlying data representation. Conflict of them also have equivalent data types in the CLR. However,Sqldatetime,Sqldecimal, AndSqlstringHave different underlying data structures with their corresponding. NET Framework data types.

The following table maps the members ofSqltypesNamespace to Microsoft SQL server data types and to the members of the sqldbtype enumeration.

. NET Framework sqltypes

Native SQL Server

. NET Framework sqldbtype

Sqlbinary

Binary, image, timestamp, varbinary

Binary, image, timestamp, varbinary

Sqlboolean

Bit

Bit

Sqlbyte

Tinyint

Tinyint

Sqldatetime

Datetime, smalldatetime

Datetime, smalldatetime

Sqldecimal

Decimal

Decimal

Sqldouble

Float

Float

Sqlguid

Uniqueidentifier

Uniqueidentifier

Sqlint16

Smallint

Smallint

Sqlint32

Int

Int

Sqlint64

Bigint

Bigint

Sqlmoney

Money, smallmoney

Money, smallmoney

Sqlsingle

Real

Real

Sqlstring

Char, nchar, text, ntext, nvarchar, varchar

Char, nchar, text, ntext, nvarchar, varchar

SQLXML

XML

XML

Classes

  Class Description
Sqlalreadyfilledexception The sqlalreadyfilledexception class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Sqlbytes Represents a mutable reference type that wraps either a buffer or a stream.
Sqlchars Sqlchars is a mutable reference type that wraps a char array orSqlstringInstance.
Sqlnotfilledexception The sqlnotfilledexception class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Sqlnullvalueexception The exception that is thrown whenValueProperty ofSystem. Data. sqltypesStructure is set to null.
Sqltruncateexception The exception that is thrown when you set a value intoSystem. Data. sqltypesStructure wocould truncate that value.
Sqltypeexception The base exception class forSystem. Data. sqltypes.
Sqltypesschemaimporterextensionhelper The sqltypesschemaimporterextensionhelper class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
SQLXML Represents XML data stored in or retrieved from a server.
Typebigintschemaimporterextension The typebigintschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typebinaryschemaimporterextension The typebinaryschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typebitschemaimporterextension The typebitschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typecharschemaimporterextension The typecharschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typedatetimeschemaimporterextension The typedatetimeschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typedecimalschemaimporterextension The typedecimalschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typefloatschemaimporterextension The typefloatschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typeintschemaimporterextension The typeintschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typemoneyschemaimporterextension The typemoneyschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typencharschemaimporterextension The typencharschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typentextschemaimporterextension The typentextschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typenumericschemaimporterextension The typenumericschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typenvarcharschemaimporterextension The typenvarcharschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typerealschemaimporterextension The typerealschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typesmalldatetimeschemaimporterextension TheTypesmalldatetimeschemaimporterextensionClass is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typesmallintschemaimporterextension The typesmallintschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typesmallmoneyschemaimporterextension The typesmallmoneyschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typetextschemaimporterextension The typetextschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typetinyintschemaimporterextension The typetinyintschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typeuniqueidentifierschemaimporterextension The typeuniqueidentifierschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typevarbinaryschemaimporterextension The typevarbinaryschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typevarcharschemaimporterextension The typevarcharschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.
Typevarimageschemaimporterextension The typevarimageschemaimporterextension class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality.

Interfaces

  Interface Description
Inullable AllSystem. Data. sqltypesObjects and structures implementInullableInterface.

Structures

  Structure Description
Sqlbinary Represents a variable-length stream of binary data to be stored in or retrieved from a database.
Sqlboolean Represents an integer value that is either 1 or 0 to be stored in or retrieved from a database.
Sqlbyte Represents an 8-bit unsigned integer, in the range of 0 through 255, to be stored in or retrieved from a database.
Sqldatetime Represents the date and time data ranging in value from January 1, 1753 to December 31,999 9 to an accuracy of 3.33 milliseconds to be stored in or retrieved from a database.SqldatetimeStructure has a different underlying data structure from its corresponding. net Framework type, datetime, which can represent any time between 12:00:00 am 1/1/0001 and 11:59:59 PM 12/31/9999, to the accuracy of 100 nanoseconds.SqldatetimeActually stores the relative difference to 00:00:00 am 1/1/1900. Therefore, a conversion from "00:00:00 am 1/1/1900" to an integer will return 0.
Sqldecimal Represents a numeric value between-10 ^ 38 + 1 and 10 ^ 38-1, with fixed precision and scale.
Sqldouble Represents a floating-point number within the range of-1.79e + 308 through 1.79e + 308 to be stored in or retrieved from a database.
Sqlguid Represents a guid to be stored in or retrieved from a database.
Sqlint16 Represents a 16-bit signed integer to be stored in or retrieved from a database.
Sqlint32 Represents a 32-bit signed integer to be stored in or retrieved from a database.
Sqlint64 Represents a 64-bit signed integer to be stored in or retrieved from a database.
Sqlmoney Represents 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 currency unit to be stored in or retrieved from a database.
Sqlsingle Represents a floating point number within the range of-3.40e + 38 through 3.40e + 38 to be stored in or retrieved from a database.
Sqlstring Represents a variable-length stream of characters to be stored in or retrieved from the database.SqlstringHas a different underlying data structure from its corresponding. NET Framework string data type.StringAlways uses the default cultureinfo from the current thread,SqlstringContains its own locale ID and compare flags. The comparison result of twoSqlstringStructures is independent of operating system and current thread locale.

Enumerations

& Lt; Col width = "2%" & gt; & Lt; Col width = "38%" & gt; & Lt; Col width = "60%" & gt;
enumeration description
sqlcompareoptions specifies the Compare option values for a sqlstring structure.
storagestate the storagestate enumeration is not intended for use as a stand-alone component, but as an enumeration from which other classes derive standard functionality.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.