public static void Close() { if (cn != null) { cn.Close(); cn = null; } if (me != null) { me =null; } }
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; }