c# - Additional information: Failed to establish a connection to 'Server' -
i'm trying create service update postgresql database using topshelf, npgsql , c# following error when trying connect database.
a first chance exception of type 'npgsql.npgsqlexception' occurred in npgsql.dll
an exception of type 'npgsql.npgsqlexception' occurred in npgsql.dll not handled in user code
additional information: failed establish connection 'hostname'
this connection string.
conn = new npgsqlconnection("server=hostname;port=5432;user id=uid;password=pass; database=dbname;");
i use the same connection line asp.net c# webapp working fine. pg_hba.conf file has line host all 0.0.0.0/0
md5
, postgresql.conf
file has line listen_addresses = '*'
. able connect database through pgadmin same log in credentials. have added rule firewall on computer port 5432 , host server not have firewall enabled.
i tried run same code on same system postgresql server hosted using localhost server , received same error.
Comments
Post a Comment