mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-18 17:23:52 -05:00
WIP for QueryExecution, mostly complete
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||
{
|
||||
public class ResultSet
|
||||
{
|
||||
public DbColumn[] Columns { get; set; }
|
||||
|
||||
public List<object[]> Rows { get; private set; }
|
||||
|
||||
public ResultSet()
|
||||
{
|
||||
Rows = new List<object[]>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a row of data to the result set using a <see cref="DbDataReader"/> that has already
|
||||
/// read in a row.
|
||||
/// </summary>
|
||||
/// <param name="reader">A <see cref="DbDataReader"/> that has already had a read performed</param>
|
||||
public void AddRow(DbDataReader reader)
|
||||
{
|
||||
List<object> row = new List<object>();
|
||||
for (int i = 0; i < reader.FieldCount; ++i)
|
||||
{
|
||||
row.Add(reader.GetValue(i));
|
||||
}
|
||||
Rows.Add(row.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user