I have a problem with connection to my PSQL database. I made a program in C# and when I published it and placed it on another PC (set that it gets data from db on PC that I programmed application), it worked perfectly. Now I wanted to transfer that db to another PC that will run 24/7, and I had a struggle doing that, but I made it (manually in the end). Now when db is set on that 24/7 PC, I can't connect to it. For ex. When I start my program from laptop that I used for programming, I get this:
My connection string looks like this:
string Connectionstring = "Server=192.168.130.240;Port=5433;User Id=postgres;" +
"Password=password;Database=postgres;";
NpgsqlConnection conn = new NpgsqlConnection(Connectionstring);
conn.Open();
P.S. One difference that I noticed is that on my laptop that I used to program my connection string was the same only with IP: 127.0.0.1, and whenever I open PSQL it automatically starts and its already logged in, but on this 24/7 PC when I start psql.exe it starts and then shuts down, but when I start SQL Shell(PSQL) I need to put in server,database,port,username and password every time I start it.
If someone has any idea how to fix this, please help because this is last step of my project and I can't get it to work...