Beispiel #1
0
        public void TestAsyncExecuteNonQuery()
        {
            var cmd = Connection.CreateCommand();

            cmd.CommandText = "CREATE TEMPORARY TABLE Test (value int); INSERT INTO Test (value) VALUES (1)";
            IFuture f = cmd.AsyncExecuteNonQuery();

            f.GetCompletionEvent().Wait();

            cmd.CommandText = "SELECT value FROM Test LIMIT 1";
            f = cmd.AsyncExecuteScalar();
            f.GetCompletionEvent().Wait();
            Assert.AreEqual(1, f.Result);

            cmd.Dispose();
        }