use master
drop database db_name
Most of the time, this can succeed. If the same error message still pops up, disconnect query analyzer or management studio from the SQL Server and reconnect to it and run the above t-sql command again.
From novice to professional on SQL Server technology