Represents an open connection to a Firebird database. This class cannot be inherited.
For a list of all members of this type, see FbConnection Members.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
FirebirdSql.Data.Firebird.FbConnection
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
A FbConnection object represents a individual connection to Firebird server.
If a FbConnection object goes out of scope, it is not closed, you must explicitly close the the connection by calling Close or Dispose.
public void InsertRow(string connectionString) { // If the connection string is null, use a default. if(connectionString == "") { FbConnectionStringBuilder cs = new FbConnectionStringBuilder(); cs.DataSource = "localhost"; cs.Database = "C:\\PROGRAM FILES\\FIREBIRD\\EXAMPLES\\EMPLOYEE.FDB"; cs.UserID = "SYSDBA"; cs.Password = "masterkey"; cs.Dialect = 3; connectionString = cs.ToString(); } FbConnection connection = new FbConnection(connectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); string insertQuery = "INSERT INTO PROJECT(proj_id, proj_name, product) Values('FBNP', '.NET Provider', 'N/A')"; FbCommand command = new FbCommand(insertQuery, myConn, myTxn); command.ExecuteNonQuery(); transaction.Commit(); connection.Close(); }
Namespace: FirebirdSql.Data.Firebird
Assembly: FirebirdSql.Data.Firebird (in FirebirdSql.Data.Firebird.dll)
FbConnection Members | FirebirdSql.Data.Firebird Namespace