Postgresql入门

下载

https://www.postgresql.org/download/
需要FQ

使用PgAdmin

PgAdmin是访问PostgreSQL数据库的图形化工具
连接数据库
91ef76c6a7efce1bac5eaec7a651f3deb48f6541
Navicat也可以连接PostgreSQL

PostgreSQL关于C#的数据驱动——Npgsql

官方资料:https://github.com/npgsql/npgsql
安装包

.net framework
EntityFramework6.Npgsql
https://github.com/npgsql/EntityFramework6.Npgsql
.net core
Npgsql.EntityFrameworkCore.PostgreSQL
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.Design
https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL
解决报错

The ADO.NET provider with invariant name 'Npgsql' is either not registered in the machine or application config file, or could not be loaded.

<system.data>
  <DbProviderFactories>
    <remove invariant="Npgsql" />
    <add name="Npgsql Data Provider" invariant="Npgsql" description=".Net Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" support="FF" />
  </DbProviderFactories>
</system.data>

参考资料:
https://stackoverflow.com/questions/35425249/unable-to-find-or-load-npgsql-with-entity-framework
https://github.com/npgsql/npgsql/issues/1439

示例代码

https://github.com/zLulus/NotePractice/tree/dev3/Console/CodeLibraryForDotNetCore/UsePostgresql
https://github.com/zLulus/NotePractice/tree/dev3/Console/CodeLibrary/UsePostgresql

参考资料

https://github.com/npgsql/EntityFramework6.Npgsql
http://www.npgsql.org/efcore/index.html
https://docs.microsoft.com/en-us/ef/core/get-started/netcore/new-db-sqlite

转载于:https://www.cnblogs.com/Lulus/p/9726383.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值