Class SpannerParameter (3.15.1)

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
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
Boolean
Overrides

ParameterName

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

Size

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

SourceColumn

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

SourceColumnNullMapping

public override bool SourceColumnNullMapping { get; set; }
Property Value
TypeDescription
Boolean
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