Hello,
Given bwlow is the code I use to connect to my SQL 2008 R2 Server. The connection is excellent. My problem is that I cannot display a messagebox on logon failure. I do not wish to use Dim sqlCnn As New SqlConnection, Dim connString As String = My.Settings.Item("CustomerConnectionString").ToString, etc. Here is the code:
Thank you.
Private Sub LoginBtn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBtn1.Click
My.Settings.Item("CustomerConnectionString") = "Data Source=FAROOK-PC\SQLEXPRESS;Initial Catalog= '" & Me.ComboBox1.Text & "'; uid = '" & Me.Login1.Text & "'; pwd = '" & Me.Password1.Text & "'"
Form1.Show()
Me.Hide()
End Sub
Given bwlow is the code I use to connect to my SQL 2008 R2 Server. The connection is excellent. My problem is that I cannot display a messagebox on logon failure. I do not wish to use Dim sqlCnn As New SqlConnection, Dim connString As String = My.Settings.Item("CustomerConnectionString").ToString, etc. Here is the code:
Thank you.
Private Sub LoginBtn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBtn1.Click
My.Settings.Item("CustomerConnectionString") = "Data Source=FAROOK-PC\SQLEXPRESS;Initial Catalog= '" & Me.ComboBox1.Text & "'; uid = '" & Me.Login1.Text & "'; pwd = '" & Me.Password1.Text & "'"
Form1.Show()
Me.Hide()
End Sub