Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple Components In One Solution Accessing Data
Message
From
26/10/2009 21:33:13
 
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01431578
Message ID:
01431613
Views:
34
Not sure I follow your intentions 100%, but in any case, there's really no reason to have one and only one connection. Connection pooling will automatically re-use connections so there's really no "hit" involved in creating and opening/closing connections as you need them. In fact, if you think about it in the realm of web service calls (don't know if you're using web services or not), but each call to the back-end via a web service method will totally create a new connection. Again, the automatic use of connection pooling makes this a non-issue.

~~Bonnie



>I'm working on a solution that pulls in components from different projects. I have my Data Access class, some custom controls I wrote, my App Security class, and the WinForm components. All of these access data, and so far, all of them use their own connections.
>
>I was thinking about creating a ref to my data access class in each project that needs data. I would also include a Connection property that, if populated with an open connection, would be used so that in most cases, I'd only ever have one connection to the data source. If the connection property has not been populated, then the class would establish it's own connection using the data access class.
>
>Any thoughts on this?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform