Are there any pitfalls to using an IEnumerable return type for SQL data?

I wouldn't use it, because it hides what's happening, and it could possibly leave database connections without proper disposal.

This is not a pattern I would follow. I would not worry as much about load on the server as I would about locks. Following this pattern integrates the data retrieval process into your business logic flow, and that seems like an all-around recipe for trouble; you have no idea what happens on the iteration side, and you're inserting yourself into it.

Retrieve your data in one shot, then allow the client code to enumerate over it once you've closed the reader.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions