473,721 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1501
Have a look here

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

"Lit" <sq**********@h otmail.comwrote in message
news:O0******** ******@TK2MSFTN GP04.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**********@h otmail.comwrote in message
news:O0******** ******@TK2MSFTN GP04.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**********@h otmail.comwrote in message
news:O0******** ******@TK2MSFTN GP04.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**********@h otmail.comwrote in message
news:O0******** ******@TK2MSFTN GP04.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**********@h otmail.comwrote in message
news:O0******** ******@TK2MSFTN GP04.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.Transacti on = oTran;
oCmd1.ExecuteNo nQuery();

oCmd2.Transacti on = oTran;
oCmd2.ExecuteNo nQuery();
...

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**@xxnoemail xx.comwrote in message
news:l7******** *************@b t.com...
Have a look here

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

"Lit" <sq**********@h otmail.comwrote in message
news:O0******** ******@TK2MSFTN GP04.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**********@h otmail.comwrote in message
news:eo******** ******@TK2MSFTN GP04.phx.gbl...
Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transacti on = oTran;
oCmd1.ExecuteNo nQuery();

oCmd2.Transacti on = oTran;
oCmd2.ExecuteNo nQuery();
...

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**@xxnoemail xx.comwrote in message
news:l7******** *************@b t.com...
>Have a look here

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

"Lit" <sq**********@h otmail.comwrote in message
news:O0******* *******@TK2MSFT NGP04.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**@xxnoemail xx.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**********@h otmail.comwrote in message
news:eo******** ******@TK2MSFTN GP04.phx.gbl...
>Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transacti on = oTran;
oCmd1.ExecuteNo nQuery();

oCmd2.Transacti on = oTran;
oCmd2.ExecuteNo nQuery();
...

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**@xxnoemail xx.comwrote in message
news:l7******* **************@ bt.com...
>>Have a look here

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

"Lit" <sq**********@h otmail.comwrote in message
news:O0****** ********@TK2MSF TNGP04.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**********@h otmail.comwrote in message
news:uF******** ******@TK2MSFTN GP02.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**@xxnoemail xx.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**********@h otmail.comwrote in message
news:eo******* *******@TK2MSFT NGP04.phx.gbl.. .
>>Aidy,
I have one question, but first thanks for the great link.

in Figure 8, I see the following code
...
oCmd1.Transacti on = oTran;
oCmd1.ExecuteNo nQuery();

oCmd2.Transacti on = oTran;
oCmd2.ExecuteNo nQuery();
...

Question is: Can I reuse the same command object? by setting the
command.Tex t 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**@xxnoemail xx.comwrote in message
news:l7****** *************** @bt.com...
Have a look here

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

"Lit" <sq**********@h otmail.comwrote in message
news:O0***** *********@TK2MS FTNGP04.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

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

Similar topics

1
1508
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 page, everything functions properly. When the actual customer does the post, the attribute following the "file" attribute is concatenated to the file itself. When I execute the HttpPostedFile.SaveAs(), the resulting file is what is sent Plus the...
6
6395
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 hidden form field. That's fair enough. My server is therefore processing a response on the first request, so what kind of HTML response should I send out on the second, duplicate,
1
3067
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 tran is entered or edited in the header.) Record source for the form is a query that is sorted by tran date. Records are sorted by date of transaction ascending.
0
1114
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 page, everything functions properly. When the actual customer does the post, the attribute following the "file" attribute is concatenated to the file itself. When I execute the HttpPostedFile.SaveAs(), the resulting file is what is sent Plus the...
6
2072
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 stored in the database using a Transaction Object, That inserts data, entered by user in both the forms, in the database. My problem is where shall i store the data entered by the user in the first form when he is redirected to next form and till i...
0
2182
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 edited and then saved. Currently, after saving the edited transaction and returning to the check register, the repeater control table returns to the bottom. I would like the edited transaction to appear in the table instead. I know that a...
0
1888
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 edited and then saved. Currently, after saving the edited transaction and returning to the check register, the repeater control table returns to the bottom. I would like the edited transaction to appear in the table instead. I know that a JavaScript...
3
1880
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 history. I have created a couple of update queries which worked well, but did not perform the way that I wanted them to. I wanted to do it using code so that when the despatch order button is pressed it creates the above. The information...
15
2169
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 (similar to various employment sites). What would be the best way of using form arrays for that function?
3
24562
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 this combo box field that I call "Transaction type" the user must select a value from the drop down list. What I want to do is based on the selection of the "Transaction type" field, if the user should select a transaction type of ADHOC or...
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6669
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.