What would be the PostgreSQL database connection string equivalent for a known sqlserver connection string

I have a c#  application which needs to write into sqlserver  and postgresql  databases.

I  use Dapper  ORM

I have been able to specify my connection string   for sqlserver  and it works

Now i am trying to specify  the equivalent  for  PostgreSQL  and I am getting the

Error   " OLE DB Provider  not Specified in the Connection String "

I have tried the following 3  providers

providerName="Npgsql2" />
providerName="Npgsql" />
providerName="SQLOLEDB" />

with same error message

Whats should be my provider string  for a c# application  connection to a

PostgreSQL database  using Dapper

Please Note that  I have Dapper  and   Npgsql installed in my application using Nuget

Attached please find error screen using the debugger and my connection string PostgreSQL

I will be grateful for an assistance

O.A.  Oluwole
OLE-DB-PROVIDER--24-09-2018.docx
Olukayode OluwoleSystems AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcelbaCommented:
Use one of the strings published here: https://www.connectionstrings.com/postgresql/
It seems Npgsql does not need providerName. If Npgsql does not work for you then you may try different method (ODBC, etc.)
0
lcohanDatabase AnalystCommented:
The error from your attachment related to OLE DB connection says pretty clear that "no OLE DB provider was specified in the connection string so you would have to change it as described here: https://www.connectionstrings.com/pgoledb/
in your case this would be like like the string below:

Provider=PostgreSQL OLE DB Provider;Data Source=localhost:5432;location=Tournaments;User ID=myUsername;password=myPassword;

If postgres is running on your local Windows computer the npgsql string should be like described here https://www.connectionstrings.com/npgsql/:

Server=localhost;Port=5432;Database=Tournaments;Integrated Security=true;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Olukayode OluwoleSystems AnalystAuthor Commented:
Tried your suggestion but still got the same error

See  attached  word document

What do you suggest i try next

Thanks

Olukay
OLE-DB-PROVIDER--24-09-2018.docx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.