This question is locked. New answers and comments are not allowed.
Hi,
I have a "best practice" question:
Would like to have global database access in my code behind, without having to open a connection/create an object every time.
Today in LINQ to SQL, I open a datacontext object i Page_Load and close it again in Page_Unload.
The Page_Load/Unload are placed in a "master" class that my page inherit from.
Therefore all my "in-between" code have easy access to the data.
I know that any time consuming code will hold a connection open, and this is a drawback using this "solution".
Does OpenAccess support this approach - and what would the Page_Load/Unload code look like?
Final question,- can you suggest a method, or best practice, as simple as the one I use today?
Regards,
Bo Hessner
I have a "best practice" question:
Would like to have global database access in my code behind, without having to open a connection/create an object every time.
Today in LINQ to SQL, I open a datacontext object i Page_Load and close it again in Page_Unload.
The Page_Load/Unload are placed in a "master" class that my page inherit from.
Therefore all my "in-between" code have easy access to the data.
I know that any time consuming code will hold a connection open, and this is a drawback using this "solution".
Does OpenAccess support this approach - and what would the Page_Load/Unload code look like?
Final question,- can you suggest a method, or best practice, as simple as the one I use today?
Regards,
Bo Hessner