我使用以下連接字符串並且能夠登錄到SQL 2008 R2 Server。如何顯示App.Config連接字符串的登錄失敗消息框
My.Settings.Item("CustomerConnectionString") = "Data Source=FAROOK-PC\SQLEXPRESS;Initial
Catalog= '" & Me.ComboBox1.Text & "'; uid = '" & Me.Login1.Text & "'; pwd = '" &
Me.Password1.Text & "'"
如何在登錄失敗時顯示消息框。
謝謝。
中的try/catch包裝和捕獲異常.... HTTP://stackoverflow.com/questions/2601497/test-sql-connection-without-throwing-exception – 2012-01-11 09:40:16