我有以下 MySqlCommand:
Dim cmd As New MySqlCommand
cmd.CommandText = "REPLACE INTO `customer` VALUES( ?customerID, ?firstName, ?lastName)"
With cmd.Parameters
.AddWithValue("?customerID", m_CustomerID)
.AddWithValue("?firstName", m_FirstName)
.AddWithValue("?lastName", m_LastName)
End With
我有一个处理 MySqlCommands 执行的类,我想让它记录每个查询到一个文件。我可以检索正在执行的查询/命令:
cmd.CommandText
但这只是返回带有参数(?customerID、?firstName 等)的原始CommandText ,而不是AddWithValue函数添加的实际替换值。如何找出执行的实际“最终”查询?