Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I am using ASP.net application try to connect with PostgreSQL server hosted in my machine.
I have successfully connected my database and able to access.
When i host my application in another server (within the same network) and try to connect PostgreSQL database server via application i am getting "Exception while connecting" error occurred.

Connection String:
Server=127.0.0.1;UserId=postgres;Password=123;Database=TestDB;


Could you please share how to resolve this issue. Thanks in advance.

What I have tried:

I have tried with port no. is connection string as like below.

Server=127.0.0.1;Port=5432;UserId=postgres;Password=123;Database=TestDB;
Posted
Updated 20-Jun-21 5:19am

1 solution

127.0.0.1 is LOCALHOST. That means your connection string assumes the SQL server and the web server are running on the same machine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900