My aspnetdb
database's (the database that get's created when you use asp.net's membership provider) windows file permissions keeps getting reset after a while. This happened on SQL Server 2005 Express and SQL Server 2008 Express.
The database is accessed via an asp.net website. When this happens, the website says login invalid and attempting to reset the password produces an error saying unsuccessful. When I examine the the windows file permissions for the aspnetdb.mdf
, all the user and group permissions are gone. The only way to get things working again is by restoring the aspnetdb
file from backup.
I've tried setting autoclose and autoshrink on the database to false and passing the -t1802
option to SQL Server and this problem still comes up from time to time. The website that accesses the database is running on IIS 7 and asp.net 3.5.
EDIT: My connections strings are:
<add name="LocalSqlServer" connectionString="data source=.\sqlexpress;Integrated Security=SSPI;initial catalog=aspnetdb"/>
<add name="ConnectionString" connectionString="Data Source=(local)\sqlexpress;Initial Catalog=NetDevices;Integrated Security=True" ProviderName="System.Data.SqlClient"/>
I am not dynamically attaching the database, I attach the aspnetdb.mdf file explicity in sql management express.