您可以使用此代码输出 Table 的各种属性(对不起,它在 VB 中,这是我必须用于该项目的):
Private Sub logLogOnInfo(table As Table) log.DebugFormat("LogOnInfo.ConnectionInfo for {0}:", table.Name) Dim ci As ConnectionInfo = table.LogOnInfo.ConnectionInfo log.Debug(String.Format("AllowCustomConnection: {0 }, DBName: {1}, IntegratedSecurity: {2}", ci.AllowCustomConnection, ci.DatabaseName, ci.IntegratedSecurity)) log.Debug(String.Format("ServerName: {0}, User: {2}, Password : {1}, 属性:", ci.ServerName, ci.Password, ci.UserID))
For Each a As NameValuePair2 In ci.Attributes.Collection
If a.Name = "QE_LogonProperties" Then
Dim attributes As DbConnectionAttributes = a.Value
For Each b As NameValuePair2 In attributes.Collection
log.DebugFormat(" {0}: {1}", b.Name, b.Value)
Next
Else
log.DebugFormat(" {0}: {1}", a.Name, a.Value)
End If
Next
结束子