This was not the best approach from a Round-Robin / Connection Pooling standpoint.
http://www.learnasp.com/learn/dbpooling.asp
http://www.learnasp.com/advice/roundrobin.asp
Scalability is higher if you close early and open late.
in ADO.Net should i open the connection & keep it open whole through the application or open it & close it only when required. which is the most efficient way
Close it because Connection Polling still happens same way under the covers. ASP.net makes it almost impossible to get this wrong because the only "connected" data object (the DataReader) forbids using the SAME connection for mutiple open datareaders. In fact doing it wrong is really difficult in ASP.net and really easy to do it wrong in Classic ASP.
The most efficient thing in .net is to master caching - Page Caching, Fragment Caching, Cache objects and dependencies.
www.learnasp.com/freebook/learn/caching.aspx
Some sample caching is @
www.learnasp.com/freebook/learn/cachepage.aspx
www.learnasp.com/.../...archeruc_cached_fixed.aspx
But Utility Belt supports the easiest kind of caching ala:
www.learnasp.com/.../...belt_cached_sqlclient.aspx
I am working on some upadates to those caching pages and some more caching examples keep an eye on:
http://www.learnasp.com/freebook/learn/index.aspx
specifically the
Speed / Optimization
section.