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 = 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());
}
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!