我通过包管理器控制台安装了BLToolkit PostgreSql Data Provider 4.1.17。BlToolkit。4 .也安装到工程中。但是我还不能连接到db。我遇到的错误和web配置如下。任何建议吗?
错误字符串:
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>
连接:
public class Database: DbManager
{
public Database() : base("DbCon")
{
}
}
问题是关于连接字符串,
<add name="DbCon" providerName="Npgsql" connectionString="server=localhost;database=postgres;User Id=postgres; password=..." />
解决了问题