Click here to Skip to main content
15,063,287 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have te following code
C#
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
            {
 
            }
        }


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 transaction.complete but did not rollback!

thanks for your help
Posted
Comments
[no name] 28-Aug-12 20:54pm
   
Is the MSDTC installed on your server? Is the service running?

1 solution

It is MSDTC configuration issue. You might be installed/run/configured properly both sqlserver pc and application running pc. Please visit the link
   

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