When using LINQ to insert multiple tables, transactionscope is used.
Using (transactionscope scope = new transactionscope ())
{
Bll. r_paper_qbankbll.deletebypaperid (PID );
Bll. m_test_papebll.delete (PID );
Scope. Complete ();
}
Jshelper. Alert ("deleted successfully", this );
The system prompts "MSDTC unavailable" during use. What is the problem?
MSDTC (Distributed Transaction Coordinator) coordinates transactions across multiple databases, message queues, file systems, and other resource managers. The service is named msdtc.exe. The process calls Microsoft Personal Web server and Microsoft SQL Server. This service is used to manage multiple servers.
Location: control panel -- Administrative Tools -- service -- Distributed Transaction Coordinator
Dependency: Remote Procedure Call (RPC) and security accounts manager
Suggestion: Generally, it is not involved in the home computer, unless you enable the Message Queuing service, you can stop.
Solution:
Method 1: Choose Windows Control Panel> Administrative Tools> services> Distributed Transaction Coordinator> Properties> Start
Method 2: Run "Net start MSDTC" under cmd to enable the Service.
NOTE: If Step 1 Distributed Transaction Coordinator cannot be started, it is because the log file is lost, re-create the log file, and then start it. To recreate the MSDTC log and restart the service, follow these steps:
(1) Click Start, click Run, Enter cmd, and then press OK ".
(2) Input MSDTC-resetlog (note that when running this command, do not execute the pending transaction)
(3) Enter Net start MSDTC and press Enter!
Reference: http://blog.csdn.net/bobwu/archive/2009/07/30/4392616.aspx