idbconnection

Dapper Hangs at Execute

假装没事ソ 提交于 2019-12-10 21:04:47
问题 I have an - IDbConnection - sql = @"UPDATE tablename SET json = :json, lastupdate = SYSDATE WHERE id = :id" var param = new DynamicParameters(); param.Add(":json", json, DbType.AnsiString); param.Add(":id", currentTemplate.Id); if (connection == null || connection.State != ConnectionState.Open) continue; connection.Execute(sql, param); // hangs here. connection.Query(sql, param); // tried this and this also hangs. Coding stops at connection.Execute. No error or anything. Just hangs. :json is

What does “opening a connection” actually mean?

孤街醉人 提交于 2019-11-27 14:07:33
I was trying to explain to someone why database connections implement IDisposable, when I realized I don't really know what "opening a connection" actually mean. So my question is - What does c# practically do when it opens a connection? Thank you. There are actually two classes involved in implementing a connection (actually more, but I'm simplifying). One of these is the IDbConnection implementation ( SQLConnection , NpgsqlConnection , OracleConnection , etc.) that you use in your code. The other is a "real" connection object that is internal to the assembly, and not visible to your code. We

What does “opening a connection” actually mean?

≡放荡痞女 提交于 2019-11-26 16:36:36
问题 I was trying to explain to someone why database connections implement IDisposable, when I realized I don't really know what "opening a connection" actually mean. So my question is - What does c# practically do when it opens a connection? Thank you. 回答1: There are actually two classes involved in implementing a connection (actually more, but I'm simplifying). One of these is the IDbConnection implementation ( SQLConnection , NpgsqlConnection , OracleConnection , etc.) that you use in your code