Connect PG Database by ODBC, C #

xiaoxiao2021-03-06  130

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

转载请注明原文地址:https://www.9cbs.com/read-127150.html

New Post(0)