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.
Namespace
Google.Cloud.Spanner.DataAssembly
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 |
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 |
IsNullable
public override bool IsNullable { get; set; }
Property Value | |
---|---|
Type | Description |
bool |
ParameterName
public override string ParameterName { get; set; }
Property Value | |
---|---|
Type | Description |
string |
Size
public override int Size { get; set; }
Property Value | |
---|---|
Type | Description |
int |
SourceColumn
public override string SourceColumn { get; set; }
Property Value | |
---|---|
Type | Description |
string |
SourceColumnNullMapping
public override bool SourceColumnNullMapping { get; set; }
Property Value | |
---|---|
Type | Description |
bool |
SourceVersion
public override DataRowVersion SourceVersion { get; set; }
Property Value | |
---|---|
Type | Description |
DataRowVersion |
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 |
Methods
Clone()
public object Clone()
Returns | |
---|---|
Type | Description |
object |
ResetDbType()
public override void ResetDbType()