MS
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?", "Erfolgsmeldung:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
CONNECTION_CHANGED = True
|
||||
'Set the construction string
|
||||
MyConnectionString = con 'csb.ConnectionString
|
||||
My.Settings.Save()
|
||||
@@ -54,7 +55,8 @@
|
||||
If chkbxUserAut.Checked Then
|
||||
con = "Data Source=" & Me.txtServer.Text & ";Trusted_Connection=True;"
|
||||
Else
|
||||
con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
|
||||
'con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
|
||||
con = "Server=" & Me.txtServer.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
|
||||
End If
|
||||
Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString)
|
||||
connection.Open()
|
||||
@@ -63,6 +65,7 @@
|
||||
' Ausführen und Ergebnis in einer ListBox anzeigen
|
||||
Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader
|
||||
If dr.HasRows Then
|
||||
cmbDatenbank.Items.Clear()
|
||||
Do While dr.Read
|
||||
cmbDatenbank.Items.Add(dr("Database_Name"))
|
||||
Loop
|
||||
@@ -83,6 +86,7 @@
|
||||
|
||||
Private Sub frmConfig_Basic_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
If Not MyConnectionString = String.Empty Then
|
||||
CONNECTION_CHANGED = False
|
||||
Try
|
||||
Dim csb As New SqlClient.SqlConnectionStringBuilder
|
||||
csb.ConnectionString = MyConnectionString
|
||||
@@ -120,7 +124,7 @@
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler in FormLoad: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user