Database: Clean up GetSQLConnection()
This commit is contained in:
parent
f3986bb8fa
commit
b8040cff2b
@ -64,21 +64,16 @@ Public Class MSSQLServer
|
||||
|
||||
Private Function GetSQLConnection() As SqlConnection
|
||||
Try
|
||||
Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = CurrentSQLConnectionString}
|
||||
Dim oConnection As New SqlConnection(CurrentSQLConnectionString)
|
||||
oConnection.Open()
|
||||
Dim OMyConnection As New SqlClient.SqlConnection(CurrentSQLConnectionString) 'csb.ConnectionString)
|
||||
Dim csb As New SqlClient.SqlConnectionStringBuilder
|
||||
csb.ConnectionString = CurrentSQLConnectionString
|
||||
Dim constr = OMyConnection.ConnectionString
|
||||
Try
|
||||
constr = constr.Replace(csb.Password, "XXXXX")
|
||||
Catch ex As Exception
|
||||
|
||||
Try
|
||||
Dim oConnectionString = CurrentSQLConnectionString.Replace(oBuilder.Password, "XXXXX")
|
||||
_Logger.Debug($"Following Connectionstring is open: {oConnectionString}")
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
'If constr.Contains("Trusted_Connection=True") = False Then
|
||||
' constr = constr.Replace(csb.Password, "XXXXX")
|
||||
'End If
|
||||
_Logger.Debug($"Following Connectionstring is open: {constr}")
|
||||
|
||||
Return oConnection
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user