The following notes apply to C# programming. Visual Basic is similar, and applications can also be developed in Java and Prolog. The database connection is provided using the standard IDbConnection interface
var db = new PyrrhoConnect(connectionstring);
The connection string can be as simple as "Files=dbname". In runtimes not based on ADO.NET, such as Silverlight or WindowsPhone, the IDbConnection interface is not defined, but The PyrrhoConnect class provides a similar API, so that the following notes still apply. The function Pyrrho.PyrrhoConnect is provided in PyrrhoLink.dll or OSPLink.dll. The other runtimes are in EmbeddedPyrrho.dll, OSP.dll, SilverlightOSP.dll or PhoneOSP.dll.
The connection must be opened before it can be used:
Connections should be closed when no longer required:
An application may use this cycle many times during its operation, as connections may be opened using different roles. Uncommitted transactions are silently rolled back when the connection is closed. For other details of the IDbConnection interface, see the ADO.NET documentation. Two functions in this interface described below are CreateCommand and BeginTransaction .
As usual with ADO.NET, at most one IDataReader or PyrrhoReader can be open for any connection. Remember to close the IDataReader before calling another ExecuteReader.
Note that SQL is not normally case sensitive. If you want SQL identifiers to be case sensitive, you will need to double-quote them, and in C# strings, the double-quote will need to be escaped.