Connect SQL Server on button click VB.net
问题 How to connect SQL Server on button click? I want to manually enter the Server, Username and Password into textboxes. I have a code here but I'm not sure if it's correct. Private Sub SQLConnect_Click(sender As Object, e As EventArgs) Handles SQLConnect.Click Dim con As SqlConnection = New SqlConnection("Server=" & SQLServer.Text & ";Database=GameDB;User Id=" & SQLUser.Text & ";Password=" & SQLPwd.Text & ";") con.Open() MsgBox("Successfully Connected!") 'con.Close() End Sub Idk how to check if