T
tshad
If you get an exception or SqlException, how do you get the actual message?
Not the detailed breakdown, but the actual message.
For example, in the following message, I would like to find just "Incorrect
syntax near the keyword 'and'." or "System.Data.SqlClient.SqlException:
Incorrect syntax near the keyword 'and'."
instead of:
errMessage = System.Web.HttpUnhandledException: Exception of type
System.Web.HttpUnhandledException was thrown. --->
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'and'.
at ASP.viewPositions_aspx.BindData(String SortFieldName) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
566
at ASP.viewPositions_aspx.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
189
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)errMessage = System.Web.HttpUnhandledException:
Exception of type System.Web.HttpUnhandledException was thrown. --->
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'and'.
at ASP.viewPositions_aspx.BindData(String SortFieldName) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
566
at ASP.viewPositions_aspx.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
189
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Thanks,
Tom
Not the detailed breakdown, but the actual message.
For example, in the following message, I would like to find just "Incorrect
syntax near the keyword 'and'." or "System.Data.SqlClient.SqlException:
Incorrect syntax near the keyword 'and'."
instead of:
errMessage = System.Web.HttpUnhandledException: Exception of type
System.Web.HttpUnhandledException was thrown. --->
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'and'.
at ASP.viewPositions_aspx.BindData(String SortFieldName) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
566
at ASP.viewPositions_aspx.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
189
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)errMessage = System.Web.HttpUnhandledException:
Exception of type System.Web.HttpUnhandledException was thrown. --->
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'and'.
at ASP.viewPositions_aspx.BindData(String SortFieldName) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
566
at ASP.viewPositions_aspx.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\staffingworkshop\applicant\secure\viewPositions.aspx:line
189
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Thanks,
Tom