Hi everybody, I'm working on an Excel application with VSTO but I'm rather used to work with ASP.NET. So I would like to know if in Winforms there is an equivalent to the "application_error" function from the global.asax file (in web application) or if I have to realize one by myself ? Of course the aim is to have an error manager that would catch all thrown exceptions. Thanks
FlorentBzh
Posts
-
VSTO error handling -
Performance Counters for the .NET Framework Data Provider for SQL ServerHello, In the administration console, I would like to use some specific performance counters : those link with the .NET Framework Data Provider for SQL Server But when I select it in the drop down list, I can select counters but the add button is disabled. Is anybody can explain me. Thanks
-
try historyThanks for your answer, I'm OK that the way I try to use is not really "beautiful", but what I want to know is why, when an exception occures, this Exception is not treated by the catch block ? I just want to throw it to the call function and treat this exception in the call function.
-
try historyHello everybody, I try to use this "try catch" block :
Function DateConvert(ByVal strDate As String) As String Dim jj, mm, aa As String Dim buf() As String Try buf = Split(strDate, "/") jj = buf(0) mm = buf(1) aa = buf(2) Catch ex As Exception Throw ex End Try If (System.Web.Configuration.WebConfigurationManager.AppSettings("OS") = "US") Then DateConvert = mm & "/" & jj & "/" & aa Else DateConvert = jj & "/" & mm & "/" & aa End If End Function
When I pass a string with a bad date format like "02/2006" or "" instead of "23/10/2006" I get this error : "Index was outside the bounds of the array." The "try catch" block must catch this type of error but not there... why ? Please, my code doesn't look bad but I don't find where I'm wrong... PS1 : I also try with an IndexOutOfRangeException exception with the same result !! PS2 : I use the Framework 2.0... -
My Validator Controls don't work everywhere !Ok thanks, your idea give me an idea !!! It was the famous command :
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -c
that I've to lauch: It replaces scripts in good directories -
My Validator Controls don't work everywhere !Hi, I develop an application which contains Validator controls. With my "test" server all works perfectly but when I put this application on my "production" server, in some pages, some of validator controls don't work anymore. Is there anything to change on my page or on my server ? Why Validator works in some pages and not in another on the same server? Please help me...
-
How to retrieve Http Error Code in Application_Error in file Global.asax.csOk, thanks I simply do :
System.Web.HttpException httpErreur =(HttpException)Server.GetLastError(); if(!(httpErreur.GetHttpCode()==404)) { } else { }
and it works -
How to retrieve Http Error Code in Application_Error in file Global.asax.csHello, I would like to receive an e-mail when an Error Occurs on my WebSite but not for errors like "401 402 404...". So before to send it I test errors. This is my code:
public class Global : System.Web.HttpApplication { protected void Application_Error(Object sender, EventArgs e) { System.Web.HttpException MyHttpError; MyHttpError = System.Web.HttpException.CreateFromLastError(Server.GetLastError().Message) ; if(!(MyHttpError.GetHttpCode()==404)) { //Send an email and redirect } else // just redirect } }
The problem is that in my Spy Window the value of Server.GetLastError()._httpCode is 404 but the value of httpErreur.GetHttpCode() is 500 !! Please explain me or give me another solution. -- modified at 10:02 Friday 20th January, 2006