Postgresql入门

下载

下载地址
需要FQ

使用PgAdmin

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

PostgreSQL关于C#的数据驱动——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>

参考资料:
Unable to find or load Npgsql with Entity Framework
The ADO.NET provider with invariant name 'Npgsql' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.

示例代码

.net core版本
.net版本

参考资料

EntityFramework6.Npgsql
npgsql efcore Getting Started
EF Core 入门

posted @ 2018-09-29 19:39  Lulus  阅读(544)  评论(0编辑  收藏  举报