Show / Hide Table of Contents

# Class StorageDataReader

Wrapper around a DbData reader to perform some special operations more simply

##### Inheritance

System.Object
StorageDataReader

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

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

##### Syntax

    public class StorageDataReader

### Constructors

| Improve this Doc View Source

#### StorageDataReader(DbDataReader)

Constructs a new wrapper around the provided reader

##### Declaration

    public StorageDataReader(DbDataReader reader)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Data.Common.DbDataReader | reader | The reader to wrap around

### Properties

| Improve this Doc View Source

#### Columns

All the columns that this reader currently contains

##### Declaration

    public DbColumnWrapper[] Columns { get; }

##### Property Value

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

| Improve this Doc View Source

#### DbDataReader

The DbDataReader that will be read from

##### Declaration

    public DbDataReader DbDataReader { get; }

##### Property Value

Type | Description
--- | ---
System.Data.Common.DbDataReader |

| Improve this Doc View Source

#### HasLongColumns

Whether or not any of the columns of this reader are 'long', such as nvarchar(max)

##### Declaration

    public bool HasLongColumns { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

### Methods

| Improve this Doc View Source

#### GetBytesWithMaxCapacity(Int32, Int32)

Retrieves bytes with a maximum number of bytes to return

##### Declaration

    public byte[] GetBytesWithMaxCapacity(int iCol, int maxNumBytesToReturn)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | iCol | Column ordinal
System.Int32 | maxNumBytesToReturn | Number of bytes to return at maximum

##### Returns

Type | Description
--- | ---
System.Byte[] | Byte array

| Improve this Doc View Source

#### GetCharsWithMaxCapacity(Int32, Int32)

Retrieves characters with a maximum number of charss to return

##### Declaration

    public string GetCharsWithMaxCapacity(int iCol, int maxCharsToReturn)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | iCol | Column ordinal
System.Int32 | maxCharsToReturn | Number of chars to return at maximum

##### Returns

Type | Description
--- | ---
System.String | String

| Improve this Doc View Source

#### GetValue(Int32)

Retrieves a value

##### Declaration

    public object GetValue(int i)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | i | Column ordinal

##### Returns

Type | Description
--- | ---
System.Object | The value of the given column

| Improve this Doc View Source

#### GetValues(Object[])

Stores all values of the current row into the provided object array

##### Declaration

    public void GetValues(object[] values)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object[] | values | Where to store the values from this row

| Improve this Doc View Source

#### GetXmlWithMaxCapacity(Int32, Int32)

Retrieves xml with a maximum number of bytes to return

##### Declaration

    public string GetXmlWithMaxCapacity(int iCol, int maxCharsToReturn)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | iCol | Column ordinal
System.Int32 | maxCharsToReturn | Number of chars to return at maximum

##### Returns

Type | Description
--- | ---
System.String | String

| Improve this Doc View Source

#### IsDBNull(Int32)

Whether or not the cell of the given column at the current row is a DBNull

##### Declaration

    public bool IsDBNull(int i)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | i | Column ordinal

##### Returns

Type | Description
--- | ---
System.Boolean | True if the cell is DBNull, false otherwise

| Improve this Doc View Source

#### ReadAsync(CancellationToken)

Pass-through to DbDataReader.ReadAsync()

##### Declaration

    public Task<bool> ReadAsync(CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Threading.CancellationToken | cancellationToken | The cancellation token to use for cancelling a query

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Boolean> |