From 81b9fa7f632c4bc7e974183af4b6fd97bacc6c9c Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 11 May 2021 13:55:14 +0200 Subject: [PATCH] Firebird: Add ExecuteNonQuery with Transaction --- Modules.Database/Firebird.vb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Modules.Database/Firebird.vb b/Modules.Database/Firebird.vb index 6b1d1bec..df64e43d 100644 --- a/Modules.Database/Firebird.vb +++ b/Modules.Database/Firebird.vb @@ -225,11 +225,20 @@ Public Class Firebird ''' The command to execute ''' True, if command was executed sucessfully. Otherwise false. Public Function ExecuteNonQuery(SqlCommand As String) As Boolean - Dim oConnection As FbConnection = GetConnection() - Dim oScalarValue As Object = ExecuteNonQueryWithConnection(SqlCommand, oConnection) - oConnection.Close() + Using oConnection As FbConnection = GetConnection() + Return ExecuteNonQueryWithConnection(SqlCommand, oConnection) + End Using + End Function - Return oScalarValue + ''' + ''' Executes a non-query command inside the specified transaction. + ''' + ''' The command to execute + ''' True, if command was executed sucessfully. Otherwise false. + Public Function ExecuteNonQuery(SqlCommand As String, Transaction As FbTransaction) As Boolean + Using oConnection As FbConnection = GetConnection() + Return ExecuteNonQueryWithConnection(SqlCommand, oConnection, TransactionMode.ExternalTransaction, Transaction) + End Using End Function '''