title: Unable to connect to Heroku Postgres from a .NET application (Npgsql)
body: <p>I'm trying to connect to a Heroku Postgres database (Hobby-dev level) from a C# Windows Forms application using the Npgsql provider and Entity Framework (latest versions), and I'm getting a ProviderIncompatibleException with the following inner exceptions:</p>
  
  <blockquote>
    <p>"The provider did not return a ProviderManifestToken string." "FATAL:
    42501: permission denied for database \"postgres\"" Detail: "User does
    not have CONNECT privilege."</p>
  </blockquote>
  
  <p>The database is accessed by a Ruby on Rails app also running on Heroku, and I'm able to access it through pgAdmin III on Windows. I think it's not an issue with Npgsql since the connection is working perfectly with both local and remote PostgreSQL development databases.</p>
  
  <p>The connection string I'm using in the app.config file looks like this:</p>
  
  <pre><code>Server=HerokuAmazonAWS;Port=5432;Database=MyHerokuDatabase;User Id=MyHerokuUsername;Password=MyHerokuPassword;SSL=true;SslMode=Require;
  </code></pre>
  
  <p>Since Heroku requires an SSL connection to the DB, I've set it in the connection string, so this doesn't appear to be an issue. This "permission denied for database postgres" error bothers me, because I'm not trying to connect to the <em>postgres</em> db on that server. Do you have any ideas what could be causing this and how to fix it? Thanks.</p>