Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.
Public Class Form1 Dim strConn As String = "" Dim gMsg As String = "" Private Sub btnTestConnection_Click(sender As System.Object, e As System.EventArgs) Handles btnTestConnection.Click strConn = "Data Source=" strConn += Trim(txtServer.Text) + ";Initial Catalog=HouseholdInventory;Persist Security Info=True;User ID=" strConn += Trim(txtLoginName.Text) + ";Password=" + Trim(txtPassword.Text) Dim TestConn As New SqlClient.SqlConnection TestConn.ConnectionString = strConn Try TestConn.Open() btnTestConnection.Text = "Successful Connection" btnTestConnection.BackColor = Color.Green Catch ex As Exception gMsg = "The following error occurred trying to build the connection:" + vbCrLf + ex.Message If Not IsNothing(ex.InnerException) Then gMsg += vbCrLf + "Inner Exception:" + vbCrLf + ex.InnerException.Message gMsg += vbCrLf + "Connection String: " + vbCrLf + strConn MsgBox(gMsg) btnTestConnection.Text = "Connection Failed" btnTestConnection.BackColor = Color.Red End Try btnReset.Enabled = True End Sub Private Sub btnReset_Click(sender As System.Object, e As System.EventArgs) Handles btnReset.Click btnTestConnection.BackColor = Color.LightGray btnReset.Enabled = False btnTestConnection.Text = "Test Connection" End Sub End Class
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|I need help parsing JSON in my MVC.Net Unit Test project||1||13|
|VB.Net Developer - Suggestions for Web Programming OnLine Learning||4||60|
|How does this modal gets closed?||6||42|
|when sa SQL Login becomes locked||6||33|
Join the community of 500,000 technology professionals and ask your questions.