473,756 Members | 2,703 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
10 1508
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**@xxnoemail xx.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**********@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****** ********@TK2MSF TNGP04.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.Te xt 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**** **********@TK2M SFTNGP04.phx.gb l...
>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
1510
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
6398
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
3070
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
1115
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
2075
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
2183
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
1891
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
1882
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
2170
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
24569
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
9431
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10014
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
9819
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,...
0
9689
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5119
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
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3780
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
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2647
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.