469,917 Members | 1,748 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

Begin and commit transaction

Hello

I am writing an ASP.NET / SQL-Server application and wanting to know when to
connect/begin-transaction and commit/disconnect.

I have a common module which I call at the beginning of Page_Load which,
when instantiated performs the connect/begin-transaction. The page then
does what it has to do (eg when a Save button is clicked it will do a
read/write to the database within the btnSave_Clicked event). At the end of
the 'event' (eg btnSave_Clicked) I then do a commit/disconnect.

My question is, is this when the commit/disconnect should be called or is
there an event within the page that gets fired after all click events have
been run and just before the page displays. I know there's a finalize but
is this where these types of tasks are performed.

Or is there another easier/standardized way this is all done.

Cheers
Horace


Nov 21 '05 #1
1 4198
Hi,

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------
"Horace" <so******@nowhere.com> wrote in message
news:qh*************@nnrp1.ozemail.com.au...
Hello

I am writing an ASP.NET / SQL-Server application and wanting to know when to
connect/begin-transaction and commit/disconnect.

I have a common module which I call at the beginning of Page_Load which,
when instantiated performs the connect/begin-transaction. The page then
does what it has to do (eg when a Save button is clicked it will do a
read/write to the database within the btnSave_Clicked event). At the end of
the 'event' (eg btnSave_Clicked) I then do a commit/disconnect.

My question is, is this when the commit/disconnect should be called or is
there an event within the page that gets fired after all click events have
been run and just before the page displays. I know there's a finalize but
is this where these types of tasks are performed.

Or is there another easier/standardized way this is all done.

Cheers
Horace

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Markus Breuer | last post: by
3 posts views Thread by Mark | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.