Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 10, 2012 06:51 AM by TomKKK
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);
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");
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?
Aug 10, 2012 06:51 AM|LINK
Well, You can write this in web.config I think.