Compare commits
2 Commits
f50b9db499
...
5fed0a4255
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fed0a4255 | ||
|
|
e93880aed7 |
@@ -66,7 +66,7 @@ Public Class MSSQLServer
|
||||
Public Function GetConnection() As SqlConnection
|
||||
Try
|
||||
Dim oConnection = GetSQLConnection()
|
||||
oConnection.Open()
|
||||
OpenSQLConnection(oConnection)
|
||||
|
||||
Return oConnection
|
||||
Catch ex As Exception
|
||||
@@ -151,7 +151,7 @@ Public Class MSSQLServer
|
||||
Try
|
||||
_Logger.Debug("Testing connection to [{0}]", MaskConnectionString(ConnectionString))
|
||||
Dim oConnection As New SqlConnection(ConnectionString)
|
||||
oConnection.Open()
|
||||
OpenSQLConnection(oConnection)
|
||||
oConnection.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
@@ -169,10 +169,7 @@ Public Class MSSQLServer
|
||||
|
||||
_Logger.Debug("Testing connection to [{0}]", MaskConnectionString(Connection.ConnectionString))
|
||||
|
||||
If Connection.State = ConnectionState.Closed Then
|
||||
Connection.Open()
|
||||
End If
|
||||
|
||||
OpenSQLConnection(Connection)
|
||||
Connection.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
@@ -181,6 +178,18 @@ Public Class MSSQLServer
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function OpenSQLConnection(Connection As SqlConnection) As SqlConnection
|
||||
Try
|
||||
If Connection.State = ConnectionState.Closed Then
|
||||
Connection.Open()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
Return Connection
|
||||
End Function
|
||||
|
||||
Private Function GetSQLConnection() As SqlConnection
|
||||
Return GetConnection(CurrentSQLConnectionString)
|
||||
End Function
|
||||
@@ -188,7 +197,7 @@ Public Class MSSQLServer
|
||||
Private Function GetConnection(ConnectionString As String) As SqlConnection
|
||||
Try
|
||||
Dim oConnection As New SqlConnection(ConnectionString)
|
||||
oConnection.Open()
|
||||
OpenSQLConnection(oConnection)
|
||||
|
||||
Dim oMaskedConnectionString = MaskConnectionString(ConnectionString)
|
||||
_Logger.Debug("The Following Connection is open: {0}", oMaskedConnectionString)
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.1.0.0")>
|
||||
<Assembly: AssemblyVersion("2.1.1.0")>
|
||||
<Assembly: AssemblyFileVersion("2.1.1.0")>
|
||||
|
||||
Reference in New Issue
Block a user