You need to call the next result, like this:
// Get the reader.
using (IDataReader dataReader = db.ExecuteReader(dbCommandWrapper))
{
// Cycle while there are results.
do
{
// Cycle while there are records.
while (dataReader.Read())
{
}
} while (dataReader.NextResult());
}
I didn't run this through a compiler, but you should get the general
idea for the syntax. The key here is the call to NextResult. Of course,
putting it in a loop like this isn't going to be the right way to do this,
since you will probably need specific processing of each result.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com IDataReader dataReader = db.ExecuteReader(dbCommandWrapper); while
(dataReader.Read()) {
<or****@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com... Hello,
I am using Microsoft.Practices.EnterpriseLibrary.Data.
I am running the following
sqlCommand = "SELECT var1 FROM table1 WHERE var2 IN (4,5,6) ; SELECT
var3 FROM table2 WHERE var2 IN (4,5,6)";
IDataReader dataReader = db.ExecuteReader(dbCommandWrapper); while
(dataReader.Read()) {
The problem is that the dataReader holds only the data from table1 i.e.
the first select statment.
Do you have any idea how to work it out?