SQL Server restore database timeout error

N

noor

Hi, All
I connect to a MS SQL Server 2000 with SqlConnection (ADO.NET & C#) with
this connection string.
Server=SUN; Database=master; User ID=sa; Password=test; Connect
Timeout=1000;

And Submit these statements.

1- ALTER DATABASE [MyDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE

2- RESTORE DATABASE [MyDB] FROM DISK='c:\backup\mydb.bak' WITH RECOVERY

3- ALTER DATABASE [MyDB] SET MULTI_USER

I get this error message.

Timeout expired. the timeout period elapsed prior to completion of the
operation or the server is not responding.

And database set to "Loading" state and can not connect to it.
After this, When I restore Database with SQL Server Enterprise Manager ,All
is Ok.

Why I get this error with ADO.NET.

Thanks.
 
G

Guest

Try CommandTimeout..

----- noor wrote: ----

Hi, Al
I connect to a MS SQL Server 2000 with SqlConnection (ADO.NET & C#) wit
this connection string
Server=SUN; Database=master; User ID=sa; Password=test; Connec
Timeout=1000

And Submit these statements

1- ALTER DATABASE [MyDB] SET SINGLE_USER WITH ROLLBACK IMMEDIAT

2- RESTORE DATABASE [MyDB] FROM DISK='c:\backup\mydb.bak' WITH RECOVER

3- ALTER DATABASE [MyDB] SET MULTI_USE

I get this error message

Timeout expired. the timeout period elapsed prior to completion of th
operation or the server is not responding

And database set to "Loading" state and can not connect to it
After this, When I restore Database with SQL Server Enterprise Manager ,Al
is Ok

Why I get this error with ADO.NET

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top