The Exception in this Out is due to SQL Connection....
- First create a class called ExceptionHelper.cs
- Write a public static method as shown below..........
C# Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace BAL
{
public static class ExceptionHelper
{
public static int LineNumber(this Exception e)
{
int linenum = 0;
try
{
linenum = Convert.ToInt32(e.StackTrace.Substring(e.StackTrace.LastIndexOf(":line") + 5));
HttpContext.Current.Session["ErrorLineNo"] = linenum.ToString();
}
catch
{
//Stack trace is not available!
}
return linenum;
}
}
}
No comments:
Post a Comment