Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I am using the SqlCommand to execute my query in C#.net and also I am assigning Command Transaction to it. Once after executing my query I am calling SqlCommand.Dispose(), will it effect my transaction? Because I am using the same transaction for further execution.

Below is my code:

SqlCommand cmd=new SqlCommand(query,connection);
cmd.CommandTimeOut=0;
cmd.Transaction="Some tranaction";
cmd.ExecuteNonQuery();
cmd.Dispose();


After this code execution I am using the same transaction for further execution of queries.

Please Help
Thank You
Posted
Updated 28-Oct-10 21:58pm
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900