What's the difference between using .NextResult
and Multiple
Active Result Sets?
sqlReader.NextResult();
while (sqlReader.Read())
{
MessageBox.Show("From third SQL - " +
sqlReader.GetValue(0) + " - " +
sqlReader.GetValue(1));
}
MARS
private static string GetConnectionString()
{
// To avoid storing the connection string in your code,
// you can retrive it from a configuration file.
return "Data Source=(local);Integrated Security=SSPI;" +
"Initial Catalog=AdventureWorks;MultipleActiveResultSets=True";
}