0

I installed BLToolkit PostgreSql Data Provider 4.1.17 via package manager console. BlToolkit.4 is also installed to the project. But I couldn't connect to db yet. The error I encountered and web config is below. Any advice?

Error String:

key=value argument incorrect in ConnectionString

web.config:

<configuration>
    <BLToolkit>
        <dataProviders>
            <add type="BLToolkit.Data.DataProvider.PostgreSQLDataProvider" />
        </dataProviders>
    </BLToolkit>
    <configSections>
        <section name="BLToolkit" type="BLToolkit.Configuration.BLToolkitSection, BLToolkit.Data.DataProvider.PostgreSQL.4" />
    </configSections>
    <connectionStrings>
        <add name="DbCon"
             connectionString="Data Source=postgresql-x64-9.2;database=postgres;User Id=postgres; password=..."
             providerName="Npgsql" />
    </connectionStrings>
</configuration>

Connection:

public class Database: DbManager
    {
        public Database() : base("DbCon")
        {
        }
    }
serefbilge
  • 1,654
  • 4
  • 29
  • 55
  • Clearly the error message was referring to the `connectionString` attribute and yet you did not provided it (even an obfuscated version of it). Did you expect us to use a crystal ball to guess what's the issue? – Milen A. Radev Mar 01 '13 at 13:08
  • I did'nt think it is about connection string when I had written the question. – serefbilge Mar 01 '13 at 14:16

1 Answers1

1

The problem was about connection string,

<add name="DbCon" providerName="Npgsql" connectionString="server=localhost;database=postgres;User Id=postgres; password=..." />

solved the problem.

serefbilge
  • 1,654
  • 4
  • 29
  • 55