I wasn't aware of it, until now anyway...
using (SqlConnection conn = new SqlConnection("your-connection-string")){ string query = "SELECT * FROM T1; SELECT * FROM T2;"; SqlCommand cmd = new SqlCommand(query, conn); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); do { while(reader.Read()) { // read each row in the statement results. } } while(reader.NextResult()); // jump to the next statement results.}
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2009, Oren Ellenbogen
<= Contact me via E-mail
newtelligence dasBlog 2.2.8279.16125