I use SQL Server 2008 Express instance in my application.My connection string to the database is: Data Source =.\EXPRESS2008;AttachDbFilename=C:\databases\MyDB.mdf;Integrated Security=True;Connect Timeout=120;User Instance=True;As you can see, I'm attaching the relevant db when the db is used first time during the application.Each time I start up my application first time in the day or after some time it was not used, I got an error: Exception Message:The underlying provider failed on Open.Exception Trace:   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)   at System.Data.EntityClient.EntityConnection.Open()   at MyServices.TestConne ...

Go to the complete details ...