C# Класс Mono.Data.Sqlite.SqliteDataReader

SQLite implementation of DbDataReader.
Наследование: System.Data.Common.DbDataReader
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.

GetBoolean ( int i ) : bool

Retrieves the column as a boolean value

GetByte ( int i ) : byte

Retrieves the column as a single byte value

GetBytes ( int i, long fieldOffset, byte buffer, int bufferoffset, int length ) : long

Retrieves a column as an array of bytes (blob)

To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned.

GetChar ( int i ) : char

Returns the column as a single character

GetChars ( int i, long fieldoffset, char buffer, int bufferoffset, int length ) : long

Retrieves a column as an array of chars (blob)

To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned.

GetDataTypeName ( int i ) : string

Retrieves the name of the back-end datatype of the column

GetDateTime ( int i ) : System.DateTime

Retrieve the column as a date/time value

GetDecimal ( int i ) : decimal

Retrieve the column as a decimal value

GetDouble ( int i ) : double

Returns the column as a double

GetEnumerator ( ) : System.Collections.IEnumerator

Enumerator support

GetFieldType ( int i ) : Type

Returns the .NET type of a given column

GetFloat ( int i ) : float

Returns a column as a float value

GetGuid ( int i ) : System.Guid

Returns the column as a Guid

GetInt16 ( int i ) : Int16

Returns the column as a short

GetInt32 ( int i ) : Int32

Retrieves the column as an int

GetInt64 ( int i ) : System.Int64

Retrieves the column as a long

GetName ( int i ) : string

Retrieves the name of the column

GetOrdinal ( string name ) : int

Retrieves the i of a column, given its name

GetSchemaTable ( ) : DataTable

Schema information in Sqlite is difficult to map into .NET conventions, so a lot of work must be done to gather the necessary information so it can be represented in an ADO.NET manner.

GetString ( int i ) : string

Retrieves the column as a string

GetValue ( int i ) : object

Retrieves the column as an object corresponding to the underlying datatype of the column

GetValues ( object values ) : int

Retreives the values of multiple columns, up to the size of the supplied array

IsDBNull ( int i ) : bool

Returns True if the specified column is null

NextResult ( ) : bool

Moves to the next resultset in multiple row-returning SQL command.

Read ( ) : bool

Reads the next row from the resultset

this ( int i ) : object

Indexer to retrieve data from a column given its i

this ( string name ) : object

Indexer to retrieve data from a column given its name

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Disposes the datareader. Calls Close() to ensure everything is cleaned up.

Приватные методы

Метод Описание
CheckClosed ( ) : void

Throw an error if the datareader is closed

CheckValidRow ( ) : void

Throw an error if a row is not loaded

GetSchemaTable ( bool wantUniqueInfo, bool wantDefaultValue ) : DataTable
GetSqliteType ( int i ) : SqliteType

Retrieves the SqliteType for a given column, and caches it to avoid repetetive interop calls.

LoadKeyInfo ( ) : void
SqliteDataReader ( SqliteCommand cmd, CommandBehavior behave ) : System

Internal constructor, initializes the datareader and sets up to begin executing statements

VerifyType ( int i, DbType typ ) : TypeAffinity

Sqlite is inherently un-typed. All datatypes in Sqlite are natively strings. The definition of the columns of a table and the affinity of returned types are all we have to go on to type-restrict data in the reader. This function attempts to verify that the type of data being requested of a column matches the datatype of the column. In the case of columns that are not backed into a table definition, we attempt to match up the affinity of a column (int, double, string or blob) to a set of known types that closely match that affinity. It's not an exact science, but its the best we can do.

Описание методов

Close() публичный Метод

Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.
public Close ( ) : void
Результат void

Dispose() защищенный Метод

Disposes the datareader. Calls Close() to ensure everything is cleaned up.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

GetBoolean() публичный Метод

Retrieves the column as a boolean value
public GetBoolean ( int i ) : bool
i int The index of the column to retrieve
Результат bool

GetByte() публичный Метод

Retrieves the column as a single byte value
public GetByte ( int i ) : byte
i int The index of the column to retrieve
Результат byte

GetBytes() публичный Метод

