TdsQueryParameter Class
Represents a decoded RPC parameter.
public sealed class TdsQueryParameterConstructors
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| IsNull | Gets a value indicating whether the parameter value is null. |
| IsOutput | Gets a value indicating whether the client declared the parameter as an output parameter (Output or InputOutput). Send its value back with TdsQueryResult.OutputParameters. |
| Name | Gets or sets the parameter name. |
| Type | Gets or sets the decoded parameter column type. |
| Value | Gets or sets the raw value decoded from the protocol payload. SQL NULL values use DBNull.Value. |
IsNull
TdsQueryParameter.csIsOutput
TdsQueryParameter.csGets 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
Gets or sets the decoded parameter column type.
public required TdsColumnType Type { get; init; }Property value
Value
TdsQueryParameter.csGets or sets the raw value decoded from the protocol payload. SQL NULL values use DBNull.Value.
public required object Value { get; init; }Property value
Methods
| Name | Description |
|---|---|
| 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. |
AsBinary()
TdsQueryParameter.csAsBoolean()
TdsQueryParameter.csAsDecimal()
TdsQueryParameter.csAsDouble()
TdsQueryParameter.csAsInt32()
TdsQueryParameter.csAsInt64()
TdsQueryParameter.csAsJson()
TdsQueryParameter.csAsString()
TdsQueryParameter.csAsXml()
TdsQueryParameter.csParses the value as XML when possible.
public XDocument? AsXml()Returns
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.