473,415 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,415 software developers and data experts.

Web Form and ADO.NeT Transaction

Lit
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit
Aug 8 '07 #1
10 1477
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit


Aug 9 '07 #2
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit


Aug 9 '07 #3
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit


Aug 9 '07 #4
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit


Aug 9 '07 #5
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit


Aug 9 '07 #6
Lit
Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transaction = oTran;
oCmd1.ExecuteNonQuery();

oCmd2.Transaction = oTran;
oCmd2.ExecuteNonQuery();
...

Question is: Can I reuse the same command object? by setting the
command.Text to a different SP and Different Parameters instead of creating
different command objects.
would that work and is it more efficient.

Thanks again,

Lit
"Aidy" <ai**@xxnoemailxx.comwrote in message
news:l7*********************@bt.com...
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
>Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I
use just one command/transaction or have to use multiple ( then commit or
rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit



Aug 9 '07 #7
Don't see what you can't re-use the same command object but I don't think
you'll particularly gain anything.

"Lit" <sq**********@hotmail.comwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transaction = oTran;
oCmd1.ExecuteNonQuery();

oCmd2.Transaction = oTran;
oCmd2.ExecuteNonQuery();
...

Question is: Can I reuse the same command object? by setting the
command.Text to a different SP and Different Parameters instead of
creating different command objects.
would that work and is it more efficient.

Thanks again,

Lit
"Aidy" <ai**@xxnoemailxx.comwrote in message
news:l7*********************@bt.com...
>Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
>>Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can
I
use just one command/transaction or have to use multiple ( then commit
or rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit




Aug 10 '07 #8
Lit
Aidy,

By reusing the Command Object I can reduce the number of objects in the heap
memory?

Thanks for your help.

Lit

"Aidy" <ai**@xxnoemailxx.comwrote in message
news:eu******************************@bt.com...
Don't see what you can't re-use the same command object but I don't think
you'll particularly gain anything.

"Lit" <sq**********@hotmail.comwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
>Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transaction = oTran;
oCmd1.ExecuteNonQuery();

oCmd2.Transaction = oTran;
oCmd2.ExecuteNonQuery();
...

Question is: Can I reuse the same command object? by setting the
command.Text to a different SP and Different Parameters instead of
creating different command objects.
would that work and is it more efficient.

Thanks again,

Lit
"Aidy" <ai**@xxnoemailxx.comwrote in message
news:l7*********************@bt.com...
>>Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can
I
use just one command/transaction or have to use multiple ( then commit
or rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas, needs also code links etc..
Lit




Aug 10 '07 #9
Yeah, but you'll need to clear out the old parameters collection. Maybe you
are using slightly less space, but you need to execute more commands.
Swings and roundabouts really.

"Lit" <sq**********@hotmail.comwrote in message
news:uF**************@TK2MSFTNGP02.phx.gbl...
Aidy,

By reusing the Command Object I can reduce the number of objects in the
heap memory?

Thanks for your help.

Lit

"Aidy" <ai**@xxnoemailxx.comwrote in message
news:eu******************************@bt.com...
>Don't see what you can't re-use the same command object but I don't think
you'll particularly gain anything.

"Lit" <sq**********@hotmail.comwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
>>Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transaction = oTran;
oCmd1.ExecuteNonQuery();

oCmd2.Transaction = oTran;
oCmd2.ExecuteNonQuery();
...

Question is: Can I reuse the same command object? by setting the
command.Text to a different SP and Different Parameters instead of
creating different command objects.
would that work and is it more efficient.

Thanks again,

Lit
"Aidy" <ai**@xxnoemailxx.comwrote in message
news:l7*********************@bt.com...
Have a look here

http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6

"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl...
Hi,
>
using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction.
Can I
use just one command/transaction or have to use multiple ( then commit
or rollback all )
How does it work with ADO.NET
>
Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...
>
if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )
>
Thanks for any help or other Ideas, needs also code links etc..
>
>
Lit
>
>





Aug 10 '07 #10
Lit
Aidy,

you got a good point there. It is going to be a balancing game.
I will have to think about my domain of contexts ( small infinity ) and see
what would be best.

Thank you for the enlightenment.

Lit
"Aidy" <ai**@xxnoemailxx.comwrote in message
news:GM******************************@bt.com...
Yeah, but you'll need to clear out the old parameters collection. Maybe
you are using slightly less space, but you need to execute more commands.
Swings and roundabouts really.

"Lit" <sq**********@hotmail.comwrote in message
news:uF**************@TK2MSFTNGP02.phx.gbl...
>Aidy,

By reusing the Command Object I can reduce the number of objects in the
heap memory?

Thanks for your help.

Lit

"Aidy" <ai**@xxnoemailxx.comwrote in message
news:eu******************************@bt.com...
>>Don't see what you can't re-use the same command object but I don't
think you'll particularly gain anything.

"Lit" <sq**********@hotmail.comwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transaction = oTran;
oCmd1.ExecuteNonQuery();

oCmd2.Transaction = oTran;
oCmd2.ExecuteNonQuery();
...

Question is: Can I reuse the same command object? by setting the
command.Text to a different SP and Different Parameters instead of
creating different command objects.
would that work and is it more efficient.

Thanks again,

Lit
"Aidy" <ai**@xxnoemailxx.comwrote in message
news:l7*********************@bt.com...
Have a look here
>
http://msdn.microsoft.com/msdnmag/is...DataPoints/#S6
>
"Lit" <sq**********@hotmail.comwrote in message
news:O0**************@TK2MSFTNGP04.phx.gbl.. .
>Hi,
>>
>using ADO.NET 2.0, VS.NET 2005, SQL2005
>I need to execute several Stored Procedures under one transaction.
>Can I
>use just one command/transaction or have to use multiple ( then
>commit or rollback all )
>How does it work with ADO.NET
>>
>Ado.Tran
> SP1 Called
> loop
> SP2 Called
> SP3 Called
> loop
> SP4 Called
> loop
> Sp5 Called
>Etc... etc...
>>
>if any error
> rollback transaction ( or all transactions )
>else
> committe Transaction ( or all Transactions )
>>
>Thanks for any help or other Ideas, needs also code links etc..
>>
>>
>Lit
>>
>>
>
>





Aug 10 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan Corkum | last post by:
Good morning. I am working on an issue that is just baffling me. I have developed an .aspx page that receives an http form post that has a "file" attribute. When I do testing with a test post...
6
by: nick4soup | last post by:
I have read the CGI FAQ 'How can I avoid users hitting "submit" twice' (on http://www.htmlhelp.org/faq/cgifaq.3.html#19 ) which essentially says you have to detect it at the server, using a...
1
by: SorboPos | last post by:
Hi. I have a form with continuous forms and a data entry section in the header of the form. (I.e. all transactions show in the main form area like a data sheet and the data for the highlighed...
0
by: Dan Corkum | last post by:
Good morning. I am working on an issue that is just baffling me. I have developed an .aspx page that receives an http form post that has a "file" attribute. When I do testing with a test post...
6
by: Saket Mundra | last post by:
I have a web application with two forms. After user enters data in first form he is directed to the second form. After Filling the second form as he clicks on save button, the data entered is...
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
3
by: feeman | last post by:
What I am looking at doing is I have a couple of forms, when I enter the number of products been despatched on the order form, it then creates a record in the transaction table and also the product...
15
by: Kevin Davis | last post by:
Hello, I'm a new person when it comes to PHP and I have a quick question. I would like to create a form that will allow the user to add more information using the same form in case they have...
3
by: steveninfl | last post by:
Hello , I am using MS Access 2000. I have a Table called Transactions, I have created a form for this table, one of the fields on the form is a combo box with the row source type as value list. In...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.