Esempio n. 1
0
        /// <summary>
        ///		<para>Creates a connection for this database.</para>
        /// </summary>
        /// <remarks>
        ///		This method has been overridden to support keeping a single connection open until you
        ///		explicitly close it with a call to <see cref="CloseSharedConnection"/>.
        /// </remarks>
        /// <returns>
        ///		<para>The <see cref="DbConnection"/> for this database.</para>
        /// </returns>
        /// <seealso cref="DbConnection"/>
        public override DbConnection CreateConnection()
        {
            DbConnection connection = SqlCeConnectionPool.CreateConnection(this);

            connection.ConnectionString = ConnectionString;
            return(connection);
        }
Esempio n. 2
0
 /// <summary>
 ///		This will close the "keep alive" connection that is kept open once you first access
 ///		the database through this class. Calling this method will close the "keep alive"
 ///		connection for all instances. The next database access will open a new "keep alive"
 ///		connection.
 /// </summary>
 public void CloseSharedConnection()
 {
     SqlCeConnectionPool.CloseSharedConnection(this);
 }