is it possible to send one command and return multiple record sets
instead of creating 3 separate command objects
and executing them independently
Tia
DaveP
If you were connecting to the sample pubs database, you could return 2
resultsets w/ the following:
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = @"BEGIN
select * from authors
select * from titles
END";
try
{
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while ( rdr.Read() )
Console.WriteLine("author={0} {1}", rdr["au_fname"],
rdr["au_lname"]);
rdr.NextResult();
while ( rdr.Read() )
Console.WriteLine("title={0}", rdr["title"]);
rdr.Close();
}
catch
{ // do whatever here....
}
finally
{
conn.Close();
}