Click here to Skip to main content
15,882,114 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am using 3 tier architecture.
There is db class for handling saving & deleting routines and i am calling these routine<s in the events in page class.
In db class.
1.connect opened,
2. transaction initialized to begin transaction
3. calling the procedures for saving or deletion
4. if success transaction committed else transaction rollbacked
5. connection closed .
When i am running the website and saving the connection opened and while calling the page class for the connection status is closed. and the transction object is get Nothing
Posted
Updated 18-Oct-10 22:03pm
v2
Comments
Dalek Dave 19-Oct-10 4:03am    
Edited for Readability
Brij 19-Oct-10 4:06am    
Debug the code, might be connection is getting closed somehow.
Venkatesh Mookkan 19-Oct-10 4:07am    
It would you easy for us to give you a solution if you post some of that code here.
[no name] 19-Oct-10 5:22am    
post code --
RDBurmon 21-Oct-10 9:29am    
have u ever check what value the recordset object holding when it shows you as open ?

1 solution

Are you trying to return a DataReader after you have closed your connection?

If so, well, you cant do that. You will need to ensure that you class implements an IDisposable.

That way you will be able to perform a Using and then on clean up close the connection and also remember to close the connection in any catches.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900