473,401 Members | 2,127 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,401 software developers and data experts.

how to trap this error with global.asax?

Hi,

When an user tries to update a record in a gridview with a duplicate value,
there comes an error like:
"The changes you requested to the table were not successful because they
would create duplicate values in the index etc ..."

I tried to solve that with the errorPage like this:
<%@ Page Language="VB" CodeFile="mult.aspx.vb" Inherits="mult"
errorPage="err2.html" %>
and to set in web.config this:
<customErrors mode="On">
</customErrors>

This works, but is this the best way? I would like to do that for all pages
with global.asax.

I did this:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception
ex = Server.GetLastError()
Throw ex
End Sub

But of course, there must be more code. But here I'm stuck ...

Any help would be appreciated
Thanks
Averell
May 29 '06 #1
0 931

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

Similar topics

3
by: Pa Ji | last post by:
I just created a simple web application and tried to run it. Getting following...any idea what I'm missing Thanks in advance...
5
by: CES | last post by:
All, I've just started to use VBStudio, up tell now I've coded with note pad, so this is all new to me. I'm trying to create my first project but I'm running into problems. I've created a base...
0
by: Jack Wright | last post by:
Dear All, I have a web Application "http://localhost/Web/WebForm1.aspx" that calls a WebService from "http://localhost/webserviceapp/service1.asmx"...I have set the executionTimeout to 10 secs in...
14
by: Roland Hall | last post by:
Since I'm not getting any response from the community, I'm reposting this under my managed account. I've turned my web.config friendly error messages off and it may be easier to view what I'm...
1
by: Neil | last post by:
Hello - In every project I try to compile and run, I'm getting a parser error on global.asax (pasted below). I have rebuilt and recompiled, and this happens on every project on my machine, no...
5
by: Andrew | last post by:
Hello, friends, In our development machine, the .net web app worked fine. Then we deployed it to our server. However, it did not work on the server. After a user entered user name/pswd and...
5
by: Doug | last post by:
Found this thread, but code is C# (would rather have VB.NET). http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q306355 Can anyone point me to a simple solution? We don't want the error...
4
by: Al Santino | last post by:
Hello, I've created a simple C# web services project using Visual Studio 2005. My service compiles and runs correctly when called by remote clients. I'm able to step through the service in the...
1
by: =?Utf-8?B?QWNl?= | last post by:
hello, i just converted old .net project (it was a solution with web project and class project) built in .net 1.0 and 1.1 framework to .net 2.0. as i expected, when i clicked on the solution file...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.