1.0

Table Of Contents
connection.Close();
}
Storing Multiple Tables
You can use SQLFDataAdapter with a System.Data.DataSet object to hold multiple result sets.
The following example uses a dataset to store the full contents from three different tables.
string sqlfHost = "localhost";
int sqlfPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", sqlfHost, sqlfPort);
SQLFClientConnection connection = null;
try
{
connection = new SQLFClientConnection(connectionStr);
SQLFCommand command = connection.CreateCommand();
command.CommandType = CommandType.Text;
connection.Open();
// Create adapter and data set to hold multiple result sets
SQLFDataAdapter adapter = command.CreateDataAdapter();
DataSet dataset = new DataSet("CustomerOrder");
// Retrieve all customer records
command.CommandText = "SELECT * FROM customer";
adapter.Fill(dataset, "customer");
// Retrieve all order records
command.CommandText = "SELECT * FROM orders";
adapter.Fill(dataset, "orders");
// Retrieve all orderdetail records
command.CommandText = "SELECT * FROM orderdetail";
adapter.Fill(dataset, "orderdetail");
// Parse all tables and rows in the data set
foreach (DataTable table in dataset.Tables)
{
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
123
Developing ADO.NET Client Applications