using .NextResult
和Multiple
活动结果集有什么区别?
sqlReader.NextResult();
while (sqlReader.Read())
{
MessageBox.Show("From third SQL - " +
sqlReader.GetValue(0) + " - " +
sqlReader.GetValue(1));
}
火星
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";
}