I do not think you can get the full sql statement from the SqlCommand object directly. If you register all the commands sent to your sql server, you will see that the transmitted command text matches the command text of your SqlCommand object. Parameter values ββare transferred separately.
So, I think that the only option would be to collect the team text yourself. This is pretty easy; You start with the CommandText SqlCommand and iterate through the Parameters collection, replacing the parameter holders with (shielded) parameter values. This should result in a full sql query that does what you are after.
source share