SQL Connection cleanup

This commit is contained in:
Jonathan Jenne
2022-08-09 15:18:47 +02:00
parent 8c76b53273
commit 7c9160a270
14 changed files with 144 additions and 140 deletions

View File

@@ -229,8 +229,13 @@ Public Class frmAdministration
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles btnWMSuche.Click
If IDB_ACTIVE = True Then
CURRENT_DESIGN_TYPE = "IDB_SEARCH"
Dim oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {.SQLCommand = Me.WD_SEARCHTextBox.Text, .SQLConnection = 1}
Dim oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {
.SQLCommand = Me.WD_SEARCHTextBox.Text,
.SQLConnection = 1,
.AllowSQLConnectionSelection = False
}
oForm.ShowDialog()
If oForm.DialogResult = DialogResult.OK Then
Me.WD_SEARCHTextBox.Text = oForm.SQLCommand
End If
@@ -960,20 +965,20 @@ Public Class frmAdministration
Dim oSequence As Int16 = NotNull(focusedRow.Item("SEQUENCE"), 0)
Dim oIndetermined As Boolean = NotNull(focusedRow.Item("CONTINUE_INDETERMINED"), False)
CURRENT_INDEX_ID = guid
CURRENT_SQL_CON = connectionId
Dim obj As New FinalIndexProperties()
obj.GUID = guid
obj.IndexName = index
obj.SQLCommand = New SQLValue(sqlCommand)
obj.ConnectionId = connectionId
obj.Description = description
obj.Active = active
obj.AllowAddNewValues = allowNewValues
obj.PreventDuplicates = preventDuplicates
obj.VectorBehaviour = VectorBehaviour
obj.Sequence = oSequence
obj.ContinueOnIndifferentState = oIndetermined
Dim obj As New FinalIndexProperties With {
.GUID = guid,
.IndexName = index,
.SQLCommand = New SQLValue(sqlCommand, connectionId),
.ConnectionId = connectionId,
.Description = description,
.Active = active,
.AllowAddNewValues = allowNewValues,
.PreventDuplicates = preventDuplicates,
.VectorBehaviour = VectorBehaviour,
.Sequence = oSequence,
.ContinueOnIndifferentState = oIndetermined
}
' Wenn eine neue Zeile hinzugefügt wird, auf StringValue setzen
If e.FocusedRowHandle <> GridControl.NewItemRowHandle Then
obj = FINALINDICES.SetValue(value, obj, index, MyIndicies, MyIndicies_Types)
@@ -992,7 +997,7 @@ Public Class frmAdministration
"Overwrite"
}
If Not index Is Nothing Then
If index IsNot Nothing Then
Dim indexType As Integer = FINALINDICES.GetIndexType(index, MyIndicies, MyIndicies_Types)
obj.VectorIndex = FINALINDICES.IsVectorIndex(indexType)
End If
@@ -1018,8 +1023,10 @@ Public Class frmAdministration
Dim value As SQLValue = e.ChangedItem.Value
If value.Value <> String.Empty Then
obj.ConnectionId = CURRENT_SQL_CON
'obj.ConnectionId = CURRENT_CONN_ID_FINAL_INDEX
obj.StringValue = "SQL-Command"
obj.ConnectionId = value.ConnectionId
'obj.FloatValue = 0
' obj.IntegerValue = 0
End If
@@ -1268,8 +1275,11 @@ Public Class frmAdministration
Dim guid = obj.GUID
Dim oProfileId As Integer = PROFILGUIDTextBox.Text
Dim connectionId As Integer = obj.ConnectionId
'Dim connectionId As Integer = obj.ConnectionId
Dim connectionId As Integer = NotNull(obj.SQLCommand.ConnectionId, 1)
Dim sqlCommand As String = NotNull(obj.SQLCommand.Value, String.Empty).Replace("'", "''")
Dim indexName As String = NotNull(obj.IndexName, String.Empty)
Dim isVectorIndex As Boolean = obj.VectorIndex
Dim addedWho As String = USER_USERNAME