Guest User

Untitled

a guest
Oct 30th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using MySql.Data.MySqlClient;
  10. using MySql.Data.MySqlClient.Authentication;
  11. using System.Windows;
  12. using System.Windows.Forms;
  13.  
  14. namespace GiftCardManager
  15. {
  16. public partial class Form1 : Form
  17. {
  18. MySqlConnection conn;
  19. string connString;
  20. public Form1()
  21. {
  22. InitializeComponent();
  23. }
  24.  
  25. private void Form1_Load(object sender, EventArgs e)
  26. {
  27.  
  28. }
  29.  
  30. private void button1_Click(object sender, EventArgs e)
  31. {
  32. connString = "host=130.211.134.121;user=WillsSubs;password=****;Database=WillsSubs;";
  33.  
  34. try
  35. {
  36. conn = new MySqlConnection();
  37. conn.ConnectionString = connString;
  38. conn.Open();
  39. MessageBox.Show("YES");
  40. }
  41. catch (MySql.Data.MySqlClient.MySqlException ex)
  42. {
  43. Clipboard.SetText(ex.Message);
  44. MessageBox.Show(ex.Message);
  45. }
  46. }
  47. }
  48. }
Add Comment
Please, Sign In to add comment