The SqlDataReader Class

The SqlDataReader Class You use an object of the SqlDataReader class to read rows retrieved from a SQL Server database, an object of the OleDbDataReader class to read rows from any database that supports OLE DB | The SqlDataReader Class You use an object of the SqlDataReader class to read rows retrieved from a SQL Server database an object of the OleDbDataReader class to read rows from any database that supports OLE DB such as Oracle or Access and an object of the OdbcDataReader class to read rows from any data-base that supports ODBC. Table shows some of the SqlDataReader properties. Table SqlDataReader PROPERTIES PROPERTY TYPE DESCRIPTION Depth int Gets a value indicating the depth of nesting for the current row. FieldCount int Gets the number of columns in the current row. IsClosed bool Gets a bool value indicating whether the data reader is closed. RecordsAffected int Gets the number of rows added modified or removed by execution of the SQL statement. Note Although the SqlDataReader class is specific to SQL Server many of the properties and methods in this class are the same as those for the OleDbDataReader and OdbcDataReader classes. Table shows some of the public SqlDataReader methods. Table SqlDataReader METHODS METHOD RETURN TYPE DESCRIPTION GetBoolean bool Returns the value of the specified column as a bool. GetByte byte Returns the value of the specified column as a byte. GetBytes long Reads a stream of byte values from the specified column into a byte array. The long value returned is the number of byte values read from the column. GetChar char Returns the value of the specified column as a char. GetChars long Reads a stream of char values from the specified column into a char array. The long value returned is the number of char values read from the column. GetDataTypeName string Returns the name of the source data type for the specified column. GetDateTime DateTime Returns the value of the specified column as a DateTime. Table SqlDataReader METHODS METHOD RETURN TYPE DESCRIPTION GetDecimal decimal Returns the value of the specified column as a decimal. GetDouble double Returns the value of the specified column as a double. GetFieldType Type .

Bấm vào đây để xem trước nội dung
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.