473,378 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Simple, solution-wide error trap in VB.NET?

Found this thread, but code is C# (would rather have VB.NET).

http://support.microsoft.com/default...;EN-US;Q306355

Can anyone point me to a simple solution? We don't want the error
codes appearing to the end-user, but obviously we want to be able to
log and e-mail them, etc.

According to what I've been reading, the way to accomplish this is to
change the "CustomErrors" mode and the 'defaultRedirect' in web.config,
rather than enclose every piece of code with "Try...Catch". Is this
correct?

Jun 13 '06 #1
5 1476
I should add that we are using Visual Studio 2005 and SQL Server 2000.

Also, the C# example I cited earlier was designed for .Net 2002/2003.

Jun 13 '06 #2
There are a couple of other ways:

1. Define a BasePage class for all your pages to inherit from. In it,
handler the Error event and process appropriately.
2. Handle the Application_Error in global.asax, and process appropriately

"Doug" <sp*******@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Found this thread, but code is C# (would rather have VB.NET).

http://support.microsoft.com/default...;EN-US;Q306355

Can anyone point me to a simple solution? We don't want the error
codes appearing to the end-user, but obviously we want to be able to
log and e-mail them, etc.

According to what I've been reading, the way to accomplish this is to
change the "CustomErrors" mode and the 'defaultRedirect' in web.config,
rather than enclose every piece of code with "Try...Catch". Is this
correct?

Jun 13 '06 #3
Marina Levit [MVP] wrote:
There are a couple of other ways:

1. Define a BasePage class for all your pages to inherit from. In it,
handler the Error event and process appropriately.
2. Handle the Application_Error in global.asax, and process appropriately


Thank you. Is there still a global.asax in VS2005?

Also, I found the VB.NET equivalent of the C# example I cited above:

http://support.microsoft.com/default...;EN-US;Q308132

but it, too, references global.asax, which I don't see anymore in
VS2005.

Jun 13 '06 #4
It still there. It's not added for you if you choosed to create an empty web
site. Just add an item , it should in the list...

--
Patrice

"Doug" <sp*******@gmail.com> a écrit dans le message de news:
11**********************@c74g2000cwc.googlegroups. com...
Marina Levit [MVP] wrote:
There are a couple of other ways:

1. Define a BasePage class for all your pages to inherit from. In it,
handler the Error event and process appropriately.
2. Handle the Application_Error in global.asax, and process appropriately


Thank you. Is there still a global.asax in VS2005?

Also, I found the VB.NET equivalent of the C# example I cited above:

http://support.microsoft.com/default...;EN-US;Q308132

but it, too, references global.asax, which I don't see anymore in
VS2005.

Jun 13 '06 #5
Marina Levit [MVP] wrote:
There are a couple of other ways:

1. Define a BasePage class for all your pages to inherit from. In it,
handler the Error event and process appropriately.
Can you take a look at this thread and help me figure out what to do
next to implement this?

http://groups.google.com/group/micro...4bfe5b8015aaa8

Thanks.

Jul 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Eric S. Johansson | last post by:
I have an application where I need a very simple database, effectively a very large dictionary. The very large dictionary must be accessed from multiple processes simultaneously. I need to be...
3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
5
by: lis0122 | last post by:
I'm a database marketing manager for a small non-profit. I created a query that prompts you for a company name and then pulls a list of all of our contacts in the database in that company. Our...
2
by: Deano | last post by:
Problem is that there are lots and lots of fields in an employee record. I specify a form control as the criterion for one of those fields which is the value of the primary key for that record. ...
0
by: Frank Niessink | last post by:
Dear list members, I'm using ConfigParser to read and write simple configuration files. One of the items written is the file the user is currently working on, so that the application can load...
6
by: sathyashrayan | last post by:
Dear group, Following is a exercise from a book called "Oreilly's practical C programming". I just wanted to do a couple of C programming exercise. I do have K and R book, but let me try some...
5
by: Byron | last post by:
I need to create an application that uses primarily a single form rather than an SDI that creates a new form for everythting. However, I don't want an MDI style application since the users I'm...
4
by: =?Utf-8?B?SmFu?= | last post by:
In my application the user can configure automation-scripts by inserting different "actions" into a "procedure". These different procedure- and action-objects are all translated into C# code before...
2
by: Olie | last post by:
I find the comments by Microsoft about the GAC slightly amusing stating the the GAC was created to simplify sharing of assemblies. I have found it less than simple. I have a solution with three...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.