コード例 #1
0
        public void NextResultTest()
        {
            string querys = "select * from TEST order by INT_FIELD asc;" +
                            "select * from TEST order by INT_FIELD desc;";

            BdpTransaction transaction = Connection.BeginTransaction();
            BdpCommand     command     = new BdpCommand(querys, Connection, transaction);

            BdpDataReader reader = command.ExecuteReader();

            Console.WriteLine();
            Console.WriteLine("DataReader - NextResult Method - Test ( First Result )");

            while (reader.Read())
            {
                for (int i = 0; i < reader.FieldCount; i++)
                {
                    Console.Write(reader.GetValue(i) + "\t");
                }

                Console.WriteLine();
            }

            if (reader.NextResult())
            {
                Console.WriteLine("DataReader - NextResult Method - Test ( Second Result )");

                while (reader.Read())
                {
                    for (int i = 0; i < reader.FieldCount; i++)
                    {
                        Console.Write(reader.GetValue(i) + "\t");
                    }

                    Console.WriteLine();
                }
            }

            reader.Close();
            transaction.Rollback();
            command.Dispose();
        }