I am using this code to delete a database through C#
Int32 result = 0; try { String Connectionstring = CCMMUtility.CreateConnectionString(false, txt
Create sqlconnection object for different database other than you want to delete.
sqlCommandText = "DROP DATABASE [DBNAME]"; sqlCommand = new SqlCommand(sqlCommandText , sqlconnection); sqlCommand.ExecuteNonQuery();