Google.Cloud.Spanner.Data - Class SpannerParameter (4.3.0)

public sealed class SpannerParameter : DbParameter, IDbDataParameter, IDataParameter, ICloneable

Reference documentation and code samples for the Google.Cloud.Spanner.Data class SpannerParameter.

Represents a parameter to a SpannerCommand and optionally its mapping to DataSet columns.

Inheritance

object > MarshalByRefObject > DbParameter > SpannerParameter

Namespace

GoogleCloudGoogle.Cloud.SpannerData

Assembly

Google.Cloud.Spanner.Data.dll

Constructors

SpannerParameter()

public SpannerParameter()

Initializes a new instance of the SpannerParameter class.

SpannerParameter(string, SpannerDbType, object, string)

public SpannerParameter(string parameterName, SpannerDbType type, object value = null, string sourceColumn = null)

Initializes a new instance of the SpannerParameter class.

Parameters
NameDescription
parameterNamestring

The name of the parameter. For Insert, Update and Delete commands, this name should be the name of a valid column in a Spanner table. In Select commands, this name should be the name of a parameter used in the SQL Query. This value is case sensitive. Must not be null.

typeSpannerDbType

One of the SpannerDbType values that indicates the type of the parameter. Must not be null.

valueobject

An object that is the value of the SpannerParameter. May be null.

sourceColumnstring

The name of the DataTable source column (SourceColumn) if this SpannerParameter is used in a call to Update. May be null.

Properties

CommitTimestamp

public static object CommitTimestamp { get; }

Returns a value that will be replaced with a commit timestamp on insert or update. Only suitable for Timestamp values.

Property Value
TypeDescription
object

DbType

public override DbType DbType { get; set; }

Specifies the data type of a field, a property, or a Parameter object of a .NET Framework data provider.

Property Value
TypeDescription
DbType
Overrides Remarks

Using DbType of VarNumeric will always default to SpannerDbType of SpannerNumeric and never to PgNumeric.

Direction

public override ParameterDirection Direction { get; set; }
Property Value
TypeDescription
ParameterDirection
Overrides

IsNullable

public override bool IsNullable { get; set; }
Property Value
TypeDescription
bool
Overrides

ParameterName

public override string ParameterName { get; set; }
Property Value
TypeDescription
string
Overrides

Size

public override int Size { get; set; }
Property Value
TypeDescription
int
Overrides

SourceColumn

public override string SourceColumn { get; set; }
Property Value
TypeDescription
string
Overrides

SourceColumnNullMapping

public override bool SourceColumnNullMapping { get; set; }
Property Value
TypeDescription
bool
Overrides

SourceVersion

public override DataRowVersion SourceVersion { get; set; }
Property Value
TypeDescription
DataRowVersion
Overrides

SpannerDbType

public SpannerDbType SpannerDbType { get; set; }

The SpannerDbType of the parameter or column. This should match the type as defined in Spanner or as defined by the result of a SQL Query.

Property Value
TypeDescription
SpannerDbType

Value

public override object Value { get; set; }
Property Value
TypeDescription
object
Overrides

Methods

Clone()

public object Clone()
Returns
TypeDescription
object

ResetDbType()

public override void ResetDbType()
Overrides