Samples

Using PGNP with Microsoft .NET

Samples

Postby Moderator » Sat Apr 11, 2009 6:01 pm

When installed, PGNP contains following samples under \samples\<language> folders.

C#:
01_GetRecords.cs demonstrates how programmatically connect to PostgreSQL database and get records from pgnp_samples.contact table.
02_SingleValue.cs demonstrates getting single value from database. It reads number of contacts with last name starting with 'S'.
03_InsertUpdateDelete.cs demonstrates creation of a temporary table, records insert, update and delete.
04_CommandParameters.cs demonstrates passing positional and named parameters to a command.
05_StoredProcedures.cs demonstrates how to call stored procedures returning a single result and multiple results.

10_Arrays.cs demonstrates how to query multidimentional arrays in .NET.
11_NestedTransactions.cs demonstrates how to work with nested transactions in .NET.
12_DistribTrans.cs demonstrates how to work with distributed transactions in .NET (TransactionsScope object).
Important: Make sure that "Distributed Transaction Coordinator" system service is running before launching this test.
13_SavePoints.cs demonstrates how to control transactions via PostgreSQL SAVE POINTs.

CPP:
ADOEvents demonstrates howto subscribe for ADO connection and recordset events.
OLEDBTemplates demonstrates:
* howto pass input parameters and get output parameters from stored procedure using OLEDB templates (StoredProcParams.cpp).
* howto select records from a table and insert data using OLEDB templates (SelectInsert.cpp).

Delphi:
TestGrid demonstrates howto populate grid with records from database.
User avatar
Moderator
Site Admin
 
Posts: 279
Joined: Wed Oct 29, 2008 11:27 pm

Return to .NET

Who is online

Users browsing this forum: No registered users and 1 guest