Guest User

Untitled

a guest
Jan 6th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public void dbConnect()
  2. {
  3.  
  4. SqlConnection conn = new SqlConnection();
  5. conn.ConnectionString = ("Server= localhost; Database= leaguedraw; Password= [private]; Integrated Security = SSPI");
  6. SqlCommand username = new SqlCommand("SELECT username FROM users where username = @username");
  7.  
  8. try
  9. {
  10. conn.Open();
  11. MessageBox.Show("Connection is Open");
  12. conn.Close();
  13. }
  14. catch(Exception ex)
  15. {
  16. MessageBox.Show("Connection not Found");
  17. }
  18.  
  19. }
Add Comment
Please, Sign In to add comment