I'm looking for a way to improve my to access the database from WebParts.
Right now, each and every single time i need to get/set some data from the database (either with linq or with System.Data.SqlClient), I:
- Retrieve the connection string from web config
- Establish a new connection (time consuming)
- Execute
- Close connection (time consuming)
- Release used objects
Is there a better way, e.g. establish a single connection on page load and "reuse" it on every calls, or use the same used by the sharepoint unlying application?
Thank you!