Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I want to use two func within between begin transaction and commit transaction as shown below
C#
try
{
Begin transaction()
Delete();
Insert();
Commit()
}
Catch() ..

Problem is when breakpoint reaches delete function and try execute some delete query on SQL enterprise 2008 then it hangs there or get locked. I am unable figure out the reason.can anyone help.
Posted
Updated 29-Jun-15 9:11am
v2
Comments
Suvendu Shekhar Giri 29-Jun-15 15:15pm    
"Begin Transaction()" method name with white space? Can you share what is written in these 4 methods- BeginTransaction(),Delete(),Insert() & Commit() ?
[no name] 29-Jun-15 15:57pm    
No, probably not. We would have no idea at all what your functions do. Learn how to run your code in the debugger and find out what is going on in your code.
sunshine@work. 29-Jun-15 16:02pm    
I know how to debug. I just want to know the reason for locking of the table while deleting rows. Thanks anyways.
[no name] 29-Jun-15 16:15pm    
Apparently you do not. How would you expect us to tell you anything without seeing your code?
sunshine@work. 29-Jun-15 23:54pm    
Apparently code project does not seem to be useful , I guess for my problem

1 solution

Sir basically problem comes after BeginTransaction(). When the breakpoint goes into Delete function.
In this delete function ,we are deleting few rows from table .
This delete function returns int. Value.

For ex

Int val = delete();
If ( val == -1)

My problem is when delete is called , after the breakpoint does not come on if condition.
 
Share this answer
 
v2

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