customErrors in Web.config doesn't work
Posted on 2004-08-26
customErrors in web.config is not triggering error page
Whats wrong ?
in Adjutsmest.aspx, the db connectiuon is wrong and I expect it to redirect to ErrPage.htm. But instead getting standard error and i.e.
System.Data.OleDb.OleDbException: 'c:\principia\GiCS.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Here are the file listings
<customErrors mode="On" defaultRedirect="ErrPage.htm"/>
We are very sorry for the inconvenience caused to you...<br>
string local_connect_string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\principia\\GiCS.mdb" ;
//string strSQL="SELECT a.[Gic ID],a.Entry_Date, a.Principal, a.Interest, a.Type FROM Adjustments a where a.Entry_Date = (Select max(Entry_Date) from adjustments where [Gic ID]=a.[Gic ID]) ORDER BY a.[Gic ID]";
string strSQL = "SELECT a.[Gic ID], Max(a.Entry_Date) AS Entry_Date, Sum(a.Principal) AS Principal,Sum(a.Interest) as Interest ,a.Type FROM Adjustments AS a GROUP BY a.[Gic ID] , a.Type ORDER BY a.[Gic ID];";
OleDbConnection myConnectionString = new OleDbConnection(local_connect_string);
OleDbCommand adjCommand = new OleDbCommand(strSQL,myConnectionString);