Timeout problem with SqlTransaction
I want to implement transaction within three database insert methods.
void Method1(parameters,connection,transaction)
{
cmd.Connection = connection;
cmd.Transaction = transaction;
...
}
void Method2(parameters,connection,transaction)
{
cmd.Connection = connection;
cmd.Transaction = transaction;
...
}
void Method3(parameters,connection,transaction)
{
cmd.Connection = connection;
cmd.Transaction = transaction;
...
}
Inside Main method I create the connection object and SqlTransaction object.
con.Open();
transaction = con.BeginTransaction();
Method1(con,transaction);//along with other parameters
Method2(con,transaction);
Method2(con,transaction);
After calling these methods I got these....
"Timeout
expired. The timeout period elapsed prior to completion
of the operation or the server is not responding."
Removing the transaction works OK but I want operations to be transacted..
Any ideas?
"Dont you ever give up!"
__________________
\"Dont you ever give up!\"
|