Database

Retrieving Results

IntoDataTable executes the query and returns results as a System.Data.DataTable - useful when integrating with .NET code that expects DataTable. IntoGrid executes and returns results as an IGPALGrid<string> - the standard GPAL format that plugs directly into Browser.FillInFrom, Converter.WithInput, and other GPAL methods. Tokens is a read-only property exposing the last query result as an IGPALGrid<string> - intended for debugging only, not for production data access.

Examples

GPAL Fluent: High-level fluent C# API

//IntoGrid returns an IGPALGrid<string> where each row is a database row and each column maps to the SELECT column list in order. Column names from the query are not automatically included in the grid - add a header row manually if needed.

// Read results into a grid

var results = GPAL.Grid.ToGPALObject();

GPAL.Database

.WithConnectionString(connStr)

.WithSQLCommand("SELECT Id, Name, Email FROM Users")

.Read

.IntoGrid(out results);


// Then use the grid to drive browser automation

GPAL.Browser

.GoTo("https://app.example.com/users")

.WithSelector("#search")

.FillInFrom(results);

💬 Ask GPAL