smol design tweaks
This commit is contained in:
@@ -34,7 +34,6 @@ Public Class frmConnections
|
||||
|
||||
Private Sub SQL_PROVIDERComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles SQL_PROVIDERComboBox.SelectedIndexChanged
|
||||
If Me.SQL_PROVIDERComboBox.SelectedIndex <> -1 Then
|
||||
Me.btnCheck_Con.Visible = True
|
||||
CheckBoxwin_aut.Visible = False
|
||||
chkOR_ohne_TNS.Visible = False
|
||||
Select Case Me.SQL_PROVIDERComboBox.SelectedItem
|
||||
@@ -144,7 +143,7 @@ Public Class frmConnections
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnCheck_Con_Click(sender As Object, e As EventArgs) Handles btnCheck_Con.Click
|
||||
Private Sub btnCheck_Con_Click(sender As Object, e As EventArgs)
|
||||
Dim msg_string As String
|
||||
Try
|
||||
If Me.SQL_PROVIDERComboBox.SelectedIndex <> -1 Then
|
||||
@@ -375,4 +374,103 @@ Public Class frmConnections
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
TBDD_CONNECTIONBindingSource.RemoveCurrent()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem5.ItemClick
|
||||
Dim msg_string As String
|
||||
Try
|
||||
If Me.SQL_PROVIDERComboBox.SelectedIndex <> -1 Then
|
||||
Cursor = Cursors.WaitCursor
|
||||
|
||||
Select Case Me.SQL_PROVIDERComboBox.SelectedItem
|
||||
Case "MS-SQL".ToUpper
|
||||
Dim con As String
|
||||
If CheckBoxwin_aut.Checked Then
|
||||
con = "Data Source=" & Me.SERVERTextBox.Text & ";Initial Catalog=" & Me.cmbInitialCatalog.Text & ";Trusted_Connection=True;"
|
||||
Else
|
||||
con = "Server=" & Me.SERVERTextBox.Text & ";Database=" & Me.cmbInitialCatalog.Text & ";User Id=" & Me.USERNAMETextBox.Text & ";Password=" & Me.PASSWORDTextBox.Text & ";"
|
||||
End If
|
||||
msg_string = con
|
||||
Dim connection As New SqlClient.SqlConnection(con)
|
||||
connection.Open()
|
||||
Cursor = Cursors.Default
|
||||
|
||||
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Die SQL-Server Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:")
|
||||
Else
|
||||
MsgBox("Connection to Server successfully established!", MsgBoxStyle.Information, "Success:")
|
||||
End If
|
||||
|
||||
|
||||
My.Settings.Save()
|
||||
Case "MS-SQLServer".ToUpper
|
||||
Dim con As String
|
||||
If CheckBoxwin_aut.Checked Then
|
||||
con = "Data Source=" & Me.SERVERTextBox.Text & ";Initial Catalog=" & Me.cmbInitialCatalog.Text & ";Trusted_Connection=True;"
|
||||
Else
|
||||
con = "Server=" & Me.SERVERTextBox.Text & ";Database=" & Me.cmbInitialCatalog.Text & ";User Id=" & Me.USERNAMETextBox.Text & ";Password=" & Me.PASSWORDTextBox.Text & ";"
|
||||
End If
|
||||
msg_string = con
|
||||
Dim connection As New SqlClient.SqlConnection(con)
|
||||
connection.Open()
|
||||
Cursor = Cursors.Default
|
||||
|
||||
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Die SQL-Server Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:")
|
||||
Else
|
||||
MsgBox("Connection to Server successfully established!", MsgBoxStyle.Information, "Success:")
|
||||
End If
|
||||
|
||||
|
||||
My.Settings.Save()
|
||||
Case "Oracle"
|
||||
My.Settings.Save()
|
||||
Dim connstr As String
|
||||
Try
|
||||
Dim conn As New OracleConnectionStringBuilder
|
||||
|
||||
If chkOR_ohne_TNS.Checked Then
|
||||
connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & SERVERTextBox.Text & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" &
|
||||
DATENBANKTextBox.Text & ")));User Id=" & USERNAMETextBox.Text & ";Password=" & PASSWORDTextBox.Text & ";"
|
||||
Else
|
||||
conn.DataSource = DATENBANKTextBox.Text
|
||||
conn.UserID = USERNAMETextBox.Text
|
||||
conn.Password = PASSWORDTextBox.Text
|
||||
conn.PersistSecurityInfo = True
|
||||
conn.ConnectionTimeout = 120
|
||||
connstr = conn.ConnectionString
|
||||
End If
|
||||
|
||||
Dim connection As New OracleConnection(connstr)
|
||||
connection.Open()
|
||||
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Die SQL-Server Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:")
|
||||
Else
|
||||
MsgBox("Connection to Server successfully established!", MsgBoxStyle.Information, "Success:")
|
||||
End If
|
||||
My.Settings.Save()
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & vbNewLine & vbNewLine & connstr, MsgBoxStyle.Critical, "Unexpected error in Verbindungsaufbau Oracle:")
|
||||
End Try
|
||||
|
||||
Case Else
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Test zur Zeit nicht möglich", MsgBoxStyle.Information, "Achtung:")
|
||||
Else
|
||||
MsgBox("Test not available", MsgBoxStyle.Information, "Warning:")
|
||||
End If
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
Dim template As String = ex.Message
|
||||
Clipboard.SetDataObject(template)
|
||||
MsgBox("Unexpected error inm Verbindungsaufbau: " & vbNewLine & ex.Message & vbNewLine & "Connection-String: " & vbNewLine & msg_string, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
Cursor = Cursors.Default
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user