Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1.  public static void InitializeDB()
  2.         {
  3.             MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();
  4.             builder.Server = SERVER;
  5.             builder.UserID = UID;
  6.             builder.Password = PASSWORD;
  7.             builder.Database = DATABASE;
  8.  
  9.             String connString = builder.ToString();
  10.  
  11.             builder = null;
  12.  
  13.             Console.WriteLine(connString);
  14.  
  15.             dbConn = new MySqlConnection(connString);
  16.  
  17.             Application.ApplicationExit += (sender, args) => {
  18.                 if (dbConn != null)
  19.                 {
  20.                     dbConn.Dispose();
  21.                     dbConn = null;
  22.                 }
  23.             };
  24.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement