Advertisement
Guest User

sqlconnection

a guest
Mar 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System.Data.SQLite;
  2. using System.IO;
  3.  
  4. namespace AllRound
  5. {
  6.     class discordbotDB
  7.     {
  8.         public SQLiteConnection myConnection;
  9.  
  10.         public discordbotDB()
  11.         {
  12.             myConnection = new SQLiteConnection("Data source=discordbot.sqlite");
  13.         }
  14.         public void OpenConnection()
  15.         {
  16.             if (myConnection.State == System.Data.ConnectionState.Closed)
  17.             {
  18.                 myConnection.Open();
  19.             }
  20.         }
  21.         public void CloseConnection()
  22.         {
  23.             if (myConnection.State == System.Data.ConnectionState.Open)
  24.             {
  25.                 myConnection.Close();
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement