I was running my site locally and on Azure and it worked fine. Then I moved the site to Arvixe Windows Hosting and I was getting the 'file access retry timeout' error.
It fixed the problem as the site was able to load; however, it caused another problem where a database was called on specific pages. For example, on the contact page the form would error out when submitted.
The solution at StackOverflow was to replace this:
var database = Database.Open("MYDB");
With this:
var database = Database.OpenConnectionString("Data Source=|DataDirectory|\\MYDB.sdf", "System.Data.SqlServerCe.4.0");
While this works, I wonder if there is a better solution?
In my previous post, I had asked a question about global variables and was able to define the send to email as global variable. Is it possible to do something similar for the database?
davidsa
Member
210 Points
126 Posts
'file access retry timeout' error fix and question
Aug 08, 2012 12:53 AM|LINK
I was running my site locally and on Azure and it worked fine. Then I moved the site to Arvixe Windows Hosting and I was getting the 'file access retry timeout' error.
I found the solution at StackOverflow. Here is the link: http://stackoverflow.com/questions/11299263/file-access-retry-timeout-asp-net-webpages-razor-c
I changed this code:
WebSecurity.InitializeDatabaseConnection("MYDB", etc, etc, etc, etc);to this:
WebSecurity.InitializeDatabaseConnection("Data Source=|DataDirectory|\\MYDB.sdf", "System.Data.SqlServerCe.4.0", etc, etc, etc, etc);It fixed the problem as the site was able to load; however, it caused another problem where a database was called on specific pages. For example, on the contact page the form would error out when submitted.
The solution at StackOverflow was to replace this:
var database = Database.Open("MYDB");With this:
var database = Database.OpenConnectionString("Data Source=|DataDirectory|\\MYDB.sdf", "System.Data.SqlServerCe.4.0");While this works, I wonder if there is a better solution?
In my previous post, I had asked a question about global variables and was able to define the send to email as global variable. Is it possible to do something similar for the database?
TomKKK
Member
78 Points
9 Posts
Re: 'file access retry timeout' error fix and question
Aug 10, 2012 06:51 AM|LINK
Well, You can write this in web.config I think.