I am using the following connection string in my c# application to communicate to my database which is hosted locally.
string conn = String.Format("Server={0};Port={1};" +
"User Id={2};Password={3};Database={4};",
"localhost", "5432", "postgres",
"postgres", "table");
NpgsqlConnection connection = new NpgsqlConnection(connstring);
connection.Open();
NpgsqlCommand sqlcmd = new NpgsqlCommand("SELECT * FROM public.roads", connection);
NpgsqlDataReader r = sqlcmd.ExecuteReader();
Is there a way I can add the server information in config.app file and access it in my code?