Having code that looks like:
MySqlCommand cmd = new MySqlCommand(
"SELECT * FROM DB_name_here WHERE some_field =@some_value;"
);
cmd.Parameters.AddWithValue("@some_value", some_string_here);
Can I get it back as a simple string for debug purposes, that says:
SELECT * FROM DB_name_here WHERE some_field =some_string_here;
The obvious cmd.ToString() failed me promptly, returning a MySql.Data.MySqlClient.MySqlCommand
.
The cmd.CommandText will return the string with the parameter (@some_value
in my case).
Any suggestions?