C# Class Mono.Data.Sqlite.SqliteDataReader

SQLite implementation of DbDataReader.
Inheritance: System.Data.Common.DbDataReader
Afficher le fichier Open project: rubenv/tripod Class Usage Examples

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

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

Private Methods

Méthode Description
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.

Method Details

Close() public méthode

Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.
public Close ( ) : void
Résultat void

Dispose() protected méthode

Disposes the datareader. Calls Close() to ensure everything is cleaned up.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

GetBoolean() public méthode

Retrieves the column as a boolean value
public GetBoolean ( int i ) : bool
i int The index of the column to retrieve
Résultat bool

GetByte() public méthode

Retrieves the column as a single byte value
public GetByte ( int i ) : byte
i int The index of the column to retrieve
Résultat byte

GetBytes() public méthode

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
Résultat long

GetChar() public méthode

Returns the column as a single character
public GetChar ( int i ) : char
i int The index of the column to retrieve
Résultat char

GetChars() public méthode

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
Résultat long

GetDataTypeName() public méthode

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
Résultat string

GetDateTime() public méthode

Retrieve the column as a date/time value
public GetDateTime ( int i ) : System.DateTime
i int The index of the column to retrieve
Résultat System.DateTime

GetDecimal() public méthode

Retrieve the column as a decimal value
public GetDecimal ( int i ) : decimal
i int The index of the column to retrieve
Résultat decimal

GetDouble() public méthode

Returns the column as a double
public GetDouble ( int i ) : double
i int The index of the column to retrieve
Résultat double

GetEnumerator() public méthode

Enumerator support
public GetEnumerator ( ) : System.Collections.IEnumerator
Résultat System.Collections.IEnumerator

GetFieldType() public méthode

Returns the .NET type of a given column
public GetFieldType ( int i ) : Type
i int The index of the column to retrieve
Résultat System.Type

GetFloat() public méthode

Returns a column as a float value
public GetFloat ( int i ) : float
i int The index of the column to retrieve
Résultat float

GetGuid() public méthode

Returns the column as a Guid
public GetGuid ( int i ) : System.Guid
i int The index of the column to retrieve
Résultat System.Guid

GetInt16() public méthode

Returns the column as a short
public GetInt16 ( int i ) : Int16
i int The index of the column to retrieve
Résultat System.Int16

GetInt32() public méthode

Retrieves the column as an int
public GetInt32 ( int i ) : Int32
i int The index of the column to retrieve
Résultat System.Int32

GetInt64() public méthode

Retrieves the column as a long
public GetInt64 ( int i ) : System.Int64
i int The index of the column to retrieve
Résultat System.Int64

GetName() public méthode

Retrieves the name of the column
public GetName ( int i ) : string
i int The index of the column to retrieve
Résultat string

GetOrdinal() public méthode

Retrieves the i of a column, given its name
public GetOrdinal ( string name ) : int
name string The name of the column to retrieve
Résultat int

GetSchemaTable() public méthode

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
Résultat System.Data.DataTable

GetString() public méthode

Retrieves the column as a string
public GetString ( int i ) : string
i int The index of the column to retrieve
Résultat string

GetValue() public méthode

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
Résultat object

GetValues() public méthode

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
Résultat int

IsDBNull() public méthode

Returns True if the specified column is null
public IsDBNull ( int i ) : bool
i int The index of the column to retrieve
Résultat bool

NextResult() public méthode

Moves to the next resultset in multiple row-returning SQL command.
public NextResult ( ) : bool
Résultat bool

Read() public méthode

Reads the next row from the resultset
public Read ( ) : bool
Résultat bool

this() public méthode

Indexer to retrieve data from a column given its i
public this ( int i ) : object
i int The index of the column to retrieve
Résultat object

this() public méthode

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
Résultat object