Solved

Error handling, Server.GetLastError()

Posted on 2003-11-10
1
865 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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