Database: Fix opening MSSQL connection twice
This commit is contained in:
parent
5fed0a4255
commit
40f0b50ae6
@ -66,8 +66,6 @@ Public Class MSSQLServer
|
|||||||
Public Function GetConnection() As SqlConnection
|
Public Function GetConnection() As SqlConnection
|
||||||
Try
|
Try
|
||||||
Dim oConnection = GetSQLConnection()
|
Dim oConnection = GetSQLConnection()
|
||||||
OpenSQLConnection(oConnection)
|
|
||||||
|
|
||||||
Return oConnection
|
Return oConnection
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
@ -197,7 +195,7 @@ Public Class MSSQLServer
|
|||||||
Private Function GetConnection(ConnectionString As String) As SqlConnection
|
Private Function GetConnection(ConnectionString As String) As SqlConnection
|
||||||
Try
|
Try
|
||||||
Dim oConnection As New SqlConnection(ConnectionString)
|
Dim oConnection As New SqlConnection(ConnectionString)
|
||||||
OpenSQLConnection(oConnection)
|
oConnection = OpenSQLConnection(oConnection)
|
||||||
|
|
||||||
Dim oMaskedConnectionString = MaskConnectionString(ConnectionString)
|
Dim oMaskedConnectionString = MaskConnectionString(ConnectionString)
|
||||||
_Logger.Debug("The Following Connection is open: {0}", oMaskedConnectionString)
|
_Logger.Debug("The Following Connection is open: {0}", oMaskedConnectionString)
|
||||||
@ -340,7 +338,7 @@ Public Class MSSQLServer
|
|||||||
|
|
||||||
|
|
||||||
Public Function GetScalarValue(SQLQuery As String) As Object Implements IDatabase.GetScalarValue
|
Public Function GetScalarValue(SQLQuery As String) As Object Implements IDatabase.GetScalarValue
|
||||||
Using oConnection = GetSQLConnection()
|
Using oConnection As SqlConnection = GetSQLConnection()
|
||||||
Return GetScalarValueWithConnectionObject(SQLQuery, oConnection)
|
Return GetScalarValueWithConnectionObject(SQLQuery, oConnection)
|
||||||
End Using
|
End Using
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user