Click here to Skip to main content
15,884,472 members
Everything / Dapper

Dapper

dapper

Great Reads

by Mishael Ogo
A look at a simple SQL builder for Dapper
by Yin Kan (Gavin) Lee
Stream large result set from Web API to WPF on background thread and display on Datagrid
by Cathy Wun
This is the first part of Building an Employee Tracker using AngularJS and ASP.NET Web API Series.
by Rick Drizin
Dapper Query Builder using String Interpolation and Fluent API

Latest Articles

by Mishael Ogo
A look at a simple SQL builder for Dapper
by George Swan
An introduction to employing Dapper in an ASP.NET 7 application
by Rick Drizin
Dapper Query Builder using String Interpolation and Fluent API
by Rahul Rajat Singh
How to use dapper to read mutiple resultsets from database in a single database call

All Articles

Sort by Score

Dapper 

U 16 Apr 2024 by Mishael Ogo
A look at a simple SQL builder for Dapper
25 Dec 2014 by Yin Kan (Gavin) Lee
Stream large result set from Web API to WPF on background thread and display on Datagrid
31 Jan 2017 by Cathy Wun
This is the first part of Building an Employee Tracker using AngularJS and ASP.NET Web API Series.
22 Jul 2016 by Richard Deeming
That stored procedure doesn't return any records; it uses the return value instead. This needs to be handled as a parameter:public int CheckIfUserIsInRole(IsUserInRole userInRole){ using (var connection = new SqlConnection(ConfigurationSettings.GetConnectionString())) { ...
28 Aug 2017 by OriginalGriff
You are trying to return it as a string - if it's a GUID column, then you want something like return (con.Query("Usp_UserIDbyUserName", param, null, true, 0, CommandType.StoredProcedure).SingleOrDefault()).ToString();
27 May 2020 by Richard Deeming
Quote: var p= new DynamicParameter(); modell.QuantityAgain= p.Get("quantity").ToString(); It's hardly surprising that Get fails, given that you've literally just created the DynamicParameters object, and haven't added any parameters to...
21 Jun 2020 by User 11060979
Now I did not expected that only the missing closing bracket was the problem. But according to OP's comment above it was. using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString("Tournaments")) needs to...
7 Oct 2020 by Gerry Schmitz
Move to Entity Framework Core. The level of support (docs) compared to EF 6.0 should make EF 6.0 a non-starter (for pgsql). Getting Started | Npgsql Documentation[^] Entity Framework 6 | Npgsql Documentation[^]
11 Nov 2020 by Richard Deeming
IIRC, Dapper[^] matches the query parameters based on the name of the property of the anonymous object. Your query parameter is called Id, but your property is called RouteId. You can either change the parameter name, or change the property...
17 Apr 2014 by littleGreenDude
Getting an error making an Oracle procedure call using Dapper:Invalid parameter binding Parameter name: o_resultsetI don't see another option that will work other than DbType.Object? Any advice?Calling method: public List SearchCustomers(string searchCriteria,...
17 Apr 2014 by DamithSL
you may need to have custom implementation of Dapper.SqlMapper.IDynamicParameters which supports Oracle.DataAccess.Client.OracleDbTypes like ref cursors. check below links- http://blog.vijay.name/2012/07/dapper-micro-orm-for-oracle-and-microsoft-net/[^]-...
1 May 2014 by littleGreenDude
It works with DynamicParameters (no need for OracleDynamicParameters). Using dbType: DbType.Object for the output cursor.I also needed to make the results object specific:var searchResults = new List();No change to the Oracle sproc, final calling code looks like this:public List...
20 Jun 2014 by littleGreenDude
I have a stored procedure that always returns a list of strings. However, based on the parameters passed to the stored procedure, the column heading for the list of strings will change. Is Dapper able to handle this? If so, how should it be handled?I don't really care about the column...
13 Feb 2020 by Member 11307706
Hi friends , I m tried to insert multiple rows at a time. So, i am used DataTable to insert data. But at the runtime , i can't able to insert the records. The follwing exception was thrown. Please any one suggest to me, how to pass the table through datatable. The incoming tabular...
22 Jul 2016 by Gooran
Hi. I need to call aspnet_UsersInRoles_IsUserInRole from Aspnet Membership.Im making dapper call like this:Best Regards.What I have tried:public int CheckIfUserIsInRole(IsUserInRole userInRole) { using (var connection = new...
23 Jul 2016 by Member 10874581
I am having my login model.public class Login { [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string password...
23 Jul 2016 by sankholia
Can you share your view as well ? Your model and controller appears to be fine. Add a watch on fr (your formcollection) to see if username and password are actually present there.
6 Aug 2016 by Member 10874581
i am verify that either particular person that whether it is admin or ordinary userusing two tables.webpages_Rolesroleid Rolename1 Admin2 Userusersusername fullname Emailid password rollidViks Admin a@gmail.com ...
4 Aug 2017 by amey.rane86
I'm using Dapper and I have classes like this: public class Region { public Region() { Countries = new List(0); } public int RegionID { get; set; } public int RiskRank { get; set; } public string Name { get; set; } public int SiteID { get; set;...
28 Aug 2017 by Member 8583441
I just require the value of unique identifier from SQL Server Stored Procedure i.e, user id from username..... Is it possible to get or not Can anyone suggest me for this..... What I have tried: My SQL Query: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE...
30 Apr 2018 by M.Kamran Asim
Dear Friends, I have started my new project in .Net core 2.0. Recently I did some research for best suited ORM, which is fast and easy to use. I found Dapper as a king of ORM, but it has many limitation. To overcome these limitation I found solution to use hybrid approach by combining Entity...
22 Apr 2019 by Member 13954123
Hi, I am working in an application in VB.NET. I got stuck in this ERROR: System.NotSupportedException HResult=0x80131515 Message=The member ClientId of type BillTimeLibrary.BillTimeLibrary.Models.ClientModel cannot be used as a parameter value Contextualizing... First, I have this...
22 Apr 2019 by Gerry Schmitz
What's the "type" of ClientId? From the looks of it, you want to load "PaymentsModel" using a "ClientId" from the "ClientModel". It seems to be pretty clear that it doesn't like the "type" you're passing in.
22 Apr 2019 by raddevus
A couple of hints that may help: 1) Google the error : HResult=0x80131515 and you will find that it leads you to the error : "Could not load file or assembly". Of course, the question is why can't it load the file or assembly? 2) Take a very close look at two lines from your source -- the...
22 Apr 2019 by raddevus
A couple of hints that may help: 1) Google the error : HResult=0x80131515 and you will find that it leads you to the error : "Could not load file or assembly". Of course, the question is why can't it load the file or assembly? 2) Take a very close look at two lines from your source -- the...
13 Feb 2020 by Keep on Truckin'
When using SqlCommandBuilder.DeriveParameters with a user defined table type input parameter stored procedure there is a bug. SqlCommandBuilder.DeriveParameters will return the user defined table type SqlParameter.TypeName prefaced with the...
21 Feb 2020 by Richard Deeming
Try: if (Ordre.Attatchments.Any(x => x.SaveState == false)) { string connectionString = GetConnectionString(connectionStringName); using (var connection = new System.Data.SqlClient.SqlConnection(connectionString)) { const...
24 May 2020 by Tobynate
i"m to retrieve data from a mysql database to a read only textbox, i"m using a stored procedure with input parameter i"m also using dapper as my mapper, and class library as model for my data, any ideas pleas e? What I have...
24 May 2020 by Richard MacCutchan
object reference not set to an instance of an object That means that you are trying to use a variable reference that has not been initialised. Either because you forgot to do it, or because you expected it to be returned from some method that...
21 Jun 2020 by Tobynate
Please any help, im trying to use var in public class its not working, saying invalid initializer member declarator. What I have tried: public class SqlConnector : IDataConnection { // TODO Wire up the create text file ...
21 Jun 2020 by #realJSOP
When in doubt, goole it out: Working With Parameters When Using Dapper | Learn Dapper[^]
25 Sep 2020 by Tobynate
I am trying to pass data into a phpmyadmin database(Xampp) using a stored procedure from the database, i also intend to map my object in my code to the parameter from the stored procedure using dapper ORM. Now, when i run the code to do this, i...
25 Sep 2020 by OriginalGriff
The message is pretty explicit: the column "Name" cannot be a null value. We can't see your SP, but you need to look at two things: 1) Your table definition: the "Name" column is declared as Name NVARCHAR(...) NOT NULL Which menas that SQL will...
8 Oct 2020 by farzadniknam647
After a while of searching we installed EntityFramework6.Npgsql 6.4.1 package in all solution's projects (There are some class liberaries and WinApps projects in the solution). With the update of this package, Npgsql update to the new version...
11 Nov 2020 by Anele Ngqandu
Hi All little assistance here with my query using dapper, been getting error Message = "ORA-00936: missing expression\n" on my query. I would like to know what am I missing here? What I have tried: public class LocationDto { ...
15 May 2021 by Ahmad_kelany
Hello, I am using dapper in Xamain Forms project to connect from Android application to SQL Server database on a desktop PC: using (conn) { result = await conn.QueryFirstAsync(@"Select Count(*) From Balances"); } The code was working...
26 May 2021 by Richard MacCutchan
The message "Object reference not set to an instance of an object" is telling you that you are trying to use a reference that has not been initialised. You need to run your code in the debugger to find out where it occurs, and why.
2 Jun 2021 by Anele Ngqandu
Hi Guys Please assist executing a dapper function below. I am using oracle Below query complains that its missing a FROM, but when from is added, it complains that the query is missing expression. What I have tried: var results =...
2 Jun 2021 by Wendelius
You're at least missing the list of columns you're selecting. For example, try using * to get all of the columns var results = connection.Query("select * from ...
20 Feb 2022 by aloemconsult aloemconsult
I am trying to bind database table data to a wpf form using dapper. I can do this with entity framework 6. and display database records on the form and also navigate each records as in using CurrencyManager? The code below is not in dapper,...
20 Feb 2022 by Graeme_Grant
A quick Google Search wpf daper binding data found this solution: How do you bind Dapper query result to WPF DataGrid
16 Aug 2022 by itsalikis
How can convert bellow procedure to fill datagridview with Dapper command; //Without Dapper using (MySqlConnection con = new MySqlConnection(conString)) { using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM Bars", con)) { ...
16 Aug 2022 by OriginalGriff
Your user can sort a DataGridView, it has automatic sorting enabled as standard - all the user has to do is click on the appropriate column header. If you want to do it programatically, then you have two options: 1) Use the DataGridView.Sort...
7 Dec 2022 by OriginalGriff
We can't tell what exactly is happening: but the most likely problem is that tableName does not contain what you think it does - so start there. Use the debugger to examine exactly what you pass into it, and single step the method to see exactly...
8 Dec 2022 by Richard Deeming
That's an extremely dangerous stored procedure. If your tableName parameter can be influenced in any way by the end-user, then your code is vulnerable to SQL Injection[^]. At the very least, you need to validate the table name in the stored...
8 Oct 2020 by Farzad Niknam B
The Entity Framework provider type 'Npgsql.NpgsqlServices, Npgsql.EntityFramework' registered in the application config file for the ADO.NET provider with invariant name 'Npgsql' could not be loaded. Make sure that the assembly-qualified name is...
7 Aug 2020 by Rick Drizin
Dapper Query Builder using String Interpolation and Fluent API
3 Jan 2023 by George Swan
An introduction to employing Dapper in an ASP.NET 7 application
20 Nov 2014 by Jakob Lithner
Dapper offers fast database handling with custom SQL strings. This wrapper simplifies life by taking generic POCO objects and creates necessary SQL strings on the fly, and it is still very fast!
18 Sep 2018 by Rahul Rajat Singh
How to use dapper to read mutiple resultsets from database in a single database call
14 Sep 2015 by Vijaykumar Vadnal
We will discuss about how we can combine Dapper.NET and DapperExtensions to configure DAL to execute normal queries as well as Stored Procedures.
3 Aug 2018 by Rahul Rajat Singh
This article introduces Dapper to absolute beginners.
25 May 2020 by Maciej Los
Please, read this: mysql - System.Collections.Generic.KeyNotFoundException: 'The given key was not present in the dictionary.' C# windows application - Stack Overflow[^] c# - .Net MySql error "The given key was not present in the dictionary" -...
5 Feb 2015 by Peter Leow
Check this out: Passing a Table-Valued Parameter to a Stored Procedure[^]
22 May 2015 by margam31
how to access(read) multiple tables into single result set with dapper without using foreach condition
21 Feb 2020 by Member 12983358
Is there a way to insert a file without using parameters? I am building a string that updates and insert data in several tables at same time, if something fails all changes is rejected. This is my code: if (Ordre.Attatchments.Where(x =>...
27 May 2020 by Tobynate
I'm trying to get data from my database to a class library object, I'm using a stored procedure and dapper, my query works alright but what I need is to retrieve data from a particular table into my class library object, any ideas please? What I...
26 May 2021 by Jose.talagres
So far I have inserted and retrieve records in a single table with no problem. My current situation is, I have two tables which has a one to one relationships. I have the following table structure and code, when I insert the record in the...
8 Dec 2022 by Ozzie Mozzie
I am getting double data (double columns) from my query on a table. I am unable to fathom why this is happening. Have tried all kinds of methods but no change. The original table only has a single row of data in each row. // Now let's try to...