wizkid2332
asked on
Cannot connect to database on windows 2003 server
am setting up a server to run my site. I am running on Wndows 2003 and have SQL Server Express 2008 installed. I am running the web site on IIS. I am getting an error when I try to access the database when I try to "register a user": Also, I changed the database to not be read only, but I am still gettng the error. I cannot change the folder APP_DATA from being read only (it is a grey mark) but that should not matter since the mdf file can be read.
The error and stack trace are:
Failed to update database "C:\INETPUB\WWWROOT\TEST\A PP_DATA\AS PNETDB.MDF " because the database is read-only.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE xception: Failed to update database "C:\INETPUB\WWWROOT\TEST\A PP_DATA\AS PNETDB.MDF " because the database is read-only.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Failed to update database "C:\INETPUB\WWWROOT\SIGH\A PP_DATA\AS PNETDB.MDF " because the database is read-only.]
System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, Boolean breakConnection) +1950890
System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection) +4846875
System.Data.SqlClient.TdsP arser.Thro wException AndWarning (TdsParser StateObjec t stateObj) +194
System.Data.SqlClient.TdsP arser.Run( RunBehavio r runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlC ommand.Fin ishExecute Reader(Sql DataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
System.Data.SqlClient.SqlC ommand.Run ExecuteRea derTds(Com mandBehavi or cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
System.Data.SqlClient.SqlC ommand.Run ExecuteRea der(Comman dBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlC ommand.Int ernalExecu teNonQuery (DbAsyncRe sult result, String methodName, Boolean sendToPipe) +175
System.Data.SqlClient.SqlC ommand.Exe cuteNonQue ry() +137
System.Web.Security.SqlMem bershipPro vider.Crea teUser(Str ing username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +2430
System.Web.UI.WebControls. CreateUser Wizard.Att emptCreate User() +318
System.Web.UI.WebControls. CreateUser Wizard.OnN extButtonC lick(Wizar dNavigatio nEventArgs e) +102
System.Web.UI.WebControls. Wizard.OnB ubbleEvent (Object source, EventArgs e) +418
System.Web.UI.WebControls. CreateUser Wizard.OnB ubbleEvent (Object source, EventArgs e) +161
System.Web.UI.WebControls. WizardChil dTable.OnB ubbleEvent (Object source, EventArgs args) +19
System.Web.UI.Control.Rais eBubbleEve nt(Object source, EventArgs args) +37
System.Web.UI.WebControls. Button.OnC ommand(Com mandEventA rgs e) +118
System.Web.UI.WebControls. Button.Rai sePostBack Event(Stri ng eventArgument) +166
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument) +10
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData) +36
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +1565
The error and stack trace are:
Failed to update database "C:\INETPUB\WWWROOT\TEST\A
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Failed to update database "C:\INETPUB\WWWROOT\SIGH\A
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlI
System.Data.SqlClient.TdsP
System.Data.SqlClient.TdsP
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Web.Security.SqlMem
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.Rais
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
Have you tried to rightclick the database, select "Properties", go to "Options", go to the section "State" and set the "Database Read-Only" to "False"
ASKER
sstad, I am now getting the error:
The database 'C:\INETPUB\WWWROOT\TEST\A PP_DATA\AS PNETDB.MDF ' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
The database 'C:\INETPUB\WWWROOT\TEST\A
Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
What version of SQL Server and specifically revision created that database? Could you upgrade your 2nd instance of SQL2008 to the same version; this should resolve that issue.
HTH
HTH
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/2e776fb4-6df9-4a11-96f1-948b8a2f839a
http://forums.asp.net/p/899540/979175.aspx#979175