Solved

Error handling, Server.GetLastError()

Posted on 2003-11-10
1
866 Views
Last Modified: 2012-05-04
Hi

I am trying to get more detailed error information using Server.GetLastError(), I see on the web that one can retreive this stuff:

.ASPCode
.Number
.Source
.File
.Line

However this does not work for me, I can only get this stuff and want the above goodies.

.Message
.StackTrace
.Source

please help, do I have a wrong version of .net framework or something?
0
Comment
Question by:iqula
[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
1 Comment
 
LVL 23

Accepted Solution

by:
naveenkohli earned 125 total points
ID: 9715616
You already have this information. StackTrace will help you to get to the file name and line number. Take a look at this code snippet from documentation.

Public Shared Sub Main()

        Try
            Dim sts As New StackTraceSample()
            sts.MyPublicSub()
        Catch
            ' Create a StackTrace that does not capture filename, line number or column information.
            Dim strace As New StackTrace()
            Dim count As Integer

            ' High up the call stack, there is only one stack frame
            While count < strace.FrameCount
                Dim frame As New StackFrame()
                frame = strace.GetFrame(count)
                Console.WriteLine("High Up the Call Stack, Method: {0}", frame.GetMethod())
                Console.WriteLine("High Up the Call Stack, Line Number: {0}", frame.GetFileLineNumber())
                count = count + 1
            End While

        End Try

    End Sub
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

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.   …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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