Solved

customErrors in  Web.config doesn't work

Posted on 2004-08-26
2
766 Views
Last Modified: 2008-02-01
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


Web.config
<customErrors mode="On" defaultRedirect="ErrPage.htm"/>

ErrPage.html

<b>
   We are very sorry for the inconvenience caused to you...<br>
</b>


Adjustments.aspx

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);

                  OleDbDataReader dxReport;
                  try
                  {
                        adjCommand.Connection.Open();
                        
                        dxReport=adjCommand.ExecuteReader();
                        DataGrid2.DataSource=dxReport;
                        DataGrid2.DataBind();
                        dxReport.Close();
                        adjCommand.Connection.Close();
                        myConnectionString.Close();
                  }
                  catch(Exception err)
                  {
                        Response.Write(err);
                  }
                  finally
                  {
                        adjCommand.Connection.Close();
                        myConnectionString.Close();
                  }


0
Comment
Question by:jitganguly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Rodney Helsens earned 500 total points
ID: 11906790
You have a try catch block there. I suspect that is catching the error and therefore the exception is handled..

comment out that block and see what happens
0
 
LVL 20

Author Comment

by:jitganguly
ID: 11906820
Excellent

thanks a lot
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSIS GUID Variable 2 57
Create a Dropdown list with sub group 10 43
Starting to use Git with Visual  Studio Online 1 68
Learning About The VB.NET TableLayoutPanel Control 5 40
IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question