Class StorageDataReader
Wrapper around a DbData reader to perform some special operations more simply
Inheritance
Inherited Members
Namespace:Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class StorageDataReader
Constructors
| Improve this Doc View SourceStorageDataReader(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 SourceColumns
All the columns that this reader currently contains
Declaration
public DbColumnWrapper[] Columns { get; }
Property Value
| Type | Description |
|---|---|
| DbColumnWrapper[] |
DbDataReader
The DbDataReader that will be read from
Declaration
public DbDataReader DbDataReader { get; }
Property Value
| Type | Description |
|---|---|
| System.Data.Common.DbDataReader |
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 SourceGetBytesWithMaxCapacity(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 |
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 |
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 |
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 |
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 |
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 |
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> |