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)

13 results for: in tag: sqlconnection

.NET SqlConnection and SqlCommand

I use SqlConnection and SqlCommand classes in my project with Dapper ORM but I've got a strange problem. When I use SqlCommand for inserting a row in a db table it always work correct and when I select updated data form tables everything is fine but after...
.net dapper sql sqlcommand sqlconnection
asked by shadeglare

Session-Per-Request with SqlConnection / System.Transactions

I've just started using Dapper for a project, having mostly used ORMs like NHibernate and EF for the past few years....Typically in our web applications we implement session per request, beginning a transaction at the start of the request and committing i...
dapper sqlconnection sql-server system.transactions
asked by Ben Foster

Why doesn't Dapper dot net open and close the connection itself?

Dapper implicitly expects a connection to be open when it uses it. Why doesn't it open and close it itself? Wouldn't this simply connection management?...I ask because a co-worker and I have been going back and forth on the nature of what goes on behind t...
.net connection-pooling dapper sqlconnection
asked by smdrager

How to store a sql result to a variable in C# using Dapper.NET

I'm using ...dapper... in my project, a beautiful tool for storing the ...SQL query... results to a ...List... and this working good....I wrote a ...SQL query... to fetch a record from database and store the result in a variable, I tried using ...dapper..
c# dapper sqlconnection
asked by Praveen

Trying to understand erratic behavior of DB Connection used by Dapper

I need some help better understanding how Dapper handles DB Connections, and why DB Connection isn't being properly disposed of. I have coded around the different possible cases. In my code, I am checking to see if the _connection is null, and creating a...
dapper micro-orm orm sqlconnection sql-server
asked by Yogiraj

Remembering SQL connection state in .net?

Beside's the old known fact that ...connection.Close()... vs ...connection.Dispose()... are the same - except that running ...Close()... over a disposed connection raises an exception while running ...Close()... over a closed connection - is OK - I stil...
.net c# connection-pooling dapper sqlconnection
asked by Royi Namir

C# Identity UserManager CreateAsync then FindByEmailAsync returns User with Id=0

Identity with Dapper....My user in my Identity is of type IUser< int >...When a user Registers, I create a user in my AccountController:...Register POST:...if (ModelState.IsValid) { user = new MySiteUserRecord { UserName = model.UserName, ...
asp.net-identity-2 dapper dapper-extensions sqlconnection
asked by Robert Achmann

Is connecting to a database using SqlConnection() AND a Connection string safe?

I am using the following code in conjunction with dapper ORM to connect to a database : ...using (IDbConnection db = new SqlConnection(ConnectionString())) { return db.Query<object>(Sql).ToList(); } ...The connection string contains database name and logi...
c# dapper sqlconnection
asked by Victor Chirinian

Difference between a 'using statement' for every SqlConnection and single SqlConnection as private property in C# data layer

When implementing the repository pattern using Dapper ORM I am currently doing the following:...private readonly ConnectionStrings _connectionStrings; private IDbConnection _db; public CustomerRepository(IOptions<ConnectionStrings> connectionStrings) { ...
c# dapper n-tier-architecture repository-pattern sqlconnection
asked by Blake Rivell

Exception with message 'No columns were mapped' using Dapper Extensions

I have a ...class... which implements some ...interface...:...public interface IDb {} public class DbModel : IDb {} ...After this I use Dapper Extensions to insert the object into the DB. This code works well:...var obj = new DbModel(); sqlConnection.Inse...
c# dapper dapper-extensions sqlconnection
asked by kogoia

Difference between connection.OpenAsync and connection.Open when using Dapper QueryAsync method

What is the difference between using connection.OpenAsync() and connection.Open() when using dapper's QueryAsync method....Async:...public async Task<IList<Product>> GetListAsync() { using (var connection = new SqlConnection(_connectionString)...
asp.net c# dapper sqlconnection sql-server
asked by Blake Rivell

Insert many rows with Dapper

what's the best solution to insert many rows into the SQL Server with Dapper? When I have got about 8k records my databaseconnection timeouts and fails....In my application at the end stage I have got lets say a list of tables, where each table got list o...
.net ado.net c# dapper sqlconnection
asked by CSharpBeginner

Does QueryAsync calls OpenAsync with Dapper?

I have come upon a bit of code that looks like this (it is based of Dapper tutorial):...await using var con = new SqlConnection("some connection"); if (CancellationToken.IsCancellationRequested) await con.OpenAsync(CancellationToken); return await con.Que...
.net-core asp.net-core-3.0 c# dapper sqlconnection
asked by Bojan

Page 1 of 1
  • 1

Prime Library

Performance

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

Expression Evaluator

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