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