How does SqlDataReader handle really large queries?(转载)
问 Actually I'm not sure the title accurately describes the question, but I hope it is close enough. I have some code that performs a SELECT from a database table that I know will result in about 1.5 million rows being selected. The data in each row isn't large - maybe 20 bytes per row. But that's still 30MB of data. Each row contains a customer number, and I need to do something with each customer. My code looks something like: SqlConnection conn = new SqlConnection(connString); SqlCommand command = new SqlCommand("SELECT ... my select goes here", conn); using (conn) { conn.Open(); using