本文介绍了服务器上的MSDTC无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码
I have te following code
private void Cmd_PrintFichRensRPT_Click(object sender, EventArgs e) { bool MAJ = false; if (DTGVFicheRensRPT.RowCount != 0) { using (TransactionScope transaction = new TransactionScope()) { try { for (int l = 0; l <= DTGVFicheRensRPT.RowCount - 1; l++) { string DosID = DTGVFicheRensRPT.Rows[l].Cells[8].Value.ToString(); //MAJ MAJ = ExecuteRequete.ExecuteStoredProcedure("MAJStatutDossier", new SqlParameter("@StaId", 11), new SqlParameter("@DosID", DosID), new SqlParameter("@staBL", null), new SqlParameter("@staCRprod", null)); } } catch (Exception Message) { MessageBox.Show(Message.ToString()); } // Valider la transaction transaction.Complete(); } if (MAJ ) { CRV_FichRensRPT.PrintReport(); UtilsProcFunc.Edition(this, 1); } else { UtilsProcFunc.Edition(this, 1); } } else { } }执行时我在第一次执行''for statement'后出现以下错误''服务器上的无效MSDTC MarcelleNGOUNOU\SQLEXPRESS不可用于参数MachineName 及其转移到transactionplete但没有回滚! 感谢您的帮助
at the execution i have the following error after the first execution of the ''for statement'' "Invalid MSDTC on server MarcelleNGOUNOU\SQLEXPRESS is unavailable for prameter MachineName" and its move to transactionplete but did not rollback! thanks for your help
推荐答案这是MSDTC配置问题。您可能正确安装/运行/配置sqlserver pc和运行pc的应用程序。请访问链接 It is MSDTC configuration issue. You might be installed/run/configured properly both sqlserver pc and application running pc. Please visit the link
更多推荐
服务器上的MSDTC无效
发布评论