1.1.1

Table Of Contents
{
///
/// Log or re-throw exception
///
}
finally
{
connection.Close();
}
You can also specify a range of parameters as an array of objects, as shown in this example:
string sqlfHost = "localhost";
int sqlfPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", sqlfHost, sqlfPort);
SQLFClientConnection connection = null;
try
{
// Initialize and open connection
connection = new SQLFClientConnection(connectionStr);
connection.Open();
SQLFCommand command = connection.CreateCommand();
command.CommandType = CommandType.Text;
command.CommandText = @"SELECT * FROM orders WHERE order-date = ?
AND subtotal > ?";
// Create an object array containing parameters' value
object[] parameters = new object[] { DateTime.Today, 999.99 };
// Add object array as parameters (range)
command.Parameters.AddRange(parameters);
SQLFDataAdapter adapter = command.CreateDataAdapter();
DataTable table = new DataTable("orders");
adapter.Fill(table);
}
catch (Exception e)
{
///
/// Log or re-throw exception
///
}
finally
{
connection.Close();
}
Updating Row Data
You can use SQLFCommandBuilder to update, delete, and insert rows that are stored in a SQLFDataAdapter
object.
The following example uses an SQLFDataAdapter object to store the contents of a table, and then update row
data.
string sqlfHost = "localhost";
int sqlfPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", sqlfHost, sqlfPort);
139
Developing ADO.NET Client Applications