WIP for QueryExecution, mostly complete

This commit is contained in:
Benjamin Russell
2016-08-04 14:48:58 -07:00
parent 1618b77790
commit 3ba22c94ac
12 changed files with 338 additions and 191 deletions

View File

@@ -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());
}
}
}