Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring ASP.NET Development Server to connect to a postgres database
    primarykey
    data
    text
    <p>I have an existing ASP.NET app which is configured to connect to a MS SQL Server database and I am trying to modify it to use a postgres database instead.</p> <p>I would like to avoid modifying the C# code, if possible.</p> <p>I expected that the following changes would be sufficient:</p> <ol> <li>Add a reference to a suitable postgres driver, in this case <code>NauckIT.PostgreSQLProvider.dll</code></li> <li>Add a <code>provider</code> tag to specify the driver to use, in this case:</li> </ol> <pre> &lt;connectionStrings&gt; &lt;add name="default" connectionString="Server=127.0.0.1;Port=5432;User Id=finnw;Password=XXX;Database=default;Pooling=false" <b>providerName="Npgsql"</b> /&gt; &lt;/connectionStrings&gt; </pre> <p>But the <code>providerName</code> tag seems to have no effect (although it does not in itself generate an error.) Instead I still see this error message in the browser:</p> <pre><code>[ArgumentException: Keyword not supported: 'port'.] System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +4907604 System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98 System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55 </code></pre> <p>It looks as though it is still trying to use the MS SQL Server driver.</p> <p>How do I persuade it not to?</p> <p>I am using ASP.NET Development Server, not IIS. Initially I thought this might be the problem but <a href="http://pgfoundry.org/forum/forum.php?thread_id=1912&amp;forum_id=518" rel="nofollow noreferrer">this forum post</a> suggests otherwise.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload