When your program gets an error, is there a name of that Exception somewhere
on that error page so that you can trap it with the correct exception name?
For instance, I errored when attempting to bind a grid, because a field
didn't exist in the query that was on the grid. How do I find the name of
the exception and trap the error? The error I received said:
A field or property with the name 'ID' was not found on the selected
datasource.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A field or property with the
name 'ID' was not found on the selected datasource.
Source Error:
Line 314: HTTPContext.Current.Session("DS") = ds
Line 315: dgrid.DataSource = ds
Line 316: dgrid.DataBind()
Line 317:
Line 318: End Sub
Source File: C:\Inetpub\wwwroot\WebApplication1\default.aspx Line: 316
Stack Trace:
[HttpException (0x80004005): A field or property with the name 'ID' was not
found on the selected datasource.]
System.Web.UI.WebControls.BoundColumn.OnDataBindCo lumn(Object sender,
EventArgs e) +346
System.Web.UI.Control.OnDataBinding(EventArgs e) +66
System.Web.UI.Control.DataBind() +26
System.Web.UI.Control.DataBind() +86
System.Web.UI.WebControls.DataGrid.CreateItem(Int3 2 itemIndex, Int32
dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem,
DataGridColumn[] columns, TableRowCollection rows, PagedDataSource
pagedDataSource) +169
System.Web.UI.WebControls.DataGrid.CreateControlHi erarchy(Boolean
useDataSource) +1408
System.Web.UI.WebControls.BaseDataList.OnDataBindi ng(EventArgs e) +48
System.Web.UI.WebControls.BaseDataList.DataBind() +23