Represents a set of data commands and a connection to a data source that are used to fill the DataSet and update the data source. This class cannot be inherited.
For a list of all members of this type, see FbDataAdapter Members.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Data.Common.DataAdapter
System.Data.Common.DbDataAdapter
FirebirdSql.Data.Firebird.FbDataAdapter
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The FbDataAdapter, serves as a bridge between a DataSet and FirebirdSQL for retrieving and saving data. The FbDataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet, using the appropriate DSQL statements against the data source.
FbDataAdapter is used in conjunction with FbConnection and FbCommand to increase performance when connecting to a FirebirdSQL Server database.
The FbDataAdapter also includes the SelectCommand, InsertCommand, DeleteCommand, UpdateCommand, and TableMappings properties to facilitate the loading and updating of data.
When an instance of FbDataAdapter is created, the read/write properties are set to initial values.
public static void CreateFbDataAdapter() { FbConnection conn = new FbConnection("Database=C:\\PROGRAM FILES\\FIREBIRD\\EXAMPLES\\EMPLOYEE.GDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost"); FbDataAdapter custDA = new FbDataAdapter(); FbTransaction txn = conn.BeginTransaction(); custDA.MissingSchemaAction = MissingSchemaAction.AddWithKey; custDA.SelectCommand = new FbCommand("SELECT custno, customer FROM CUSTOMER", conn, txn); custDA.InsertCommand = new FbCommand("INSERT INTO customer (CustomerID, customer) " + "VALUES (?, ?)", conn, txn); custDA.UpdateCommand = new FbCommand("UPDATE customer SET custno = ?, customer = ? " + "WHERE custno = ?", conn, txn); custDA.DeleteCommand = new FbCommand("DELETE FROM customer WHERE custno = ?", conn, txn); custDA.InsertCommand.Parameters.Add("@custno", FbDbType.Int32, 4, "custno"); custDA.InsertCommand.Parameters.Add("@customer", FbDbType.VarChar, 25, "customer"); custDA.UpdateCommand.Parameters.Add("@custno", FbDbType.Int32, 4, "custno"); custDA.UpdateCommand.Parameters.Add("@customer", FbDbType.VarChar, 25, "customer"); custDA.UpdateCommand.Parameters.Add("@oldcustno", FbDbType.Int32, 4, "custno").SourceVersion = DataRowVersion.Original; custDA.DeleteCommand.Parameters.Add("@oldcustno", FbDbType.Int32, 4, "custno").SourceVersion = DataRowVersion.Original; }
Namespace: FirebirdSql.Data.Firebird
Assembly: FirebirdSql.Data.Firebird (in FirebirdSql.Data.Firebird.dll)
FbDataAdapter Members | FirebirdSql.Data.Firebird Namespace