有没有办法知道当前已加载哪个查询SqlDataReader.NextResult?

问题描述

我可以参考Microsoft https://developer.android.com/reference/android/provider/MediaStore.Audio.Radio的原始链接

static void RetrieveMultipleResults(sqlConnection connection)
{
    using (connection)
    {
        sqlCommand command = new sqlCommand(
          "SELECT CategoryID,CategoryName FROM dbo.Categories;" +
          "SELECT EmployeeID,LastName FROM dbo.Employees",connection);

        connection.open();

        sqlDataReader reader = command.ExecuteReader();

        while (reader.HasRows)
        {
            Console.WriteLine("Name of the current sql text");

            Console.WriteLine("\t{0}\t{1}",reader.GetName(0),reader.GetName(1));

            while (reader.Read())
            {
                Console.WriteLine("\t{0}\t{1}",reader.GetInt32(0),reader.GetString(1));
            }

            reader.NextResult();
        }
    }
}

我刚刚插入了代码

Console.WriteLine("Name of the current sql text")  

为了说明我的问题。

是否有办法了解两者中的哪一个处于活动状态(或已加载)?

SELECT CategoryID,CategoryName FROM dbo.Categories;

SELECT EmployeeID,LastName FROM dbo.Employees

我尝试为reader变量“添加监视”以查看更改,但没有成功。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...