BeginExecuteReader() public method

public BeginExecuteReader ( ) : IAsyncResult
return IAsyncResult
Esempio n. 1
0
        public void TestAsynchronousReader2()
        {
            NuoDbConnection connection = new NuoDbConnection(connectionString);
            NuoDbCommand command = new NuoDbCommand("select * from hockey", connection);

            connection.Open();

            AsyncCallback callback = new AsyncCallback(HandleCallback);
            IAsyncResult result = command.BeginExecuteReader(callback, command);
        }
Esempio n. 2
0
        public void TestAsynchronousReader1()
        {
            using (NuoDbConnection connection = new NuoDbConnection(connectionString))
            {
                NuoDbCommand command = new NuoDbCommand("select * from hockey", connection);

                connection.Open();
                IAsyncResult result = command.BeginExecuteReader();

                using (DbDataReader reader = command.EndExecuteReader(result))
                {
                    while (reader.Read())
                    {
                        Console.WriteLine("\t{0}\t{1}\t{2}\t{3}", reader[0], reader[1], reader[2], reader["id"]);
                    }
                }
            }
        }