Storing a Table

You can use GFXDDataAdapter to populate a System.Data.DataTable object with the results from a SQL command, or to refresh a DataTable object with new results.

The following example fills a DataTable with rows retrieved from a table, and then uses the DataTable to display each row.
string gfxdHost = "localhost";
int gfxdPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", gfxdHost, gfxdPort);

GFXDClientConnection connection = null;

try
{
    connection = new GFXDClientConnection(connectionStr);

    GFXDCommand command = connection.CreateCommand();
    command.CommandType = CommandType.Text;
    command.CommandText = "SELECT * FROM product";

    connection.Open();

    // Create adapter and populate the DataTable object
    GFXDDataAdapter adapter = command.CreateDataAdapter();
    DataTable table = new DataTable("product");
    adapter.Fill(table);

    // Parse the DataTable object by rows
    foreach (DataRow row in table.Rows)
    {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < row.Table.Columns.Count; i++)
            sb.AppendFormat("{0}, ", (row[i].ToString()));

        Console.WriteLine(sb.ToString());
    }
}
catch (Exception e)
{
    ///
    /// Log or re-throw exception
    /// 
}
finally
{
    connection.Close();
}