Database: Version 2.2.7, fix connection id = 0

This commit is contained in:
Jonathan Jenne
2022-07-08 10:12:41 +02:00
parent 55e484308c
commit 914a3464d7
2 changed files with 12 additions and 7 deletions

View File

@@ -146,7 +146,12 @@ Public Class MSSQLServer
End Function
Public Function Get_ConnectionStringforID(pConnectionId As Integer) As String
Dim oConnectionString As String = ""
Dim oConnectionString As String = String.Empty
If pConnectionId = 0 Then
_Logger.Warn("ConnectionId was 0. Falling back to default connection.")
Return String.Empty
End If
Try
Dim oTable As DataTable = GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {pConnectionId}")
@@ -174,17 +179,17 @@ Public Class MSSQLServer
End If
Case Else
_Logger.Warn("Provider {0} nicht unterstützt!", oProvider)
_Logger.Warn("Provider [{0}] not supported!", oProvider)
End Select
Else
_Logger.Info("No entry for Connection-ID: " & pConnectionId.ToString)
_Logger.Warn("No entry for Connection-ID: [{0}] ", pConnectionId.ToString)
End If
Catch ex As Exception
_Logger.Error(ex)
_Logger.Info("Error in bei Get_ConnectionStringforID")
_Logger.Warn("Error in Get_ConnectionStringforID")
End Try
Return DecryptConnectionString(oConnectionString)