Retrieves a column as an array of bytes (blob)
To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned.
public GetBytes ( int i, long fieldOffset, byte buffer, int bufferoffset, int length ) : long
i int The index of the column to retrieve
fieldOffset long The zero-based index of where to begin reading the data
buffer byte The buffer to write the bytes into
bufferoffset int The zero-based index of where to begin writing into the array
length int The number of bytes to retrieve
Результат long

GetChar() публичный Метод

Returns the column as a single character
public GetChar ( int i ) : char
i int The index of the column to retrieve
Результат char

GetChars() публичный Метод

Retrieves a column as an array of chars (blob)
To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned.
public GetChars ( int i, long fieldoffset, char buffer, int bufferoffset, int length ) : long
i int The index of the column to retrieve
fieldoffset long The zero-based index of where to begin reading the data
buffer char The buffer to write the characters into
bufferoffset int The zero-based index of where to begin writing into the array
length int The number of bytes to retrieve
Результат long

GetDataTypeName() публичный Метод

Retrieves the name of the back-end datatype of the column
public GetDataTypeName ( int i ) : string
i int The index of the column to retrieve
Результат string

GetDateTime() публичный Метод

Retrieve the column as a date/time value
public GetDateTime ( int i ) : System.DateTime
i int The index of the column to retrieve
Результат System.DateTime

GetDecimal() публичный Метод

Retrieve the column as a decimal value
public GetDecimal ( int i ) : decimal
i int The index of the column to retrieve
Результат decimal

GetDouble() публичный Метод

Returns the column as a double
public GetDouble ( int i ) : double
i int The index of the column to retrieve
Результат double

GetEnumerator() публичный Метод

Enumerator support
public GetEnumerator ( ) : System.Collections.IEnumerator
Результат System.Collections.IEnumerator

GetFieldType() публичный Метод

Returns the .NET type of a given column
public GetFieldType ( int i ) : Type
i int The index of the column to retrieve
Результат System.Type

GetFloat() публичный Метод

Returns a column as a float value
public GetFloat ( int i ) : float
i int The index of the column to retrieve
Результат float

GetGuid() публичный Метод

Returns the column as a Guid
public GetGuid ( int i ) : System.Guid
i int The index of the column to retrieve
Результат System.Guid

GetInt16() публичный Метод

Returns the column as a short
public GetInt16 ( int i ) : Int16
i int The index of the column to retrieve
Результат System.Int16

GetInt32() публичный Метод

Retrieves the column as an int
public GetInt32 ( int i ) : Int32
i int The index of the column to retrieve
Результат System.Int32

GetInt64() публичный Метод

Retrieves the column as a long
public GetInt64 ( int i ) : System.Int64
i int The index of the column to retrieve
Результат System.Int64

GetName() публичный Метод

Retrieves the name of the column
public GetName ( int i ) : string
i int The index of the column to retrieve
Результат string

GetOrdinal() публичный Метод

Retrieves the i of a column, given its name
public GetOrdinal ( string name ) : int
name string The name of the column to retrieve
Результат int

GetSchemaTable() публичный Метод

Schema information in Sqlite is difficult to map into .NET conventions, so a lot of work must be done to gather the necessary information so it can be represented in an ADO.NET manner.
public GetSchemaTable ( ) : DataTable
Результат System.Data.DataTable

GetString() публичный Метод

Retrieves the column as a string
public GetString ( int i ) : string
i int The index of the column to retrieve
Результат string

GetValue() публичный Метод

Retrieves the column as an object corresponding to the underlying datatype of the column
public GetValue ( int i ) : object
i int The index of the column to retrieve
Результат object

GetValues() публичный Метод

Retreives the values of multiple columns, up to the size of the supplied array
public GetValues ( object values ) : int
values object The array to fill with values from the columns in the current resultset
Результат int

IsDBNull() публичный Метод

Returns True if the specified column is null
public IsDBNull ( int i ) : bool
i int The index of the column to retrieve
Результат bool

NextResult() публичный Метод

Moves to the next resultset in multiple row-returning SQL command.
public NextResult ( ) : bool
Результат bool

Read() публичный Метод

Reads the next row from the resultset
public Read ( ) : bool
Результат bool

this() публичный Метод

Indexer to retrieve data from a column given its i
public this ( int i ) : object
i int The index of the column to retrieve
Результат object

this() публичный Метод

Indexer to retrieve data from a column given its name
public this ( string name ) : object
name string The name of the column to retrieve data for
Результат object