I find that my first .NET 2.0 web application is very slow. The only thing I can think of is that I have too many database connection objects on the same page.
My first question to anyone is is it possible for multiple server controls to use the same database connection object but with different SQL Commands without calling any subprograms? I do not know how to do this without creating more than one database control.
Also, are these multiple database connections causing the slowness on my site?
Do the database server controls automatically close their connections?
My .NET 2.0 app has these 4 database server controls:
<asp:AccessDataSource id="ReleaseDate" Runat="Server" DataFile="ff.mdb" SelectCommand="SELECT * FROM schedule where year(release_date)='2005' " />
<asp:AccessDataSource id="sqlSelectAll" Runat="Server" DataFile="ff.mdb" SelectCommand="SELECT distinct director FROM schedule" />
<asp:AccessDataSource id="sqlCategories" Runat="Server" DataFile="ff.mdb" SelectCommand="SELECT distinct category FROM schedule" />
<asp:accessdatasource id="sqlDistinctYear" runat="server" datafile="ff.mdb" selectcommand="SELECT DISTINCT Year([release_date]) AS release_year FROM schedule" />
How can I program multiple controls to use only ONE database connection with different SelectCommand attributes without calling any subprograms?