My code is such
I am wanting to get the MESSAGEDETAIL property but can't.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'm using the Imports System.Management.Automation
Help please
Bill




Reply With Quote