1.0

Table Of Contents
ADO.NET interfaces (in
System.Data)
ADO.NET base class (in
System.Data.Common)
SQLFire ADO.NET Driver Class
IDbCommandDbCommandSQLFCommand
n/aDbCommandBuilderSQLFCommandBuilder
IDbDataAdapterDbDataAdapterSQLFDataAdapter
IDataReaderDbDataReaderSQLFDataReader
n/aDbExceptionSQLFException
IDataParameter, IDbDataParameterDbParameterSQLFParameter
IDataParameterCollectionDbParameterCollectionSQLFParameterCollection
n/aRowUpdatedEventArgsSQLFRowUpdatedEventArgs
n/aRowUpdatingEventArgsSQLFRowUpdatingEventArgs
IDbTransactionDbTransactionSQLFTransaction
See
VMware.Data.SQLFire.SQLFType
on page 642.
(use DbTypes as in Table 36: SQL types
to SQLFType mapping on page 642)
SQLFType
For example:
// Open a new connection to the network server running on localhost:1527
string host = "localhost";
int port = 1527;
string connectionStr = string.Format("server={0}:{1}", host, port);
// use the SQLFire specific class for connection creation
using (SQLFClientConnection conn = new SQLFClientConnection(connectionStr))
{
conn.Open();
// create a table
// using the base DbCommand class rather than SQLFire specific class
DbCommand cmd = conn.CreateCommand();
cmd.CommandText = "create table t1 (id int primary key, addr varchar(20))";
cmd.ExecuteNonQuery();
// insert into the table using named parameters
// using an abstracted method that can deal with difference in the
// conventions of named parameters in different drivers
cmd = conn.CreateCommand();
string idPrm = GetEscapedParameterName("ID");
string addrPrm = GetEscapedParameterName("ADDR");
cmd.CommandText = "insert into t1 values (" + idPrm + "," + addrPrm +
")";
cmd.Prepare();
// using the base DbParameter class
DbParameter prm;
for (int i = 0; i < 1000; i++) {
// first the parameter for ID
cmd.Parameters.Clear();
prm = cmd.CreateParameter();
prm.ParameterName = "ID";
prm.DbType = DbType.Int32;
prm.Value = i;
cmd.Parameters.Add(prm);
// next the parameter for ADDR
prm = cmd.CreateParameter();
vFabric SQLFire User's Guide130
Developing Applications with SQLFire