我可以遍历SQL Command中的每个参数但是如何记录 parametername和Value?
Public Sub LogParams(sqlcmd As SqlCommand)
Dim strParam As String = ""
For Each p As SqlParameter In sqlcmd.Parameters
strParam += 'how to get Name and Value of parameter?
Next p
End Sub
答案 0 :(得分:2)
您可以将其用作
For Each p As SqlParameter In sqlcmd.Parameters
'p.ParameterName
'p.Vaalue
Next p