TdsQueryParameter Class

Represents a decoded RPC parameter.

public sealed class TdsQueryParameter

Constructors

NameDescription
TdsQueryParameter()

TdsQueryParameter()

  • Obsolete: Constructors of types with required members are not supported in this version of your compiler.
[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
public TdsQueryParameter()

No documentation is available.

Properties

NameDescription
IsNullGets a value indicating whether the parameter value is null.
IsOutputGets a value indicating whether the client declared the parameter as an output parameter (Output or InputOutput). Send its value back with TdsQueryResult.OutputParameters.
NameGets or sets the parameter name.
TypeGets or sets the decoded parameter column type.
ValueGets or sets the raw value decoded from the protocol payload. SQL NULL values use DBNull.Value.

Gets a value indicating whether the parameter value is null.

public bool IsNull { get; }

Property value

bool

Gets a value indicating whether the client declared the parameter as an output parameter (Output or InputOutput). Send its value back with TdsQueryResult.OutputParameters.

public bool IsOutput { get; init; }

Property value

bool

Gets or sets the parameter name.

public required string Name { get; init; }

Property value

string

Gets or sets the decoded parameter column type.

public required TdsColumnType Type { get; init; }

Property value

TdsColumnType

Gets or sets the raw value decoded from the protocol payload. SQL NULL values use DBNull.Value.

public required object Value { get; init; }

Property value

object

Methods

NameDescription
AsBinary()Returns the value as binary payload when possible.
AsBoolean()Converts the value to Boolean when possible.
AsDecimal()Converts the value to Decimal when possible.
AsDouble()Converts the value to Double when possible.
AsInt32()Converts the value to Int32 when possible.
AsInt64()Converts the value to Int64 when possible.
AsJson()Parses the value as JSON when possible.
AsString()Converts the value to String when possible.
AsXml()Parses the value as XML when possible.

Returns the value as binary payload when possible.

public byte[]? AsBinary()

Returns

byte[]?

Converts the value to Boolean when possible.

public bool? AsBoolean()

Returns

bool?

Converts the value to Decimal when possible.

public decimal? AsDecimal()

Returns

decimal?

Remarks

A Single or Double outside the Decimal range, NaN included, returns null.

Converts the value to Double when possible.

public double? AsDouble()

Returns

double?

Converts the value to Int32 when possible.

public int? AsInt32()

Returns

int?

Converts the value to Int64 when possible.

public long? AsInt64()

Returns

long?

Parses the value as JSON when possible.

public JsonObject? AsJson()

Converts the value to String when possible.

public string? AsString()

Returns

string?

Parses the value as XML when possible.

public XDocument? AsXml()

Returns

XDocument?

Exceptions

XmlException
The value is not well-formed XML, or it declares a DTD.

Remarks

DTD processing is disabled. The value comes straight off the wire, and XDocument.Parse would expand internal entities up to ten million characters, so a few hundred bytes of parameter could cost megabytes of allocation.