コード例 #1
0
        static async Task DoIt()
        {
            string connectionString = ConnectionStringCurrent.Build();

            // Make sure connection is always closed to close and release server connection into the pool
            using (AceQLConnection connection = new AceQLConnection(connectionString))
            {
                await ExecuteExample(connection).ConfigureAwait(false);

                await connection.CloseAsync();
            }
        }
コード例 #2
0
        /// <summary>
        /// RemoteConnection Quick Start client example.
        /// Creates a Connection to a remote database and open it.
        /// </summary>
        /// <returns>The connection to the remote database</returns>
        /// <exception cref="AceQLException">If any Exception occurs.</exception>
        public static async Task <AceQLConnection> ConnectionBuilderAsync()
        {
            string connectionString = ConnectionStringCurrent.Build();

            AceQLConnection theConnection = new AceQLConnection(connectionString);

            // Opens the connection with the remote database.
            // On the server side, a JDBC connection is extracted from the connection
            // pool created by the server at startup. The connection will remain ours
            // during the session.
            await theConnection.OpenAsync();

            return(theConnection);
        }
コード例 #3
0
        static async Task DoIt()
        {
            var netCoreVer = System.Environment.Version; // 3.0.0

            AceQLConsole.WriteLine(netCoreVer + "");

            string connectionString = ConnectionStringCurrent.Build();

            using (AceQLConnection connection = new AceQLConnection(connectionString))
            {
                await ExecuteExample(connection).ConfigureAwait(false);

                //NOT Neccessary: await connection.CloseAsync();
            }
        }
コード例 #4
0
        static async Task DoIt()
        {
            var netCoreVer = System.Environment.Version; // 3.0.0

            AceQLConsole.WriteLine(netCoreVer + "");

            string connectionString = ConnectionStringCurrent.Build();

            using (AceQLConnection connection = new AceQLConnection(connectionString))
            {
                connection.RequestRetry = true;
                connection.AddRequestHeader("aceqlHeader1", "myAceQLHeader1");
                connection.AddRequestHeader("aceqlHeader2", "myAceQLHeader2");

                await ExecuteExample(connection).ConfigureAwait(false);

                await connection.CloseAsync();
            }
        }