An Example of Using the Get* Methods phần 2

The GetSql* methods and Sql* types are defined in the namespace, and they are specific to SQL Server. In addition, the GetSql* methods are specific to the SqlDataReader class. Using the GetSql | The GetSql methods and Sql types are defined in the namespace and they are specific to SQL Server. In addition the GetSql methods are specific to the SqlDataReader class. Using the GetSql methods and Sql types helps prevent type conversion errors caused by loss of precision in numeric values. The GetSql methods are also faster than their Get counterparts. This is because the GetSql methods don t need to convert between SQL Server types and the standard C types which the Get methods have to do. Tip If you are using SQL Server always use the GetSql methods and Sql types rather than the Get methods and the standard C types. I showed you the Get methods earlier only because they work with non-SQL Server databases. Table shows the Sql types and the values that may be stored in those types. Table Sql TYPES Sql TYPE VALUES SqlBinary A variable-length string of binary data. SqlBoolean An integer with either a 1 or 0 value. SqlByte An 8-bit unsigned integer value between 0 and 28 - 1 255 . SqlDateTime A date and time between 12 00 00 AM January 1 1753 and 11 59 59 PM December 31 9999. This is accurate to milliseconds. SqlDecimal Fixed precision and scale numeric value between -1038 1 and 1038 - 1. SqlDouble A 64-bit floating-point number between and with 15 significant figures of precision. SqlGuid A 128-bit integer value 16 bytes that that is unique across all computers and networks. SqlInt16 A 16-bit signed integer between -215 -32 768 and 215 - 1 32 767 . SqlInt32 A 32-bit signed integer between-231 -2 147 483 648 and 231 - 1 2 147 483 647 . SqlInt64 A 64-bit signed integer between -263 -9 223 372 036 854 775 808 and 263 - 1 9 223 372 036 854 775 807 . SqlMoney A currency value between -922 337 203 685 and 922 337 203 685 . This is accurate to 1 10 000th of a currency unit. SqlSingle A 32-bit floating-point number between and with seven significant .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU LIÊN QUAN
5    176    1
5    255    1
5    106    0
5    121    1
6    103    1
6    107    1
6    121    1
6    103    0
6    140    0
6    98    0
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.