Class SpannerParameter (4.0.0)

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

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

Inheritance

Object > MarshalByRefObject > DbParameter > SpannerParameter

Namespace

Google.Cloud.Spanner.Data

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
Name Description
parameterName String

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.

type SpannerDbType

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

value Object

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

sourceColumn String

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
Type Description
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
Type Description
DbType
Overrides
System.Data.Common.DbParameter.DbType
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
Type Description
ParameterDirection
Overrides

IsNullable

public override bool IsNullable { get; set; }
Property Value
Type Description
Boolean
Overrides

ParameterName

public override string ParameterName { get; set; }
Property Value
Type Description
String
Overrides

Size

public override int Size { get; set; }
Property Value
Type Description
Int32
Overrides

SourceColumn

public override string SourceColumn { get; set; }
Property Value
Type Description
String
Overrides

SourceColumnNullMapping

public override bool SourceColumnNullMapping { get; set; }
Property Value
Type Description
Boolean
Overrides

SourceVersion

public override DataRowVersion SourceVersion { get; set; }
Property Value
Type Description
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
Type Description
SpannerDbType

Value

public override object Value { get; set; }
Property Value
Type Description
Object
Overrides

Methods

Clone()

public object Clone()
Returns
Type Description
Object

ResetDbType()

public override void ResetDbType()
Overrides