Solved

customErrors in  Web.config doesn't work

Posted on 2004-08-26
2
768 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

726 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