SqlResultSet represents the rows returned by ExecuteQuery() on an ISqlConnection. It exposes result metadata such as column names and types and can be iterated using foreach to obtain SqlTuple objects.
public class SqlResultSet : IEnumerable<SqlTuple>, IEnumerable, IDisposable
{
// Properties
public string[] ColumnNames { get; }
public Type[] ColumnTypes { get; }
public int NumberOfColumns { get; }
// Methods
public int GetColumnNo(string column);
public void Close();
public void Dispose();
public IEnumerator<SqlTuple> GetEnumerator();
IEnumerator IEnumerable.GetEnumerator();
}
SqlTuple) and IDisposable for resource management.Type objects describing the values returned in each column. The wrapper maps SQL engine types to C# runtime types such as long, double, string, DateTime, decimal, byte[], Sequence, and array types used for remote SQL sequence results.ArgumentException if the column is not found.Dispose().SqlCursor objects created from this result set, detaches the result from its parent connection, and closes the native result handle.SqlTuple objects. Each call creates a new SqlCursor and registers it with the result set for coordinated cleanup.IEnumerable.GetEnumerator(). It creates and returns a SqlCursor in the same way as the generic enumerator method.foreach (SqlTuple row in resultSet) to iterate through the returned rows. Each enumeration creates a separate cursor over the same query result, so repeated enumeration starts with a new cursor.using statement or an explicit call to Close()/Dispose() so that result-set resources are released promptly.
A finalizer exists as a safety net, but application code should not rely on it for normal cleanup.SqlResultSet instances are not thread-safe. Access from multiple threads requires external synchronization.
Each thread should use its own connection and result set.GetColumnNo() to resolve column names to indices, then access values via SqlTuple indexer: row[columnIndex].
Type casting is required based on ColumnTypes.Sequence or sequence-array values depending on the query form and transport. Sequence objects obtained from a tuple should be disposed after use.