Click here to Skip to main content
12,997,531 members (58,910 online)
Rate this:
Please Sign up or sign in to vote.
how to restore database backup in with C#,ASP.NET. when i restore the database with below query

"RESTORE DATABASE SISDB FROM DISK = 'C:\\SQLServerBackups\\TEST.bak' WITH MOVE 'TEST' TO 'C:\\Program Files\\Microsoft SQL Server\\MSSQL10_50.MSSQLSERVER\\MSSQL\\DATA\\TEST.mdf', MOVE 'TEST_log' TO 'C:\\Program Files\\Microsoft SQL Server\\MSSQL10_50.MSSQLSERVER\\MSSQL\\DATA\\TEST_log.ldf'"

then i got this error :- "Exclusive access could not be obtained because the database is in use. RESTORE DATABASE is terminating abnormally."

Please help me to resolve this....
Posted 2-Feb-13 0:31am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100