Distributed Transaction Manager<p align=left><font face=Arial size=2>hi to all </font></p> <p align=left>i am developing web application with sqlserver 2005 </p> <p align=left>i am using subsonic for fatch insert update and delete  </p> <p align=left>for any transaction i am using <font size=2>System.Transactions </font></p> <p align=left><font size=2>this will perfect working only one action will perform </font></p> <p align=left><font size=2>but when we do mulipal action like 2 record update in different table then it will generate error </font></p> <p>(<font color="#ff0000"><strong>Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.</strong>)</font></p> <p align=left> </p> <p align=left> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">My Code in C# 2.0</span></div> <p align=left> </p><font size=2><font color="#0000ff" size=2> <p>int</font><font size=2> eeplanid = 0;</p> <p></font><font color="#0000ff" size=2>int</font><font size=2> cobradetail_id = 0;</p></font><font size=2> <p></font><font color="#0000ff" size=2>try</p></font><font size=2> <p>{</p> <blockquote dir=ltr style="margin-right:0px"> <p></font><font color="#0000ff" size=2>using</font><font size=2> (</font><font color="#008080" size=2>TransactionScope</font><font size=2> ts = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#008080" size=2>TransactionScope</font><font size=2>())</p> <p>{</p> <blockquote dir=ltr style="margin-right:0px"> <p></font><font color="#008080" size=2>Tbeeplan</font><font size=2> objtbeeplans = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#008080" size=2>Tbeeplan</font><font size=2>();</p> <p>objtbeeplans.EeID = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(hdneeid.Value != </font><font color="#800000" size=2>&quot;&quot;</font><font size=2> ? hdneeid.Value.ToString() : </font><font color="#800000" size=2>&quot;0&quot;</font><font size=2>);</p> <p>objtbeeplans.PlanID = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlplanid.SelectedValue.ToString());</p> <p>objtbeeplans.MarkNew();</p> <p>objtbeeplans.Save();</p> <p>eeplanid = objtbeeplans.EePlanID;</p> <p align=left> </p></font><font size=2> <p></font><font color="#008080" size=2>TbEEPlanCOBRADetail</font><font size=2> objcobradetail= </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#008080" size=2>TbEEPlanCOBRADetail</font><font size=2>();</p> <p>objcobradetail.EePlanID = eeplanid;</p> <p>objcobradetail.QbType = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlqb_type.SelectedValue.ToString());</p></font><font size=2> <p>objcobradetail.QeCardinality = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlqe_cardinality.SelectedValue.ToString());</p> <p>objcobradetail.QeType = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlqe_type.SelectedValue.ToString());</p> <p>objcobradetail.QeDate = </font><font color="#008080" size=2>Convert</font><font size=2>.ToDateTime(txtqe_date.Text.ToString());</p> <p>objcobradetail.LocDate = </font><font color="#008080" size=2>Convert</font><font size=2>.ToDateTime(txtloc_date.Text.ToString());</p> <p>objcobradetail.MarkNew();</p> <p>objcobradetail.Save();</p> <p>cobradetail_id = objcobradetail.COBRADetailId;</p> <p> </p></font><font size=2> <p>ts.Complete();</p></blockquote> <p>}</p></blockquote> <p>}</p> <p></font><font color="#0000ff" size=2>catch</font><font size=2> (</font><font color="#008080" size=2>Exception</font><font size=2> ex)</p> <p>{</p> <p></font><font size=2> </p> <p>}</p></font></font></div></div> <p align=left> </p> <p align=left> </p> <p></p> <p></p>© 2009 Microsoft Corporation. All rights reserved.Wed, 10 Dec 2008 23:37:58 Z5ae00326-4922-450e-a0d9-29cc27f39042http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5ae00326-4922-450e-a0d9-29cc27f39042#5ae00326-4922-450e-a0d9-29cc27f39042http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5ae00326-4922-450e-a0d9-29cc27f39042#5ae00326-4922-450e-a0d9-29cc27f39042Chirag vmhttp://social.msdn.microsoft.com/Profile/en-US/?user=Chirag%20vmDistributed Transaction Manager<p align=left><font face=Arial size=2>hi to all </font></p> <p align=left>i am developing web application with sqlserver 2005 </p> <p align=left>i am using subsonic for fatch insert update and delete  </p> <p align=left>for any transaction i am using <font size=2>System.Transactions </font></p> <p align=left><font size=2>this will perfect working only one action will perform </font></p> <p align=left><font size=2>but when we do mulipal action like 2 record update in different table then it will generate error </font></p> <p>(<font color="#ff0000"><strong>Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.</strong>)</font></p> <p align=left> </p> <p align=left> <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">My Code in C# 2.0</span></div> <p align=left> </p><font size=2><font color="#0000ff" size=2> <p>int</font><font size=2> eeplanid = 0;</p> <p></font><font color="#0000ff" size=2>int</font><font size=2> cobradetail_id = 0;</p></font><font size=2> <p></font><font color="#0000ff" size=2>try</p></font><font size=2> <p>{</p> <blockquote dir=ltr style="margin-right:0px"> <p></font><font color="#0000ff" size=2>using</font><font size=2> (</font><font color="#008080" size=2>TransactionScope</font><font size=2> ts = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#008080" size=2>TransactionScope</font><font size=2>())</p> <p>{</p> <blockquote dir=ltr style="margin-right:0px"> <p></font><font color="#008080" size=2>Tbeeplan</font><font size=2> objtbeeplans = </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#008080" size=2>Tbeeplan</font><font size=2>();</p> <p>objtbeeplans.EeID = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(hdneeid.Value != </font><font color="#800000" size=2>&quot;&quot;</font><font size=2> ? hdneeid.Value.ToString() : </font><font color="#800000" size=2>&quot;0&quot;</font><font size=2>);</p> <p>objtbeeplans.PlanID = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlplanid.SelectedValue.ToString());</p> <p>objtbeeplans.MarkNew();</p> <p>objtbeeplans.Save();</p> <p>eeplanid = objtbeeplans.EePlanID;</p> <p align=left> </p></font><font size=2> <p></font><font color="#008080" size=2>TbEEPlanCOBRADetail</font><font size=2> objcobradetail= </font><font color="#0000ff" size=2>new</font><font size=2> </font><font color="#008080" size=2>TbEEPlanCOBRADetail</font><font size=2>();</p> <p>objcobradetail.EePlanID = eeplanid;</p> <p>objcobradetail.QbType = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlqb_type.SelectedValue.ToString());</p></font><font size=2> <p>objcobradetail.QeCardinality = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlqe_cardinality.SelectedValue.ToString());</p> <p>objcobradetail.QeType = </font><font color="#008080" size=2>Convert</font><font size=2>.ToInt32(ddlqe_type.SelectedValue.ToString());</p> <p>objcobradetail.QeDate = </font><font color="#008080" size=2>Convert</font><font size=2>.ToDateTime(txtqe_date.Text.ToString());</p> <p>objcobradetail.LocDate = </font><font color="#008080" size=2>Convert</font><font size=2>.ToDateTime(txtloc_date.Text.ToString());</p> <p>objcobradetail.MarkNew();</p> <p>objcobradetail.Save();</p> <p>cobradetail_id = objcobradetail.COBRADetailId;</p> <p> </p></font><font size=2> <p>ts.Complete();</p></blockquote> <p>}</p></blockquote> <p>}</p> <p></font><font color="#0000ff" size=2>catch</font><font size=2> (</font><font color="#008080" size=2>Exception</font><font size=2> ex)</p> <p>{</p> <p></font><font size=2> </p> <p>}</p></font></font></div></div> <p align=left> </p> <p align=left> </p> <p></p> <p></p>Thu, 31 Jul 2008 13:13:27 Z2008-07-31T23:14:18Zhttp://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5ae00326-4922-450e-a0d9-29cc27f39042#7ecd7faa-ad06-43cb-93f6-787e69ccacf5http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5ae00326-4922-450e-a0d9-29cc27f39042#7ecd7faa-ad06-43cb-93f6-787e69ccacf5Nissim Natanov _MSFT_http://social.msdn.microsoft.com/Profile/en-US/?user=Nissim%20Natanov%20_MSFT_Distributed Transaction Manager<p align=left><font face=Arial size=2>The exception says that you need to enable network access for MSDTC. To enable it:</font></p> <p align=left> </p> <p align=left>open Control Panel\Administrative Tools\Component Services</p> <p align=left>select Component Services\Computer\My Computer, right-click and choose Properties. <br>On the MSDTC tab, press &quot;Security Configuration...&quot; and check if following options are  enabled:<br><br>Network DTC Access<br><br>Under Client and Administration<br>  Allow Remote Clients<br>  Allow Remote Administration <br><br>Under Transaction Manager Communication<br>  Allow Inbound<br>  Allow Outbound<br>  No Authentication Required <br>  Enale XA Transactions<br></p> <p align=left>After that, enable MSDTC application in Windows Firewall, if one is enabled.</p> <p align=left><br>And then reboot your computer and retry.</p> <p align=left> </p>Thu, 31 Jul 2008 15:59:37 Z2008-07-31T23:14:18Zhttp://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5ae00326-4922-450e-a0d9-29cc27f39042#226cb3dc-d2f3-47bf-a45d-82bcab7b1b6fhttp://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/5ae00326-4922-450e-a0d9-29cc27f39042#226cb3dc-d2f3-47bf-a45d-82bcab7b1b6fCaddrehttp://social.msdn.microsoft.com/Profile/en-US/?user=CaddreDistributed Transaction Manager<font face=Arial size=2> <p align=left><strong><em>(but when we do mulipal action like 2 record update in different table then it will generate error) </em></strong></p> <p align=left> </p> <p align=left> </p> <p align=left>This is the reason for your error SQL Server is escalating the System.Transaction operation into distributed transaction because you are doing multiple updates in a TransactionScope which makes your operation none atomic so you need a resource manager like MSDTC.  </p> <p align=left> </p> <p align=left>In SQL Server 2005 you don't need a resource manager if you change your code to one transaction at a time.  You have to decide if you should use Subsonic and use resource manager or drop it and change your code because MSDTC is expensive and not enabled in hosting sites.</p> <p align=left> </p> <p align=left> </p> <p align=left></font> </p>Mon, 04 Aug 2008 16:23:29 Z2008-08-04T16:23:29Z