views:

20

answers:

1

My connection string is like the following. It shows 'Timeout Exception' first time I run the application. But, for the subsequent run, it's ok. I think, it might take some time to attach the DB to the SQLExpress Server. Is there anyway to increase Timeout period? Thanks

I am using SQLServer 2005 Express and VS 2008 and .Net 3.5.

<add name="dotnetConnectionString" connectionString="Server=.\SQLExpress;AttachDbFilename=|DataDirectory|dotnet.mdf; Database=dotnet;Trusted_Connection=Yes;" providerName="System.Data.SqlClient"/>  
A: 

Use Connection Timeout in your connection string and specify the number of seconds. Try 60 at first.

DaveWilliamson