Hi all, i'm new to .net programming and i have some problems with database connection. I have written two web application. Both of them use ADODB Connection to Sql Server 2000 database. The problem is in second one.
The first application is used for order management. I have defined in Main.aspx page a variable called localSqlConnection. Every time i enter this page (only one time per session) i create connection to local database and then i save this variable in Session object. Whenever i need connection to database in other project aspx page i retrieve connection from db, casting it to SqlConnection class and all works correctly. This first application is used by a little group of users
The second application is used by a greater number of users. It is used for request management. Before starting coding i suspect that connection saved in session is'nt a good solution for large numbers so I modify my code removing the use of Session Obect. In each aspx page i put a method that create/open connection and a method that close connection to database. I call this two method every time Page_Load and Page_Unload event was raised. Each method of Page Class uses my local page variable. It seems to works but something was wrong because a lot of time i receive database connection error !!! When it appens i launch the iisreset command on web server and all restart working, but this is not an acceptable solution.
So, what i can try ? I can't modify all my code for open and close connection every time i have to make a database operation. It's a lot of code.
Is there any solutions ?
Thanks in advance
Emanuele