Industry Online Support
Technical Forum
9/27/2006 9:11 AM | |
Joined: 10/13/2005 Last visit: 9/3/2024 Posts: 33 Rating: (3) |
Hi. I often use ADO and ADO.NET in order to connect to databases (almost always Ms SQL server). I believe that the recommended way is to keep a connection open only for as long as it is needed. Opening connections for me takes milliseconds and the sql statement or query is usually what takes most time, so I'm unsure why only opening the connection takes seconds for you. I also recommend to read about connection pooling which at least SQL server uses (identical connectionstrings share the same connection). Here's a link to that: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconnectionpoolingforsqlservernetdataprovider.asp |
Follow us on