zzz projects Dapper Tutorial
Getting Started Documentation 3rd Party Libraries Knowledge Base Online Examples
  • Getting Started
  • Documentation
  • 3rd Party Libraries
  • Knowledge Base
  • Online Examples
  •   Download  

Dapper Tutorial - Knowledge Base (KB)

42 results for: in tag: npgsql

Dapper: can I use parameters for anything?

I am writing some code that will prepare my database for my application. In the code there are some repetitive SQL statements when I am creating a table, and I want to hide them in some methods (there are only two for now: creating the primary key and mak...
dapper npgsql parameter-passing
asked by vhallac

PostgreSQL, problems with Boolean type storing values as "T" and "F" breaking ORM

If I define a boolean data type in a Postgres table and query from it, the results for the boolean columns come back as "t" or "f"....I'm using NPGSQL as my driver and Dapper as a ORM. This causes a problem because Dapper is unable to convert "t" or "f" i...
dapper npgsql postgresql
asked by Jonathan Holland

AsyncQuery with postgresql and dapper using npqsql

I was trying dapper orm and recently they added asyncquery support. I googled it about that. It is wonderful if you have heavy traffic on your site. I was trying that with postgressql and dapper. Now, in connection if I am passing simple connection string...
async-await c#-4.0 dapper npgsql postgresql
asked by kunjee

Why does Dapper generate different SQL with/without a mini-profiler connection

Dapper (1.13 Noobget Package) creates different SQL statements depending on if it's used with a plain ADO.NET database connection or with a decorated mini-profiler database connection....Example code (tested with Postgresql)...Usings:...using System.Linq;...
dapper mvcminiprofiler mvc-mini-profiler npgsql
asked by stmax

PostgreSQL missing operator when using IN predicate with string array

Given this table structure:...CREATE TABLE tags ( id SERIAL NOT NULL PRIMARY KEY, tagname TEXT NOT NULL UNIQUE, authorid int NOT NULL, created timestamp NOT NULL, lastmodified timestamp NOT NULL, constraint fk_authorid_tags foreign key(author...
c# dapper npgsql postgresql
asked by Oliver Weichhold

Issue with inserting null value array property using Dapper and Npgsql2

I'm currently investigating a problem with executing an insert using Dapper's Execute in conjunction with the Npgsql2 managed provider for PostgreSQL 9.3....Table Structure (simplified):...CREATE TABLE posts ( id SERIAL NOT NULL PRIMARY KEY, title TEX...
c# dapper npgsql postgresql sql
asked by Oliver Weichhold

Unpredictable Npgsql Exception During Transaction Dispose

I am attempting to run some commands in a transaction using Npgsql 2.1.3 (Postgres v9.3) and Dapper 1.29, but am occasionally getting some unexpected exceptions. Sometimes, the code works just fine. Other times, I am getting the following exception:...N...
c# dapper npgsql postgresql-9.3 transactions
asked by Jeff G

Dapper Bulk Insert Returning Serial IDs

I am attempting to perform a bulk-insert using Dapper over Npgsql, that returns the ids of the newly inserted rows. The following insert statement is used in both of my examples:...var query = "INSERT INTO \"MyTable\" (\"Value\") VALUES (@Value) RETURNIN...
c# dapper npgsql postgresql-9.3
asked by Jeff G

Dapper parameters not working with PostgreSQL through npgsql connection, is postgres anonymous function parameterization supported?

I'm trying to use dapper to parameterize a postgres anonymous function i've written to do an upsert. Here's the code:...private static int UpsertProductPrice( IDbConnection connection, Data.ProductPrice price, List<Data.ProductPric...
c# dapper npgsql postgresql
asked by Perry R

Npgsql 3.0.0 Fails to Parse Enumerated Types

I have enumerated types in Postgres, defined as follows:...CREATE TYPE "SomeEnumType" AS ENUM ( 'Val1', 'Val2' ); ...I have the equivalent enum defined in C#:...public enum SomeEnumType { Val1, Val2 } ...When I updated to Npgsql v3.0.0, de...
c# dapper npgsql postgresql
asked by Jeff G

Npgsql 3.0.0 Chokes on Queries with Parameters that have Custom Type Handlers in Dapper 1.42

This issue appears to be with something in Npgsql 3.0.0 that changed from under Dapper 1.42. I came to that conclusion since the following code used to work when using Npgsql 2.2.3 with the same version of Dapper:...public struct MyStruct { private r...
c# dapper npgsql postgresql
asked by Jeff G

Dapper IPAddress/PhysicalAddress/Enum Parameter Support Over Npgsql v3

Npgsql supports parsing ...System.Net.NetworkInformation.PhysicalAddress... and ...System.Net.IPAddress... from query result sets of type ...macaddr... and ...inet..., respectively. For example, the following class can be populated using Npgsql with Dap...
c# dapper npgsql
asked by Jeff G

"ERROR: 57014: canceling statement due to user request" Npgsql

I am having this ...phantom... problem in my application where one in every 5 request on a specific page (on an ASP.NET MVC application) throws this error:...Npgsql.NpgsqlException: ERROR: 57014: canceling statement due to user request at Npgsql.Npgsql...
command dapper npgsql postgresql
asked by gyosifov

"WHERE x IN y" clause with dapper and postgresql throwing 42601: syntax error at or near \"$1\"

I have an array of strings, and I'd like to have a query containing an IN clause, like:..."... WHERE t.name IN ('foo', 'bar', 'baz')..>" ...Here's the final bit of my query, which contains a "where X in Y" clause:...... left join genre_tag_band_join tj on...
asp.net-mvc c# dapper npgsql postgresql
asked by Sava B.

Dapper and Npgsql throws exception by use EXPLAIN with IN-clause and List<int>

I try to fetch an execution plan from Postgresql via Npgsql and Dapper....And versions of used software.....Net Framework 4.6.1...ASP.NET WebAPI 2...Postgresql 9.4...Npgsql v3.0.5...Dapper v1.42.0...Non-EXPLAIN query with IN-clause with List<int> can fetc...
c# dapper npgsql postgresql
asked by t2k

Postgresql NpgSql connection handling extra query and multiple close connection

I am basically running a sql query through dapper but when I do some profiling on this on every query that i perform to npg sql I see an extra ...ExecuteScalar... query that is sent on that connection. And there are multiple ...NpgsqlConnection.Close... e...
.net c# dapper npgsql postgresql
asked by MoXplod

PostgreSQL, Npgsql returning 42601: syntax error at or near "$1"

I'm trying to use Npgsql and/or Dapper to query a table and I keep running into ...Npgsql.PostgresException 42601: syntax error at or near "$1"....Here is what I've got trying it with NpgsqlCommand:... using (var conn = new NpgsqlConnection(System.Config...
dapper npgsql postgresql
asked by Tyler Jennings

How to call a stored procedure with a mixed-case name from Dapper (with Npgsql)?

From NuGet, I am using......\packages\Npgsql.2.2.5\lib\net45\Npgsql.dll......\packages\Dapper.1.42\lib\net45\Dapper.dll...In calling a stored procedure in PostgreSQL, I have need to preserve the ...case of the procedure name... as...var x = cnn.Query<icd9...
dapper npgsql postgresql stored-procedures
asked by Alan Wayne

Cannot select some rows with npgsql on a "Portuguese" database

I have a postgresql database that was created with "SQL_ASCII" and template "template0". It holds data in Portuguese so I have data such as "Não", "Feijão", "Avô". When I try to retrieve rows that have these kind of characters "~^" it does not work, ot...
c# dapper encoding npgsql postgresql
asked by Murilo

Using Dapper and Postgresql - citext data type

I'm not sure if there is a way to support this, but I'm having trouble getting Dapper to map string parameter values to the Postgresql citext data type as it seems to be using the text type....In particular, I'm trying to call a function that takes in cit...
dapper npgsql postgresql
asked by Michael Brown

Page 1 of 3
  • 1
  • 2
  • 3
  • ยป

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...