Database: remove baseclass
This commit is contained in:
@@ -46,8 +46,6 @@ Imports DigitalData.Modules.Logging
|
||||
''' REMARKS: If the connection fails due to "wrong username or password", the cause might be that the server harddrive is full..
|
||||
''' </summary>
|
||||
Public Class Firebird
|
||||
Inherits BaseClass
|
||||
|
||||
Private _Logger As Logger
|
||||
Private _LogConfig As LogConfig
|
||||
Private _connectionServer As String
|
||||
@@ -221,7 +219,7 @@ Public Class Firebird
|
||||
''' </summary>
|
||||
''' <param name="SqlCommand">The command to execute</param>
|
||||
''' <returns>True, if command was executed sucessfully. Otherwise false.</returns>
|
||||
Public Overrides Function ExecuteNonQuery(SqlCommand As String) As Boolean
|
||||
Public Function ExecuteNonQuery(SqlCommand As String) As Boolean
|
||||
Dim oConnection As FbConnection = GetConnection()
|
||||
Dim oScalarValue As Object = ExecuteNonQueryWithConnection(SqlCommand, oConnection)
|
||||
oConnection.Close()
|
||||
@@ -268,7 +266,7 @@ Public Class Firebird
|
||||
''' </summary>
|
||||
''' <param name="SqlQuery">The query to execute</param>
|
||||
''' <returns>The scalar value if the command was executed successfully. Nothing otherwise.</returns>
|
||||
Public Overrides Function GetScalarValue(SqlQuery As String) As Object
|
||||
Public Function GetScalarValue(SqlQuery As String) As Object
|
||||
Dim oConnection As FbConnection = GetConnection()
|
||||
Dim oScalarValue As Object = GetScalarValueWithConnection(SqlQuery, oConnection)
|
||||
oConnection.Close()
|
||||
@@ -304,7 +302,8 @@ Public Class Firebird
|
||||
|
||||
oAdapter.Fill(oDatatable)
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex, $"Error in GetDatatableWithConnection while executing command: '{SqlQuery}'")
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn("Error in GetDatatableWithConnection while executing command: '{0}'", SqlQuery)
|
||||
Throw ex
|
||||
Finally
|
||||
MaybeCommitTransaction(oTransaction, TransactionMode)
|
||||
@@ -318,11 +317,17 @@ Public Class Firebird
|
||||
''' </summary>
|
||||
''' <param name="SqlQuery">The query to execute</param>
|
||||
''' <returns>A datatable containing the results if the command was executed successfully. Nothing otherwise.</returns>
|
||||
Public Overrides Function GetDatatable(SqlQuery As String) As DataTable
|
||||
Dim oConnection As FbConnection = GetConnection()
|
||||
Dim oDatatable As DataTable = GetDatatableWithConnection(SqlQuery, oConnection)
|
||||
oConnection.Close()
|
||||
Public Function GetDatatable(SqlQuery As String, Optional TransactionMode As TransactionMode = TransactionMode.NoTransaction, Optional Transaction As FbTransaction = Nothing) As DataTable
|
||||
Try
|
||||
Dim oConnection As FbConnection = GetConnection()
|
||||
Dim oDatatable As DataTable = GetDatatableWithConnection(SqlQuery, oConnection, TransactionMode, Transaction)
|
||||
oConnection.Close()
|
||||
|
||||
Return oDatatable
|
||||
Return oDatatable
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
_Logger.Warn("Error in GetDatatable while executing command: '{0}'", SqlQuery)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user