I found that the blank GUID was actually only showing that way if you did a
Return All Rows from Enterprise manager. A "Select * ..." actually works
fine.
I still don't know why I am not getting any chains. I always get only one.
I am doing:
While Not ex Is Nothing
'Create a new Exception Log object for the exception
exLog = New ExceptionLog()
ex = ex.InnerException
End While
But it always only does one exception - no chain.
Is this something only available in 2.0?
Thanks,
Tom
"tshad" <> wrote in message
news:...
>I am trying to set up an exception logging and have some code from a book I
>am using.
>
> It all seems to work except for the ID I am setting up for handling
> Exception Chains (I am only getting one entry per error - so I don't know
> if the Chain is even working).
>
> I have a field in my database as:
>
> ChainID uniqueidentifier.
>
> What I am putting here is a GUID.
>
> But all the entries show the field as blank (empty)
>
> I am doing a Guid.NewGuid):
>
> Dim chainID As Guid = Guid.NewGuid()
>
> So I assume I am getting an ID and putting it in the Object, which is
> putting it in the file:
>
> exLog.ChainID = chainID
>
> Why is this?
>
> ************************************************** **************************
> Public Shared Sub Log(ByVal ex As Exception)
>
> Dim exLog As New ExceptionLog
> Dim parentID As Integer = 0
> Dim chainID As Guid = Guid.NewGuid()
> Dim dbConn As SqlConnection = New
> SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings("MM_CONNECTION_STRING_ftsolutio ns"))
>
> dbConn.Open()
>
> 'Iterate through all of the exceptions in the exception chain
> While Not ex Is Nothing
>
> 'Create a new Exception Log object for the exception
> exLog = New ExceptionLog()
>
> 'Acquire the user name
> If Current.User.Identity.IsAuthenticated Then
> exLog.UserID = Current.User.Identity.Name
> Else
> exLog.UserID = "<Anonymous User>"
> End If
>
> exLog.ParentID = parentID
> exLog.MachineName = Current.Server.MachineName
> exLog.UserAgent = Current.Request.UserAgent
> exLog.ExceptionDate = Now
> exLog.ExceptionType = ex.GetType.ToString
> exLog.ExceptionMessage = ex.Message
> ' exLog.Page =
> Current.Request.AppRelativeCurrentExecutionFilePat h()
> exLog.StackTrace = ex.StackTrace
> exLog.QueryStringData = GetQuerystringData()
> exLog.FormData = GetFormData()
> exLog.ChainID = chainID
>
> 'Save Exception Log, Get New ParentID, Get Next Inner Exception
> If exLog.Save(dbConn) Then
> parentID = exLog.ExceptionID
> ex = ex.InnerException
> Else
> ex = Nothing
> End If
>
> End While
>
> dbConn.Close()
>
> End Sub
> ************************************************** **************************
>
> Thanks,
>
> Tom
>
>
|