Connect the PG database using the PG database via ODBC.
namespace Test {class mainClass {static void Main () {System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection (); System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand ( ); Conn.connectionstring = "driver = {postgreSQL}; server = 192.168.0.1; database = test; username = test; password = test;" Try {conn.open (); console.writeline ("{0}" CONN.STATE);} catch (Exception EE) {console.writeLine (Ee.Message);}}}}
PS: PG ODBC download address: http://laser.free-bsd.org/download/psqlodbc-07_03_0200.zip