Show / Hide Table of Contents

# 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

System.Object
ResultSet

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace:Microsoft.SqlTools.ServiceLayer.QueryExecution

###### Assembly:Microsoft.SqlTools.ServiceLayer.dll

##### Syntax

    public class ResultSet : IDisposable

### Constructors

| Improve this Doc View Source

#### ResultSet(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 Source

#### BatchId

ID of the batch set, relative to the query

##### Declaration

    public int BatchId { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### Columns

The columns for this result set

##### Declaration

    public DbColumnWrapper[] Columns { get; }

##### Property Value

Type | Description
--- | ---
DbColumnWrapper[] |

| Improve this Doc View Source

#### Id

ID of the result set, relative to the batch

##### Declaration

    public int Id { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### MaxCharsToStore

Maximum number of characters to store for a field

##### Declaration

    public int MaxCharsToStore { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### MaxXmlCharsToStore

Maximum number of characters to store for an XML field

##### Declaration

    public int MaxXmlCharsToStore { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### RowCount

The number of rows for this result set

##### Declaration

    public long RowCount { get; }

##### Property Value

Type | Description
--- | ---
System.Int64 |

| Improve this Doc View Source

#### Summary

Generates a summary of this result set

##### Declaration

    public ResultSetSummary Summary { get; }

##### Property Value

Type | Description
--- | ---
ResultSetSummary |

### Methods

| Improve this Doc View Source

#### Dispose()

##### Declaration

    public void Dispose()

##### Implements

System.IDisposable.Dispose()
| Improve this Doc View Source

#### Dispose(Boolean)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | disposing |

| Improve this Doc View Source

#### 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

| Improve this Doc View Source

#### 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 Source

#### ResultCompletion

Event that will be called when the result set has completed execution

##### Declaration

    public event ResultSet.ResultSetAsyncEventHandler ResultCompletion

##### Event Type

Type | Description
--- | ---
ResultSet.ResultSetAsyncEventHandler |