ClipboardWatcher: Use connectionId when executing search count command
This commit is contained in:
@@ -361,19 +361,25 @@ Public Class ProfileFilter
|
||||
|
||||
For Each oRow As DataRow In oDTDataSearches.Rows
|
||||
Dim oCountCommand = String.Empty
|
||||
Dim oCountConnectionId = String.Empty
|
||||
Try
|
||||
oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty)
|
||||
oCountConnectionId = NotNull(oRow.Item("CONN_ID"), 0)
|
||||
|
||||
If oCountCommand = String.Empty Then
|
||||
_Logger.Debug("oCountCommand = String.Empty ==> Continue for")
|
||||
_Logger.Debug("oCountCommand = String.Empty ==> Continue for")
|
||||
Continue For
|
||||
End If
|
||||
|
||||
oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand)
|
||||
oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User)
|
||||
oCountCommand = oPatterns.ReplaceClipboardContents(oCountCommand, ClipboardContents)
|
||||
|
||||
_Logger.Debug($"Count-Command DATA before execute: [{oCountCommand}]")
|
||||
oResultData += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0)
|
||||
|
||||
Dim oConnectionString = ProfileUtils.GetConnectionString(Database, oCountConnectionId)
|
||||
|
||||
oResultData += NotNull(Of Integer)(Database.GetScalarValueWithConnection(oCountCommand, oConnectionString), 0)
|
||||
Catch ex As Exception
|
||||
_Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand)
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user