Class ResultSet
Class that represents a resultset the was generated from a query. Contains logic for storing and retrieving results. Is contained by a Batch class.
Inheritance
Inherited Members
Namespace:Microsoft.SqlTools.ServiceLayer.QueryExecution
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class ResultSet : IDisposable
Constructors
| Improve this Doc View SourceResultSet(DbDataReader, Int32, Int32, IFileStreamFactory)
Creates a new result set and initializes its state
Declaration
public ResultSet(DbDataReader reader, int ordinal, int batchOrdinal, IFileStreamFactory factory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Data.Common.DbDataReader | reader | The reader from executing a query |
| System.Int32 | ordinal | The ID of the resultset, the ordinal of the result within the batch |
| System.Int32 | batchOrdinal | The ID of the batch, the ordinal of the batch within the query |
| IFileStreamFactory | factory | Factory for creating a reader/writer |
Properties
| Improve this Doc View SourceBatchId
ID of the batch set, relative to the query
Declaration
public int BatchId { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Columns
The columns for this result set
Declaration
public DbColumnWrapper[] Columns { get; }
Property Value
| Type | Description |
|---|---|
| DbColumnWrapper[] |
Id
ID of the result set, relative to the batch
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
MaxCharsToStore
Maximum number of characters to store for a field
Declaration
public int MaxCharsToStore { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
MaxXmlCharsToStore
Maximum number of characters to store for an XML field
Declaration
public int MaxXmlCharsToStore { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
RowCount
The number of rows for this result set
Declaration
public long RowCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Summary
Generates a summary of this result set
Declaration
public ResultSetSummary Summary { get; }
Property Value
| Type | Description |
|---|---|
| ResultSetSummary |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
Implements
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
GetSubset(Int32, Int32)
Generates a subset of the rows from the result set
Declaration
public Task<ResultSetSubset> GetSubset(int startRow, int rowCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | startRow | The starting row of the results |
| System.Int32 | rowCount | How many rows to retrieve |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultSetSubset> | A subset of results |
ReadResultToEnd(CancellationToken)
Reads from the reader until there are no more results to read
Declaration
public Task ReadResultToEnd(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | Cancellation token for cancelling the query |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Events
| Improve this Doc View SourceResultCompletion
Event that will be called when the result set has completed execution
Declaration
public event ResultSet.ResultSetAsyncEventHandler ResultCompletion
Event Type
| Type | Description |
|---|---|
| ResultSet.ResultSetAsyncEventHandler |