newbie question (Failed to update database)

G

Guest

Please Help,

I am using Visual Web Developer 2005 Express and downloaded the personal
website template. I published it and get the following error:

Failed to update database "..\ASPNETDB.MDF" because the database is read-only.

[SqlException (0x80131904): Failed to update database
"C:\INETPUB\WEBS\PERSONAL\APP_DATA\ASPNETDB.MDF" because the database is
read-only.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection) +786274
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +684886

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +207
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +1751
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString) +107
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
+570
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result) +134
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.Security.SqlMembershipProvider.CheckPassword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved, String& salt, Int32& passwordFormat) +1861
System.Web.Security.SqlMembershipProvider.CheckPassword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.ValidateUser(String username,
String password) +78
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
+161
System.Web.UI.WebControls.Login.AttemptLogin() +94
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
+101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String
eventArgument) +146

System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5670
 
G

Guest

ok for the access database. when you are doing an update or any querying the
database using asp.net, the microsoft access database should not be opened in
a seperate window. then check if its really read only. and then add the
aspnet, iis_*** users and give read, write and read and execute access. hope
this helps
 
G

Guest

After creating a new personal website using visual web developer 2005 beta 2,
I get the same exact error.

You are able to get to the login screen and enter a user name and password.
After hitting the login button, you get that error.

I have tried permissions in IIS and at the file system level (NTFS), but to
no avail.

IUnfortunately, Latha V.'s post was too vague for me to be useful. I have
no access db window open, its using SQL express.

Any help would be appreciated.
 
R

Riki

Rock R. said:
After creating a new personal website using visual web developer 2005 beta
2,
I get the same exact error.

You are able to get to the login screen and enter a user name and
password.
After hitting the login button, you get that error.

I have tried permissions in IIS and at the file system level (NTFS), but
to
no avail.

IUnfortunately, Latha V.'s post was too vague for me to be useful. I have
no access db window open, its using SQL express.


The workaround that solved it for me was the following:
- create a new website
- set the ACL permissions on the App_Data folder BEFORE creating
the membership provider
- create the membership provider (in VWD with Website/ASP.NET Configuration)
- copy over all the files from the existing website

Riki
 
G

Guest

Thanks Riki, but I am still getting that error. Here's what I do:

OS= Windows XP Pro 5.1 SP2
DB=SQL Server 2005 (express)
Visual web developer 2005 express
Webserver=IIS v5.1
Framework=.Net Framework 2.0

1) Set ACL on C:\Inetpub\wwwroot to give ASPNET full permission
2) Start VWD and create a new personal website
3) Set the ACL on c:\documents and settings\user\my documents\visual
studio\websites\website1 to give ASPNET full permission
4) Open VWD and run website->asp.net config
5) Problem 1: there are no roles defined as the documentation describes. So
I create a role for Administrators and a role for Friends
6) I then add a user and select it both roles defined above.
7) I verify permissions on my documents\visual
studio\websites\website1\App_data and all files contained under it that
ASPNET group has full permissions.
8) I publish the website in VWD to c:\inetpub\wwwroot
9) I verify that c:\inetpub\wwwroot\app_data gives ASPNET full control
10) I bring up IE and connect to localhost......long pause before first web
page of the personal site come up. I login using my admin account I created
and I get:
Failed to update database "C:\INETPUB\WWWROOT\APP_DATA\ASPNETDB.MDF" because
the database is read-only.
11) I try to delelete the file C:\INETPUB\WWWROOT\APP_DATA\ASPNETDB.MDF but
it is use by another process
12) I bring up a task list and notice that there are several SQLSERVR.EXE
running, but only one running as ASPNET. So, I end that process.
13) I then delete the aspnetdb.mdf file with no hitches, so I know it is
connecting to the database as ASPNET, but I can't get it to connect
read-write.

Anyone have any thoughts?
 
A

Arian T. Kulp

I also had this problem. In my case it isn't the MDF created by the
membership provider though. It's a custom MDF that I dragged in there. I
have decided to just give up and attach it to the default SQL Server
instance on the server and attach to it as a shared database. It's ok since
it's my own server, but definitely not my preference.

-Arian

mauricioaglr said:
Please Help,

I am using Visual Web Developer 2005 Express and downloaded the personal
website template. I published it and get the following error:

Failed to update database "..\ASPNETDB.MDF" because the database is
read-only.

[SqlException (0x80131904): Failed to update database
"C:\INETPUB\WEBS\PERSONAL\APP_DATA\ASPNETDB.MDF" because the database is
read-only.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection) +786274
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +684886

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +207
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +1751
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString) +107
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
+570
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result) +134
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.Security.SqlMembershipProvider.CheckPassword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved, String& salt, Int32& passwordFormat) +1861
System.Web.Security.SqlMembershipProvider.CheckPassword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.ValidateUser(String username,
String password) +78
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
+161
System.Web.UI.WebControls.Login.AttemptLogin() +94
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs
e)
+101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
+35
System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String
eventArgument) +146

System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5670
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top