npgsql

How to install Npgsql as a data provider for ADO.NET Entity Framework?

随声附和 提交于 2019-12-11 03:36:05
问题 I have read all that I can find, but no luck. In Visual Studio 2015 Community, here is what I did (with no luck): Ran: Setup_NpgsqlDdexProvider. This installed Npgsql 3.0.7 and EntityFramework 6.0.0. It also installed Npgsql 3.0.7 in the GAC and the machine.config. install EntityFramework6.Npgsql Updated the Npgsql (with Nuget) to version 3.1.6 Updated the EntityFramework to version 6.1.3 Updated the GAC to Npgsql 3.1.6 changed the machine.config at %SystemRoot%\Microsoft.NET\Framework\v4.0

Npgsql on mono: “An operation is already in progress.”

淺唱寂寞╮ 提交于 2019-12-10 18:21:44
问题 Using v3.0.3 of Npgsql and my app works fine on my PC. When I run it on my RaspPI2 with Mono, I get an error in the title. After getting the error the first time, I put a lock() around the section. After getting the error again, I add "Pooling=false" to the connection string, thinking perhaps that another part of the app was actively consuming data. This application uses the MySQL connector just fine. The code below, should be the first instance of where I access my Postgres db. (updated)

Unable to determine the provider name for provider factory of type 'Npgsql.NpgsqlFactory'

做~自己de王妃 提交于 2019-12-10 16:58:55
问题 I trying running a test project but I not have a success because have a fail with npgsql connection. I reinstalled Npgsql, Npgsql.EntityFramework, EntityFramwork... but the problem persist. Result Message: Método de teste TestUserControl.ControleBaseTest.TesteGetPermissoesUsuarioFixo gerou exceção: System.NotSupportedException: Unable to determine the provider name for provider factory of type 'Npgsql.NpgsqlFactory'. Make sure that the ADO.NET provider is installed or registered in the

PostgreSQL error: query string argument of EXECUTE is null

孤者浪人 提交于 2019-12-10 15:48:06
问题 I have a table called evidence with a trigger which calls a stored procedure which basically does table partitioning by month. However I get an obscure error when I start inserting lots of rows under load: Npgsql.NpgsqlException: query string argument of EXECUTE is null Severity: ERROR Code: 22004 at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext() in c:\C#Apps\github.npgsql.Npgsql.stock\src\Npgsql\NpgsqlState.cs:line890 at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject(

SemaphoreSlim to protect the connection pool from exhaustion

僤鯓⒐⒋嵵緔 提交于 2019-12-10 11:47:26
问题 I have a microservice (Web API) within an eventdriven architecture receiving messages from RabbitMQ and it is supposed to save them into a PostgreSQL DB using ADO.NET. Unfortunately, my connection pool (currently set to 50) gets exhausted quite fast, giving me this error message: The connection pool has been exhausted, either raise MaxPoolSize My RabbitMQ Consumer is set up like this (Singleton): public class Listener : RabbitMqConnection { public AsyncEventingBasicConsumer _asyncConsumer;

Npgsql BeginTextImport try import from file (not from STDIN)

烂漫一生 提交于 2019-12-10 09:37:53
问题 I try import data to postgresql table from file via npgsql BeginTextImport This is my code: public Object Copy(String sSchemaAndTableName, String sFilePath, Boolean bIsImport) { Boolean bRet = true; Object oResult = new Object(); NpgsqlConnection conn = new NpgsqlConnection(sConnectionString); NpgsqlCommand cmd = new NpgsqlCommand(); try { conn.Open(); NpgsqlTransaction transaction = conn.BeginTransaction(); if (File.Exists(sFilePath)) { try { if (bIsImport) { conn.BeginTextImport("COPY " +

Npgsql can't find NpgsqlException when doing Migrations

a 夏天 提交于 2019-12-10 09:28:28
问题 When I do an update-database and an error happens at the database I get: System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Npgsql.NpgsqlException,Npgsql, Version=2.2.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. Its trying to tell me about an error but I presume it can't find the exception type its trying to wrap it in so I'm left guessing at my mistake. I'm using version 2.2.5.0 Npgsql.EntityFramework which is currently the latest version. 回答1:

npgsql LINQ creates SQL Server sql syntax

假装没事ソ 提交于 2019-12-10 09:21:30
问题 I'm trying to use LINQ with Npgsql 2.0.11 in a .NET v3.5 project. I'm trying my first simple query from a data table, and I've found that the syntax sent to Postgresql is SQL Server syntax, not Pgsql syntax, causing the server to throw a syntax error. I have added the factory generation to the project's App.config as suggested by the documentation: <system.data> <DbProviderFactories> <add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for

NHibernate Postgresql DateTime to Time Conversion

半腔热情 提交于 2019-12-09 21:44:49
问题 I'm using Fluent NHibernate to configure my mappings everything works when reading data but when trying to insert or update records that have a Postgresql type of Time I get the error message "ERROR: 42804: column \"run_time\" is of type time with time zone but expression is of type timestamp without time zone" It looks like NHibernate might be confused on which DbType to convert the DateTime to as you can see from PostgreSQL and C# Datatypes that there are several DbTypes that DateTime map

Case insensitive name of tables and properties in Entity Framework 7

喜欢而已 提交于 2019-12-09 13:09:17
问题 I use Entity Framework 7 with Npgsql adapter. Sql generated by EF seems like SELECT "r"."Id", "r"."Name" FROM "public"."Role" AS "r" and it doesn't work in Postgres, because case-sensitive policy. To make it work i need to write create table script CREATE TABLE "Role" ( "Id" int, "Name" varchar(200) ); But it's ugly. Is there the way to make EF generate scripts without quotes or with lowercase naming style? 回答1: There's a very good reason Npgsql generates quotes everywhere - so you definitely