C# .NET + PostgreSQL

后端 未结 9 1772
执念已碎
执念已碎 2021-01-30 05:17

I\'m looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux b

相关标签:
9条回答
  • 2021-01-30 05:30

    Npgsql is excellent driver, but only issue Ive found so far is that Numeric value does not fit in a System.Decimal, so only option is correct each query or DB schema

    https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/438#issuecomment-486586272

    0 讨论(0)
  • 2021-01-30 05:33

    You shouldn't have too many problems. As others have mentioned, there's many .Net PostgreSQL data providers available. One thing you may want to look out for is that features like Linq will probably not be able to be used.

    0 讨论(0)
  • 2021-01-30 05:45

    I'm working with C# and Postgres using Npgsql2 component, and they work fast, I recommend you.

    You can download from https://github.com/npgsql/Npgsql/releases

    Note: If you want an application that works with any database you can use the DbProviderFactory class and make your queries using IDbConnection, IDbCommand, IDataReader and/or IDbTransaction interfaces.

    0 讨论(0)
  • 2021-01-30 05:45

    We have developed several applications using visual studio 2005 with the devart ado.net data provider for PostgreSql (http://www.devart.com/pgsqlnet/).

    One of the advantages of this provider is that it provides full Visual Studio support. The latest versions include all the new framework features like linq.

    0 讨论(0)
  • 2021-01-30 05:46

    Today most languages/platforms (Java, .NET, PHP, Perl etc.) can work with almost any DBMS (SQL Server, Firebird, MySQL, Oracle, PostgresSQL etc.) so I wouldn't worry for one second. Sure there might be glitches and small problems but no showstopper.

    As jalcom suggested you should program against a set of interfaces or at least a set of base classes (DbConnection, DbCommand and so on) to have an easily adaptable application.

    0 讨论(0)
  • 2021-01-30 05:51

    There is a Linq provider for PostgreSQL at https://www.nuget.org/packages/linq2db.PostgreSQL/.

    0 讨论(0)
提交回复
热议问题