System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use.

Error:
Restore Failed For Server 'MyServer' (Microsoft.SqlServer.Smo)
Additional information:
System.Data.SqlClient.SqlError: Exclusive access could not be obtained 
because the database is in use. (Microsoft.SqlServer.Smo)

Solution:


1.execute SP_WHO

EXEC sp_who

2.Execute KILL 53 /Kill 116

3.Restore from another database.

Right click on database which you want to restore

4.Done.