I have the following query:
use [$(DB)]
select * from users
but I cannot pass the parameter trough SqlCommand. It works only from the command line tool. It says that $DB database does not exist, so the parameter is not passed.
SqlCommand cmd = new SqlCommand(query, connection);
cmd.Parameters.AddWithValue("DB", "theDatabase");
cmd.ExecuteNonQuery();
Any ideas?