Final fixes before vacation \o/
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.Odbc
|
||||
Imports Oracle.ManagedDataAccess.Client
|
||||
Imports Microsoft.Win32
|
||||
Imports DigitalData.Modules.Database.Constants
|
||||
Imports DigitalData.Modules
|
||||
|
||||
Public Class frmConnection
|
||||
Private Sub TBDD_CONNECTIONBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
|
||||
@@ -91,13 +91,14 @@ Public Class frmConnection
|
||||
End Using
|
||||
Case PROVIDER_ORACLE
|
||||
Try
|
||||
Dim conn As New OracleConnectionStringBuilder
|
||||
oConnectionString = $"Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST={Server})(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME={Database})));User Id={UserId};Password={Password};"
|
||||
Dim oOracle As New Database.Oracle(LogConfig, oConnectionString)
|
||||
|
||||
Using connection As New OracleConnection(oConnectionString)
|
||||
connection.Open()
|
||||
If oOracle.DBInitialized Then
|
||||
MsgBox("Die Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, Text)
|
||||
End Using
|
||||
Else
|
||||
MsgBox("Fehler beim Verbindungsaufbau (ORACLE): Fehler im Log", MsgBoxStyle.Critical, Text)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox("Fehler beim Verbindungsaufbau (ORACLE): " & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text)
|
||||
@@ -194,14 +195,21 @@ Public Class frmConnection
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonDelete.ItemClick
|
||||
Try
|
||||
If GUIDTextBox.Text <> String.Empty Then
|
||||
Dim oResult As MsgBoxResult = MsgBox("Wollen Sie die Verbindung wirklich löschen?", MsgBoxStyle.YesNo, Text)
|
||||
If oResult = MsgBoxResult.Yes Then
|
||||
TBDD_CONNECTIONTableAdapter.Delete(GUIDTextBox.Text)
|
||||
Dim oSQL = $"SELECT dbo.FNCW_GET_SEARCH_COUNT_FOR_CONNECTION({GUIDTextBox.Text})"
|
||||
Dim oCount = Database.GetScalarValue(oSQL)
|
||||
|
||||
If oCount IsNot Nothing AndAlso oCount = 0 Then
|
||||
Dim oResult As MsgBoxResult = MsgBox("Wollen Sie die Verbindung wirklich löschen?", MsgBoxStyle.YesNo, Text)
|
||||
If oResult = MsgBoxResult.Yes Then
|
||||
TBDD_CONNECTIONTableAdapter.Delete(GUIDTextBox.Text)
|
||||
End If
|
||||
Else
|
||||
MsgBox($"Die Verbindung '{BEZEICHNUNGTextBox.Text}' kann nicht gelöscht werden, da sie von mindestens einer Suche verwendet wird!", MsgBoxStyle.Exclamation, Text)
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox("Fehler beim Löschen der Verbindung: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
MsgBox("Fehler beim Löschen der Verbindung: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, Text)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user