Is there a way to get CommandText after replacing paramater values programmatically in .NET?
Assume we have a command:
let cmd = conn.CreateCommand()
cmd.CommandText <- "select * from smsqueue where smsqueueid=:pid"
cmd.CommandType <- CommandType.Text
cmd.Parameters.Add("pid", 0)
I want to get the prepared command text; which would be like this:
select * from smsqueue where smsqueueid=0
There are profilers to get this information, but I want to do this explicitly in code (e.g., F# or C#).