npgsql

PostgreSQL: command is already in progress

北城以北 提交于 2021-02-05 11:12:39
问题 My asynchronous function tries to select a single record from a table. This function accepts a few arguments passed from another function. So, some processes (6 at least) can use it simultaneously. Often I get an error with the message "command is already in progress" . I know that the problem hides in the reader, because the reader is busy when another process tries to access it. Let me publish the full code below: async private void InsertToLog(List<Printer> APrinter, List

PostgreSQL: command is already in progress

我是研究僧i 提交于 2021-02-05 11:12:35
问题 My asynchronous function tries to select a single record from a table. This function accepts a few arguments passed from another function. So, some processes (6 at least) can use it simultaneously. Often I get an error with the message "command is already in progress" . I know that the problem hides in the reader, because the reader is busy when another process tries to access it. Let me publish the full code below: async private void InsertToLog(List<Printer> APrinter, List

Create database context from cookie and base path in Entity Framework Core

流过昼夜 提交于 2021-01-29 11:16:54
问题 Postgres database has multiple schemes like company1, company2, ... companyN Browser sends cookie containing scheme name . Data access operations should occur in this scheme. Web application user can select different scheme. In this case different cookie value is set. Npgsql EF Core Data provider is used. ASP NET MVC 5 Core application registers factory in StartUp.cs : public void ConfigureServices(IServiceCollection services) { services.AddHttpContextAccessor(); services.AddScoped

Can't create .edmx file for postgresql use entityframework + npgsql

佐手、 提交于 2021-01-29 03:35:34
问题 I want to create ADO.NET entity data model - database first (.edmx file) with EntityFramework6.Npgsql but it's error. I have installed: - EntityFramework6.Npgsql (version 6.3 newest) - Npgsql (version 4.1.1 newest) - EntityFramework (version 6.3 newest) I created it before, but I don't know why now! Please help me.... 回答1: This is a known issue that is already tracked on github In the meantime for those having issues with the latest version of the VSIX (4.1.1.2), please downgrade back to 4.0

The type initializer for 'Npgsql.TypeMapping.GlobalTypeMapper' threw an exception

风格不统一 提交于 2021-01-28 20:10:58
问题 Using Visual Studio 2017 try using the Server Explorer to add a connection to a Postgres database. Click Test connection. The issue An error is shown with: The type initializer for 'Npgsql.TypeMapping.GlobalTypeMapper' threw an exception. Before that I installed System.Runtime.CompilerServices.Unsafe v4.5.2 and System.Numerics.Vectors v4.4.0 to fix the error message "Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1" and Could not load file or assembly

In a MS SSAS Project, creating a Data Source View over Npgsql (PostgreSQL) Data Source produces 42601: syntax error at or near '['

ぐ巨炮叔叔 提交于 2021-01-28 09:39:03
问题 I'm trying to create Data Source View in a Multidimensional SSAS project using MS Visual Studio 2017 with SSDT installed. In the Data Source View Wizard, I select my Npgsql (v. 11.00) based datasource connecting my PostgreSQL 10.5 I created before. No matter which options I select or which tables I choose to work with in the dialogues that follows, after I click the final Finish button I always retrieve a message box stating that "42601: syntax error at or near '['" and preventing me from

In a MS SSAS Project, creating a Data Source View over Npgsql (PostgreSQL) Data Source produces 42601: syntax error at or near '['

拜拜、爱过 提交于 2021-01-28 09:31:04
问题 I'm trying to create Data Source View in a Multidimensional SSAS project using MS Visual Studio 2017 with SSDT installed. In the Data Source View Wizard, I select my Npgsql (v. 11.00) based datasource connecting my PostgreSQL 10.5 I created before. No matter which options I select or which tables I choose to work with in the dialogues that follows, after I click the final Finish button I always retrieve a message box stating that "42601: syntax error at or near '['" and preventing me from

Postgresql: How to use curl with function

笑着哭i 提交于 2021-01-28 08:20:22
问题 I have a function parse_sdf(text) . When I call the function like this: INSERT INTO test.table("Id", "Test") (SELECT props -> 'Id', props -> 'Test' FROM parse_sdf()); When I execute the INSERT with pgsql I want to pass as a parameter a text file which I download via curl . Like this: INSERT INTO test.table("Id", "Test") (SELECT props -> 'Id', props -> 'Test' FROM parse_sdf('curl http://test/Files/text.txt')); But it doesn't work. Is there a way to accomplish this? UPDATE: Postgres version: 10

Unable to load System.Threading.Tasks.Extensions

倾然丶 夕夏残阳落幕 提交于 2021-01-21 06:37:21
问题 I have a web project build on .net framework 4.5.1. We are trying to added PostgreSQL support for the project. Using Nuget, I have installed 4.0.4 npgsql to the project. Under references, I see the following being added to the project. Npgsql - 4.0.4.0 - Runtime version v4.0.30319 System.Threading.Tasks.Extensions - 4.2.0.0 - Runtime version v4.0.30319 When I tried run the project and connect and get the data from the database, I am getting the following error saying FileNotFoundException:

How to use WebMatrix methods with Npgsql in .NET MVC Core 5

感情迁移 提交于 2021-01-07 04:33:59
问题 I want to use WebMatrix.Data namespace #region Assembly WebMatrix.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 // .. \packages\Microsoft.AspNet.WebPages.Data.3.2.7\lib\net45\WebMatrix.Data.dll with Npgsql data provider in ASP MVC Core 5. In web.config it is defined as <system.data> <DbProviderFactories> <clear /> <add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql