Пример #1
0
 public static void Close()
 {
     if (cn != null)
     {
         cn.Close();
         cn = null;
     }
     if (me != null)
     {
         me =null;
     }
 }
Пример #2
0
 public static DBHelper getInstance(string connectionString)
 {
     if (cn == null)
     {
         cn = new OleDbConnection(connectionString);
     }
     if (cn.State != ConnectionState.Open)
     {
         cn.Open();
     }
     if (me == null)
     {
         me = new DBHelper();
     }
     return me;
 }