ZooFLow: Use SQLConfig form

This commit is contained in:
Jonathan Jenne
2021-05-04 14:54:15 +02:00
parent baea2d07d3
commit ac4fabe8c2
7 changed files with 209 additions and 157 deletions

View File

@@ -44,20 +44,20 @@ Public Class frmConfigDatabase
Dim oDatabase As New MSSQLServer(My.LogConfig, oConnectionString)
If oDatabase.DBInitialized = False Then
MsgBox("Verbindung fehlgeschlagen!", MsgBoxStyle.Critical)
MsgBox("Verbindung fehlgeschlagen!", MsgBoxStyle.Critical, Text)
Exit Sub
End If
Try
Using oConnection = New SqlClient.SqlConnection(oConnectionString)
oConnection.Open()
Using cmd As New SqlClient.SqlCommand("sp_databases", oConnection)
Using dr As SqlClient.SqlDataReader = cmd.ExecuteReader
If dr.HasRows Then
Using oCommand As New SqlClient.SqlCommand("sp_databases", oConnection)
Using oReader As SqlClient.SqlDataReader = oCommand.ExecuteReader
If oReader.HasRows Then
cmbDatabase.Properties.Items.Clear()
Do While dr.Read
cmbDatabase.Properties.Items.Add(dr("Database_Name"))
Do While oReader.Read
cmbDatabase.Properties.Items.Add(oReader("Database_Name"))
Loop
cmbDatabase.ShowPopup()
Else
@@ -99,7 +99,7 @@ Public Class frmConfigDatabase
oConnection.Close()
End Using
Dim oResult = MessageBox.Show(STRING_CONNECTION_SUCCESSFUL, Me.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
Dim oResult = MessageBox.Show(STRING_CONNECTION_SUCCESSFUL, Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If oResult = DialogResult.Yes Then
Dim oCrypt As New EncryptionLegacy("!35452didalog=")
@@ -111,7 +111,7 @@ Public Class frmConfigDatabase
End If
Catch ex As Exception
Logger.Error(ex)
MsgBox("Error while connecting to Database")
MsgBox("Error while connecting to Database", MsgBoxStyle.Critical, Text)
End Try
End Sub
End Class