ClipboardWatcher: Use connectionId when executing search count command
This commit is contained in:
23
GUIs.ClipboardWatcher/ProfileUtils.vb
Normal file
23
GUIs.ClipboardWatcher/ProfileUtils.vb
Normal file
@@ -0,0 +1,23 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
|
||||
Public Class ProfileUtils
|
||||
Public Shared Function GetConnectionString(Database As MSSQLServer, ConnectionId As Integer) As String
|
||||
Dim oDatatable As DataTable = Database.GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {ConnectionId}")
|
||||
|
||||
If oDatatable.Rows.Count > 0 Then
|
||||
Dim oRow As DataRow = oDatatable.Rows.Item(0)
|
||||
|
||||
Select Case oRow.Item("SQL_PROVIDER")
|
||||
Case "MS-SQL"
|
||||
Dim oConnectionString = Database.GetConnectionString(oRow.Item("SERVER"), oRow.Item("DATENBANK"), oRow.Item("USERNAME"), oRow.Item("PASSWORD"))
|
||||
Return oConnectionString
|
||||
|
||||
Case Else
|
||||
Return Nothing
|
||||
|
||||
End Select
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user