tagged [dapper]

Multiple SQL statements in one roundtrip using Dapper.NET

Multiple SQL statements in one roundtrip using Dapper.NET There is a nice feature in ADO.NET that allows you to send multiple SQL statements to database in one roundtrip and receive results for all st...

1 Nov at 04:14

How to use Dapper in ServiceStack

How to use Dapper in ServiceStack Currently, I am using OrmLite for DB operations. I am also planning to use Dapper ORM, but can anyone point me how to integrate DapperORM in ServiceStack. Do I need t...

Dapper materializing to a Tuple

Dapper materializing to a Tuple I need return a list from dapper with the new tuple in C# 7. ``` public static List GetOnlyServices() { var query = $@" SELECT ST.style_id as StyleId, ST.st...

12 Jan at 17:52

Where to put sql when using dapper?

Where to put sql when using dapper? I'm using dapper for a mvc3 project at work, and I like it. However, how are you supposed to layer the application when using dapper? Currently I just have all my s...

How to read an SQL query generated by Dapper?

How to read an SQL query generated by Dapper? I have a standard code: ``` public IEnumerable ExperimentSelect(object parameters) { using (var connection = new SqlConnection(ConnectionString)) { ...

5 Sep at 23:46

How do I return an IEnumerable<> using ADO.NET?

How do I return an IEnumerable using ADO.NET? I've been using Dapper and with my current project I'm going to have to use ADO.NET. My question is how do I return an IEnumerable using ADO.NET? Here is ...

24 Jul at 15:41

Dapper unlimited multi-mapping

Dapper unlimited multi-mapping So I have a situation where I have to join (and map) more than 7 entities (which as far as I see is the current limitation of Dapper). This is what I've got so far (pseu...

4 Dec at 03:21

Passing Output parameters to stored procedure using dapper in c# code

Passing Output parameters to stored procedure using dapper in c# code I have a stored procedure in this format I am

Does Dapper work on Mono?

Does Dapper work on Mono? We're thinking about moving over to [Mono](http://www.mono-project.com) and I see that [Dapper](http://code.google.com/p/dapper-dot-net/) works with MySql. However this is wi...

28 Oct at 20:48

Adjusting CommandTimeout in Dapper.NET?

Adjusting CommandTimeout in Dapper.NET? I'm trying to run SQL backups through a stored procedure through Dapper (the rest of my app uses Dapper so I'd prefer to keep this portion running through it as...

9 Jan at 20:36

Using Dapper with Oracle stored procedures which return cursors

Using Dapper with Oracle stored procedures which return cursors How would one go about using [Dapper](http://code.google.com/p/dapper-dot-net) with Oracle stored procedures which return cursors? Here,...

12 Sep at 15:8

Dapper dynamic parameters throw a SQLException "must define scalar variable" when not using anonymous objects

Dapper dynamic parameters throw a SQLException "must define scalar variable" when not using anonymous objects (This code is using Dapper Dot Net in C#) This code works: This code throws a SqlException...

22 Nov at 16:45

System.Data.SqlClient.SqlConnection does not contain a definition for Query with dapper and c#

System.Data.SqlClient.SqlConnection does not contain a definition for Query with dapper and c# The following code when compiling gives the error message below: > 'System.Data.SqlClient.SqlConnection' ...

29 Oct at 02:43

Map string to guid with Dapper

Map string to guid with Dapper I'm using Dapper to hammer out some load testing tools that need to access a PostgreSQL database. This particular version of PostgreSQL does not support GUIDs natively, ...

6 May at 09:23

Can AnsiStrings be used by default with Dapper?

Can AnsiStrings be used by default with Dapper? I'm using Dapper against a database where strings are stored primarily in `VarChar` columns. By default Dapper uses `NVarChar` parameters when generatin...

17 Jun at 13:12

Can I specify DB column names for dapper-dot-net mappings?

Can I specify DB column names for dapper-dot-net mappings? Is there a way with dapper-dot-net to use an attribute to specify column names that should be used and not the property name? ``` public clas...

29 Aug at 18:4

How can I get my dapper result to be a List?

How can I get my dapper result to be a List? Why I can't add a `.ToList()` on this? The only thing Intellisense is allowing is `.ToString()`. ``` //.. string sqlQuery = "SELECT sum(SellingPrice) as Se...

20 Sep at 18:58

CancellationToken with async Dapper methods?

CancellationToken with async Dapper methods? I'm using Dapper 1.31 from Nuget. I have this very simple code snippet, ``` string connString = ""; string query = ""; int val = 0; CancellationTokenSource...

Dapper insert, check for existence of record

Dapper insert, check for existence of record So i have been using this method to insert records into my database: I now need to modify this, to first check if the Item/id are already in the database,

31 Mar at 11:30

Why does Dapper need a reference to the transaction when executing a query?

Why does Dapper need a reference to the transaction when executing a query? Just looking through this tutorial: [https://www.davepaquette.com/archive/2019/02/06/managing-transactions-in-dapper.aspx](h...

31 Oct at 10:2

Performing Inserts and Updates with Dapper

Performing Inserts and Updates with Dapper I am interested in using Dapper - but from what I can tell it only supports Query and Execute. I do not see that Dapper includes a way of Inserting and Updat...

10 May at 23:54

Can a Dapper DynamicParameters object be enumerated like a dictionary of parameters?

Can a Dapper DynamicParameters object be enumerated like a dictionary of parameters? I know I can use a `ParameterDirection` with Dapper.DynamicParameters: But can I do so when using a `Dictionary

25 Sep at 02:42

Is there a way to call a stored procedure with Dapper?

Is there a way to call a stored procedure with Dapper? I am very impressed with the results of [Dapper Micro ORM](https://github.com/StackExchange/dapper-dot-net) for stackoverflow.com. I am consideri...

12 Jun at 06:19

How do I handle Database Connections with Dapper in .NET?

How do I handle Database Connections with Dapper in .NET? I've been playing with Dapper, but I'm not sure of the best way to handle the database connection. Most examples show the connection object b...

3 Apr at 18:46

How to retrieve a single value from the database using Dapper

How to retrieve a single value from the database using Dapper I'm using Dapper and trying to retrieve a short from the database and would like to do this without grabbing it from a collection. I've go...

18 Jul at 07:3