Send feedback
Class SpannerDataReader (3.15.1)
Stay organized with collections
Save and categorize content based on your preferences.
Version 3.15.1 keyboard_arrow_down
public sealed class SpannerDataReader : DbDataReader, IEnumerable, IDataReader, IDataRecord, IDisposable
Reads a forward-only stream of rows from a data source.
Namespace
Google.Cloud.Spanner.Data
Assembly
Google.Cloud.Spanner.Data.dll
Properties
Depth
public override int Depth { get; }
Property Value Type Description Int32
Overrides
FieldCount
public override int FieldCount { get; }
Property Value Type Description Int32
Overrides
HasRows
public override bool HasRows { get; }
Gets a value that indicates whether the SpannerDataReader contains one or more rows.
If any rows have been read, this will continue to return true even when there are no more rows.
Property Value Type Description Boolean
Overrides
IsClosed
public override bool IsClosed { get; }
Property Value Type Description Boolean
Overrides
Item[Int32]
public override object this [ int i ] { get ; }
Parameter Name Description i
Int32
Property Value Type Description Object
Overrides
Item[String]
public override object this [ string name ] { get ; }
Parameter Name Description name
String
Property Value Type Description Object
Overrides
RecordsAffected
public override int RecordsAffected { get; }
Property Value Type Description Int32
Overrides
Methods
Close()
public override void Close()
Overrides
Dispose(Boolean)
protected override void Dispose(bool disposing)
Parameter Name Description disposing
Boolean
Overrides
GetBoolean(Int32)
public override bool GetBoolean(int i)
Parameter Name Description i
Int32
Overrides
GetByte(Int32)
public override byte GetByte(int i)
Parameter Name Description i
Int32
Returns Type Description Byte
Overrides
GetBytes(Int32, Int64, Byte[], Int32, Int32)
public override long GetBytes(int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length)
Returns Type Description Int64
Overrides
GetChar(Int32)
public override char GetChar(int i)
Parameter Name Description i
Int32
Returns Type Description Char
Overrides
GetChars(Int32, Int64, Char[], Int32, Int32)
public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Returns Type Description Int64
Overrides
GetDataTypeName(Int32)
public override string GetDataTypeName(int i)
Parameter Name Description i
Int32
Overrides
GetDateTime(Int32)
public override DateTime GetDateTime(int i)
Parameter Name Description i
Int32
Overrides
GetDecimal(Int32)
public override decimal GetDecimal(int i)
Parameter Name Description i
Int32
Overrides
GetDouble(Int32)
public override double GetDouble(int i)
Parameter Name Description i
Int32
Overrides
GetEnumerator()
public override IEnumerator GetEnumerator()
Overrides
GetFieldType(Int32)
public override Type GetFieldType(int i)
Parameter Name Description i
Int32
Returns Type Description Type
Overrides
GetFieldValue<T>(Int32)
public override T GetFieldValue<T>(int ordinal)
Parameter Name Description ordinal
Int32
Type Parameter Name Description T
Overrides
GetFieldValue<T>(String)
public T GetFieldValue<T>(string columnName)
Gets the value of the specified column as type T.
Parameter Name Description columnName
String
The name of the column whose value will be returned. Must not be null.
Returns Type Description T
The value of the column at the current row, converted to type T.
Type Parameter Name Description T
The expected return type. If possible the return type will be converted to this type.
If conversion is requested between incompatible types, an InvalidOperationException
will be thrown.
If the conversion fails due to the contents returned (for example a string representing a
boolean does not have either 'true' or 'false') then a FormatException exception will be
thrown as documented by the Convert class.
GetFloat(Int32)
public override float GetFloat(int i)
Parameter Name Description i
Int32
Overrides
GetGuid(Int32)
public override Guid GetGuid(int i)
Parameter Name Description i
Int32
Returns Type Description Guid
Overrides
GetInt16(Int32)
public override short GetInt16(int i)
Parameter Name Description i
Int32
Returns Type Description Int16
Overrides
GetInt32(Int32)
public override int GetInt32(int i)
Parameter Name Description i
Int32
Returns Type Description Int32
Overrides
GetInt64(Int32)
public override long GetInt64(int i)
Parameter Name Description i
Int32
Returns Type Description Int64
Overrides
GetJsonValue(Int32)
public Value GetJsonValue(int i)
Gets the value of the specified column as a pure Protobuf type.
Parameter Name Description i
Int32
The index of the column whose value will be returned.
Returns Type Description Value
The raw protobuf as a Value .
GetName(Int32)
public override string GetName(int i)
Parameter Name Description i
Int32
Overrides
GetNumeric(Int32)
public SpannerNumeric GetNumeric(int i)
Parameter Name Description i
Int32
The index of the column to retrieve.
GetOrdinal(String)
public override int GetOrdinal(string name)
Parameter Name Description name
String
Returns Type Description Int32
Overrides
GetOrdinalAsync(String, CancellationToken)
public async Task<int> GetOrdinalAsync(string name, CancellationToken cancellationToken = default(CancellationToken))
Returns the column ordinal given the name of the column, asynchronously requesting metadata from
the database if necessary.
Parameters Name Description name
String
The name of the column.
cancellationToken
CancellationToken
A cancellation token to cancel reading metadata. Defaults to None .
Returns Type Description Task <Int32 >
The zero-based column ordinal.
GetPgNumeric(Int32)
public PgNumeric GetPgNumeric(int i)
Gets the value of the specified column as type PgNumeric .
Parameter Name Description i
Int32
The index of the column to retrieve.
GetReadTimestamp()
public Timestamp GetReadTimestamp()
Remarks
GetReadTimestampAsync(CancellationToken)
public Task<Timestamp> GetReadTimestampAsync(CancellationToken cancellationToken)
GetSchemaTable()
public override DataTable GetSchemaTable()
When enabled, returns the schema of the query as a DataTable . This feature needs
to be enabled in the connection string via the EnableGetSchemaTable property.
Returns Type Description DataTable
A DataTable
with schema information about the query, or null
if the feature
is not enabled in the connection string.
Overrides
Remarks
GetSpannerDate(Int32)
public SpannerDate GetSpannerDate(int i)
Gets the value of the specified column as type SpannerDate .
Parameter Name Description i
Int32
The index of the column to retrieve.
GetString(Int32)
public override string GetString(int i)
Parameter Name Description i
Int32
Overrides
GetTimestamp(Int32)
public Timestamp GetTimestamp(int i)
Gets the value of the specified column as type Timestamp .
Parameter Name Description i
Int32
The index of the column to retrieve.
GetValue(Int32)
public override object GetValue(int i)
Parameter Name Description i
Int32
Overrides
GetValues(Object[])
public override int GetValues(object[] values)
Parameter Name Description values
Object []
Returns Type Description Int32
Overrides
IsDBNull(Int32)
public override bool IsDBNull(int i)
Parameter Name Description i
Int32
Overrides
NextResult()
public override bool NextResult()
Overrides
Read()
public override bool Read()
Overrides
ReadAsync(CancellationToken)
public override Task<bool> ReadAsync(CancellationToken cancellationToken)
Reads the next row of values from Cloud Spanner.
Important: Cloud Spanner supports limited cancellation of this task.
Parameter Name Description cancellationToken
CancellationToken
A cancellation token to cancel the read. Cloud Spanner currently
supports limited cancellation while advancing the read to the next row.
Returns Type Description Task <Boolean >
True if another row was read.
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-01 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-10-01 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-01 UTC."]]