예제 #1
0
 /// <summary>
 /// Closes an existing connection.
 /// </summary>
 public static void CloseConnection()
 {
     if (Instance != null)
     {
         Instance.Dispose();
         instance = null;
     }
 }
예제 #2
0
 /// <summary>
 /// Opens the connection to use for the database.
 /// </summary>
 /// <param name="connectionString">The connection string about the database.</param>
 /// <returns>True, if the connection is opened, otherwise false.</returns>
 public static bool OpenConnection(string connectionString)
 {
     lock (lockObject)
     {
         CloseConnection();
         instance = new BizContext(connectionString);
     }
     return(true);
 }