Dear Database Experts,
I have developed a console UI application that, among other things, extracts a list of names from a PostgreSQL database. The application was written in C# language through Visual Studio Community 2022.
I used the Npgsql library to access PostgreSQL through C#
From my code, I access the database using the following connection string:
Such a connection string does not conform to the string formats on this website.
I am developing a GUI to replace the crude console UI.
I am learning to use WPF.
One of the tutorials I followed is concerned with extracting data from a SQL database and presenting them through WPF UI.
In the tutorial, the SQL database is accessed through a string copied from this website.
Instead of picking a connection string from this website, I used the above-mentioned connection string that works when I connect to PostgreSQL through C#.
I have included a reference to Dapper in my GUI and use the following connection statement:
IDbConnection connection = new System.Data.SqlClient.SqlConnection (Host=RTTQA-990-009;Port=5432;Username=postgres;Password=Rttqa123;Database=TrialsDB)
At runtime I get the following exception:
System.ArgumentException: Keyword not supported: 'host'
I would greatly appreciate your help and advice about how to properly connect to PostgreSQL.
Thank you so much in advance.