W
William
Hi
I have an ASP.NET application that connects to an Access database.
Everything works fine except for the Session object. Data in the session
object is lost after I've made a call to the database.
To test, I've created two test aspx pages. Test1.aspx contains two buttons.
The first button sets values in the session object and then navigates to
Test2.aspx. Test2.aspx only displays the values in the session object.
The second button creates a connection to the database, executes a SQL
statement and then does exactly the same as the first button. (Code is
copied from first button). In Test2.aspx, the values set is seen as Nothing.
For the connection to the database, I tried:
- Created a custom data class that creates the connection and provides
access to the
database. Connection is a OledbConnection connecting via OLEDB JET.
- Used the same class but changed the connection to OdbcConnection.
- Created the connection directly from the aspx page.
The SQL statement executes with no problem, but as soon as the procedure /
function has finished executing, the session data is lost. I changed the
connection to test it on a SQL Server database. Works fine. However, the
server where the application is to be deployed does not have SQL Server and
we must use an Access database. I've done something similar in old ASP
before and it worked fine.
Any help, please.
I have an ASP.NET application that connects to an Access database.
Everything works fine except for the Session object. Data in the session
object is lost after I've made a call to the database.
To test, I've created two test aspx pages. Test1.aspx contains two buttons.
The first button sets values in the session object and then navigates to
Test2.aspx. Test2.aspx only displays the values in the session object.
The second button creates a connection to the database, executes a SQL
statement and then does exactly the same as the first button. (Code is
copied from first button). In Test2.aspx, the values set is seen as Nothing.
For the connection to the database, I tried:
- Created a custom data class that creates the connection and provides
access to the
database. Connection is a OledbConnection connecting via OLEDB JET.
- Used the same class but changed the connection to OdbcConnection.
- Created the connection directly from the aspx page.
The SQL statement executes with no problem, but as soon as the procedure /
function has finished executing, the session data is lost. I changed the
connection to test it on a SQL Server database. Works fine. However, the
server where the application is to be deployed does not have SQL Server and
we must use an Access database. I've done something similar in old ASP
before and it worked fine.
Any help, please.