Detail from -- Catch ex As Exception
My code is such
Code:
Public Sub OpenConnection()
If (Me.con.State = ConnectionState.Closed) Then
Try
Me.con.Open()
Catch ex As Exception
Dim e = TryCast(ex, IContainsErrorRecord)
Dim message As String
If e IsNot Nothing Then
message = e.ErrorRecord.InvocationInfo.PositionMessage
Else
message = ex.Message
End If
Console.WriteLine(message)
MsgBox(ex.Message)
FailureOut = ex.Message
YesNo = True
End Try
End If
End Sub
I am wanting to get the MESSAGEDETAIL property but can't.
I'm using the Imports System.Management.Automation
Help please
Bill
Re: Detail from -- Catch ex As Exception
If you want more information you can use "ex.ToString"
Re: Detail from -- Catch ex As Exception
Tried that but still could not see the data from the Messagedetail property. Thanks though. .it's closer.
Re: Detail from -- Catch ex As Exception
Have you checked the InnerException "ex.InnerException"?
Re: Detail from -- Catch ex As Exception
Quote:
Originally Posted by
KGComputers
Have you checked the InnerException "ex.InnerException"?
Yupper.. just tried that.... That itself errored and returned Nothing...