Hello David,
The things you have to draw an attention are caching and connection pool.
You should not connect each time to DB (moreover "multiple times in a single
page load") to get data, use cache
to keep selected data. Only if data changes - you need to update your cache
from DB.
Second is connection pool - it save time to create new connection to DB
PS: if u use SQLServer see at notify services. SQL can notify you when data
in tables is changed, without constant refreshing state of tables
DD> To that end, I'm wondering if the method I use to retrieve data via
DD> a SELECT statement is the best way of doing things. For my current
DD> web applications, all data is retrieved from a seperate web service
DD> which connects to the database. Ultimately, every time data is
DD> retrieved, it boils down to the following function:
DD>
DD> mySqlConnection = new MySqlConnection(stringDatabaseConnection);
DD> mySqlDataAdapter = new MySqlDataAdapter(stringSelect,
DD> mySqlConnection);
DD> dataSetSQL = new DataSet();
DD> mySqlDataAdapter.Fill(dataSetSQL);
DD> return dataSetSQL;
DD> This function is called by pretty much every page in the web
DD> application, often multiple times in a single page load. Is what
DD> I'm doing here causing too much overhead? I notice that each call
DD> is its own new connection to the database. Is there a better way
DD> that has just one running connection that handles all the queries?
DD>
DD> If someone could advise me on this or point me to some good
DD> tutorials (code samples are best) I'd really appreciate it. Thanks.
DD>
DD> Regards,
DD> David P. Donahue
DD> ddonahue@ccs.neu.edu
---
WBR,
Michael Nemtsev :: blog:
http://spaces.msn.com/laflour "At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche