Hi
I use C# and SQL Server 2005 and I need a recommendation on how to populate my objects.
I have a Customers collection containing a collection of customer objects. Each customer object contains a Orders collection, containing a collection of orders.
I use a public Fetch() method on my Customers collection to populate the customers and their orders.
You can only have one DataReader open per connection, right. So that would mean that I need one connection for the 'SELECT * Customers' reader, and while I iterate through the customers reader I would need another connection for each 'SELECT * Orders WHERE CustomerId_fk = @Id'.
My question : Would you recommend I use the above way or just plain DataSets ?
EDIT
I had 'SELECT * Customers WHERE Id = @Id' Instead of 'SELECT * Customers'.