diff --git a/Modules.Database/Adapters/MSSQLServer.vb b/Modules.Database/Adapters/MSSQLServer.vb
index 83f5b470..5b3eb8d4 100644
--- a/Modules.Database/Adapters/MSSQLServer.vb
+++ b/Modules.Database/Adapters/MSSQLServer.vb
@@ -58,6 +58,7 @@ Public Class MSSQLServer
'''
''' A connection string with a plain-text password
''' The connection string with the password encrypted.
+
Public Shared Function EncryptConnectionString(ConnectionString As String) As String
Dim oEncryption As New EncryptionLegacy()
Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = ConnectionString}
@@ -72,6 +73,7 @@ Public Class MSSQLServer
'''
''' A connection string with a encrypted password
''' The connection string with the password decrypted.
+
Public Shared Function DecryptConnectionString(ConnectionString As String) As String
Dim oEncryption As New EncryptionLegacy()
Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = ConnectionString}
@@ -178,10 +180,12 @@ Public Class MSSQLServer
Return connectionString
End Function
+
Private Function TestCanConnect() As Boolean
Return TestCanConnect(CurrentSQLConnectionString)
End Function
+
Private Function TestCanConnect(ConnectionString As String) As Boolean
Try
_Logger.Debug("Testing connection to [{0}]", MaskConnectionString(ConnectionString))
@@ -195,6 +199,7 @@ Public Class MSSQLServer
End Try
End Function
+
Private Function TestCanConnect(Connection As SqlConnection) As Boolean
Try
If Connection Is Nothing Then
@@ -226,10 +231,12 @@ Public Class MSSQLServer
Return Connection
End Function
+
Private Function GetSQLConnection() As SqlConnection
Return GetConnection(CurrentSQLConnectionString)
End Function
+
Private Function GetConnection(ConnectionString As String) As SqlConnection
Try
Dim oConnection As New SqlConnection(ConnectionString)
@@ -246,6 +253,7 @@ Public Class MSSQLServer
End Try
End Function
+
Private Function MaskConnectionString(ConnectionString As String) As String
Try
If ConnectionString Is Nothing OrElse ConnectionString.Length = 0 Then
@@ -489,6 +497,7 @@ Public Class MSSQLServer
''' the sql statement
''' Optional Timeout
'''
+
Public Sub NewExecuteNonQueryAsync(SqlCommand As String, Optional commandtimeout As Integer = 120)
_Logger.Debug("NewExecuteNonQueryAsync: Running Query [{0}]", SqlCommand)
@@ -509,6 +518,7 @@ Public Class MSSQLServer
End Try
End Sub
+
Private Sub NewExecuteNonQueryAsync_Callback(ByVal result As IAsyncResult)
Dim command As SqlCommand = CType(result.AsyncState, SqlCommand)
Dim res = command.EndExecuteNonQuery(result)