I want to connect to the tableau PostgreSQL server from my .Net framework to list all the reports and datasources published in the tableau server.
For doing this, I have done the following steps.
- Added the npgsql.dll reference that i downloaded online
Added the below two namespaces in my class file
using NpgsqlTypes; using Npgsql;
I added the connection sting as follows
I also tried with modifying the connection string with port value and renaming the DataSource to Server, Initial catalog to Database and provider Name to Npgsqll
My Method is as follows:
public DataTable getAllDataSourceNames() { DataTable dataSourceNames = new DataTable(); NpgsqlConnection conServer = new NpgsqlConnection(conString); conServer.Open(); string command = @"select * from datasources"; NpgsqlDataAdapter sqlcmd = new NpgsqlDataAdapter(command,conServer); sqlcmd.Fill(dataSourceNames); return dataSourceNames; }`No error. I can build and run successfully the other links in the website. But cannot cannot establish connection to my postgresql server.
Any idea of how to establish the connection?
conStringcame from?