diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index 9b69d27..c738158 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -660,11 +660,20 @@ Public Class frmValidator MsgBox("Error in LoadSQLData: " & ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE) End Try End Sub - Private Function PreventNulletc(myObject As Object) + Private Function PreventNulletc(myObject As Object, pType As String) If IsDBNull(myObject) Then - Return String.Empty + If pType = "String" Then + Return String.Empty + Else + Return 0 + End If + ElseIf IsNothing(myObject) Then - Return String.Empty + If pType = "String" Then + Return String.Empty + Else + Return 0 + End If Else Return myObject End If @@ -731,12 +740,9 @@ Public Class frmValidator End Sub #Region "CONTROL LIST" LOGGER.Debug("In add_ComboBox - GUID: " & oControlID) - Dim oCONID + Dim oCONID As Integer Try - oCONID = PreventNulletc(oControlRow.Item("CONNECTION_ID")) - If oCONID = String.Empty Then - oCONID = 0 - End If + oCONID = PreventNulletc(oControlRow.Item("CONNECTION_ID"), "Integer") Catch ex As Exception oCONID = 0 End Try @@ -753,7 +759,7 @@ Public Class frmValidator If oCONID > 0 And oCommandSQL_UBPF <> String.Empty Then LOGGER.Debug("ConID > 0 And commandsql <> String.Empty") Try - oSQL = PreventNulletc(oControlRow.Item("SQL_UEBERPRUEFUNG")) 'TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID) + oSQL = PreventNulletc(oControlRow.Item("SQL_UEBERPRUEFUNG"), "String") 'TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID) If clsPatterns.HasOnlySimplePatterns(oSQL) Then LOGGER.Debug("SQL HasOnlySimplePatterns!") @@ -4265,7 +4271,7 @@ Public Class frmValidator Dim oOVERWRITE_DATA = oControlRow.Item("OVERWRITE_DATA") 'Nur wenn der Name der Zeile entspricht und der Index READ_ONLY FALSE ist - If oControlRow.Item("CTRL_NAME") = oControl.Name And (oIsReadOnly = False Or oSQLCheckCommand <> "") And oIndexName <> "DD PM-ONLY FOR DISPLAY" Then + If oControlRow.Item("CTRL_NAME") = oControl.Name And oIndexName <> "DD PM-ONLY FOR DISPLAY" Then '(oIsReadOnly = False Or oSQLCheckCommand <> "") And LOGGER.Debug("Indexierung für Control (" & oControlId & ") '" & oControlName & "' gestartet. Indexname '" & oIndexName & "'") If oIndexName = "" Then LOGGER.Info(" >> Indexname is unexpected empty.")