What should you do?

You create applications by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5.
You deploy a new Windows Forms application in a test environment. During the test process, an error message that includes an incomplete stack trace is reported.
You review the following code segment that has caused the error.

public int AddNewMission(DateTime date, string mission, string missionLink)
{
try
{
DALCode pgr = new DALCode(“cnWeb”);
int retcode = pgr.AddNewMission(date, mission, missionLink);
return retcode;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
pgr.Dispose();
}
}
You need to modify the code segment to display the entire stack trace.
What should you do?

You create applications by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5.
You deploy a new Windows Forms application in a test environment. During the test process, an error message that includes an incomplete stack trace is reported.
You review the following code segment that has caused the error.

public int AddNewMission(DateTime date, string mission, string missionLink)
{
try
{
DALCode pgr = new DALCode(“cnWeb”);
int retcode = pgr.AddNewMission(date, mission, missionLink);
return retcode;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
pgr.Dispose();
}
}
You need to modify the code segment to display the entire stack trace.
What should you do?

A.
Remove the CATCH block.

B.
Remove the FINALLY block.

C.
Add a Using block to the TRY block.

D.
Replace the THROW statement in the CATCH block with throw(ex).



Leave a Reply 0

Your email address will not be published. Required fields are marked *