?? utility.vb
字號(hào):
Imports System.Data.SqlServerCe
Imports System.Data.SqlServerCe.SqlCeException
Imports System.text
Public Class Utility
Public Function ComposeSqlErrorMessage(ByVal e As SqlCeException) As String
Dim errorCollection As SqlCeErrorCollection = e.Errors
Dim bld As New StringBuilder
Dim inner As Exception = e.InnerException
' Compose SQL Server CE error information into a single string
If Not (inner Is Nothing) Then
bld.Append(("Inner Exception: " & inner.ToString()))
End If
Dim err As SqlCeError
For Each err In errorCollection
bld.Append(ControlChars.Cr & "Error:" & err.HResult.ToString("X"))
bld.Append(ControlChars.Cr & err.Message)
bld.Append(ControlChars.Cr & "Native Error:" & err.NativeError)
bld.Append(ControlChars.Cr & err.Source)
Dim numPar As Integer
For Each numPar In err.NumericErrorParameters
If numPar <> 0 Then
bld.Append(ControlChars.Cr & "N-Parm:" & numPar.ToString())
End If
Next numPar
Dim errPar As String
For Each errPar In err.ErrorParameters
If errPar <> [String].Empty Then
bld.Append(ControlChars.Cr & "E-Parm:" & errPar)
End If
Next errPar
Next err
Return bld.ToString()
End Function
End Class
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -