How to handle error while project running on live

Answers were Sorted based on User's Feedback



How to handle error while project running on live ..

Answer / tiger skumar

Its very essential to track the error in the live server.
When end user use the project, some error may come on live
server. We can use the an email id to capture them in the
exception block and sends them email.

try
{
----
----
----
}
catch(Exception oEx)
{
MailMessage oMM = new MailMessage();
oMM.To ="skumaar_mca@yahoo.com";
oMM.Subject = oEx.ToString();
StringBuilder oSB = new StringBuilder();
oSB.Append("Browser:"+Request.Browser);
oSB.Append("Url:"+Request.Url);
oSB.Append("IP Address:"+Request.UserHostAddress);
oSB.Append("Error:"+oEx.Message());
oMM.Body = oSB.ToString();
SmtpClient.Send(oMM);

This is sample coding for how to capture in the liver server.

No need to the write the above piece of coding in the every
place.

Just create an project and put the code in that class.
We can use the error message to that class and we can send
the email from there.


}

Is This Answer Correct ?    4 Yes 0 No

How to handle error while project running on live ..

Answer / sandeep

Only using application error log file and to show internal
server error

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

Can you please anyone explain in detailed Webservices concepts in Asp.net?

1 Answers  


Write a code for "RequiredFieldValidator" in java script

5 Answers   Wipro,


What is the difference between Session and response.Redirect?

0 Answers   Microsoft,


Hi! Could any 1 please suggest me a free practice online exam for asp.net exams.. thanks

1 Answers  


which scripting is used browser by server when we use validation controls. 1.javascript 2.vbscript 3.jscript 4.perl

8 Answers   Satyam,






Explain the differences between Server-side and Client-side code?

12 Answers   Cognizant, CTS, Siebel Systems, Visual Soft,


What combination of methods are used to improve the speed of the fill() method of the DataAdapter? a) BeginFillData() and EndFillData() b) StartFillData() and EndFillData() c) BeginLoadData() and EndLoadData() d) StartLoadData() and EndLoadData()

2 Answers   Syntax Softtech, winfoware,


What are the advantages and disadvantages of viewstate ?

1 Answers  


Why is global asax is used?

0 Answers  


Why Global.asax is used?

7 Answers   Perot Systems,


How is session id generated?

0 Answers  


What is an assembly? Explain its parts.

0 Answers  


Categories