.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Failed to update database "Hist_OHLC_ASnapshot" because the database is read-only.

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
Hi there, I've got this ExecutionfailureException using the subroutine below. It's been suggested by Alok.   public void CreateSnapshotAlok ( string SourceDatabaseName )         {             ProvideSecurity.provideSecurity ( );             DoServer.GetSrvConnOrSwitch ( "master" );             /* This is to ensure that a database with same name does not exist which is not needed if one chooses unique name for snapshot each time.*/             if ( Globals.srv.Databases[ SourceDatabaseName + "_Snapshot" ] != null )             {                 Globals.srv.Databases[ SourceDatabaseName + "_Snapshot" ].Drop ( );             }             Database database = Globals.srv.Databases[ SourceDatabaseName ];             Database snapshot = new Database ( Globals.srv, SourceDatabaseName + "Snaps

View Complete Post

More Related Resource Links

Faild to update database , becouse the database is read-only.



I creat a WindowsFormsApplication that its name is Taxi_agancy

I attached a database file that its name is Taxi_Agency.mdf to my project from server explorer in Visual Studio . ( I add conection to data connections and select Microsoft SQL Server Database File) and in Database file name I enter my database file .

I created a stup project for it . When I install my application in another computer and I try to add some data to my Database from application interface I recieve this error :

Unhandled exception has occurred in your application . if you click countinue the application will ignore this error and attempt to continue . if you click quit the application will close immediatly .

Failed to update database "c:\program files\default company name\setup\Taxi_agency.mdf" because the database is read-only.

Windows 7 Phone Database Rapid Repository Create Read Update and Delete


Download the code and a fully working example application from http://rapidrepository.codeplex.com/


  1. Introduction
  2. Set up the Rapid Repository
  3. Create, Read, Update and Delete
  4. Failed to Update Database


    It seems like it is same old problem everyone is having but i am not getting it resolved so i am frustated . Can u guys help me here.

    I am creating windows forms appplication using service based database i am creating a inventory system in my local computer , this is not web database . Everything was working all fine and but last night i encountered with this problem when i wanted to add more table definitions in my customer table . I was struck with this dialog box saying

    "Error were encountered during save process.Some Database objects were not saved"

    underneath that

    "XXX" table

    -Unable to modify table

    "Failed to update databse"local address of my databasde.mdf file" because database is read only"


    looking at diffrent forums i unchecked my .mdf  read only properties still didnt work

    I dont know what should i do

    It s not letting me make any kind of edit on my database file

    Please Help



update user status in database when ever user logoff


actually i came across this senario for new project where userstatus must change to log off when ever he do fallowing activity.I have maintain user status when he log in to web based system.

Activities are


1.user click log off

2.or user click browser close button or close brwoser tab.

3.or Fource fully shut down his Pc

I am able to get first 2 but not the last one.I googled it but not get any satified ans for that.

I m looking for guidens for this. Any help is grate help for me as i want it.And also other suggesstion also welcomed.

thanks in advance


execute update timedout expires , table with trigger due to recovery of database


I have table A in database A  , in table A i have trigger to insert record to database B table A, each update and insert of database A -table A, triiger fire and insert record in database B table A, when i try to update some times asp.net application gives error

"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

and then error log says System.Data.SqlClient.SqlException: Database 'database B is being recovered. Waiting until recovery is finished.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean ret

Update Profile Database from text file using BDC



I have a requirement to import the profile properties from a text file in sFTP to update the MOSS Profile Database. The objective is to create a single repository for the Staff Directory in MOSS.

Can I use BDC to connect and update the Profile database?

What is the alternate approach?


replicate a standby / read-only database

I have a database that is being replicated with log shipping. The database is in Standby/Read-only mode. The logs are restored every 30 seconds. For the logs to be restored all users are disconnected. But I want to have continuous read access to the replicated database. So I thought: why not replicate the replicated database? This second replication can happen on the same machine or on the same instance, the only purpose would be having a copy for continuous read access. I have looked at mirroring and transactional replication, but these things do not give me what. Is there a way of replicating a Standby/Read-Only database with continous read access to the replica? Thanks in advance, Frans

attach sample database failed in sql 2008 express RTM

I'm having a trouble attaching sample database northwnd database,screen show me the error attach database failed for server 'computername\sqlexpress' additional inforamtion: the database 'northwind' cannot be opended because it is version 661.this server supports version 655 and earlier.a downgrade path is not supported.could not open new database 'northwind',create database is aborted,()microsoft sql server,error:948) my os is xp sp3,sql express version is  Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)   Jul  9 2008 14:43:34   Copyright (c) 1988-2008 Microsoft Corporation  Express Edition with Advanced Services on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)  I 'm sure database 'northwind' is ok.I can used database 'northwind' on my other computer.the other computer install express 2008R2 .    install RTM computer  ,database route is C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS,not C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. actually I 'm install sample database in sql express RTM on my computer.I just wonder why attach good database failed,how to solved this issue. http://sqlserversamples.codeplex.com/releases/view/45923 this link is avialable   thanks for you help

Cannot open database "ReportServer$SQLEXPRESS" requested by the login. The login failed. (App Log Ev

I have SQL'08r2x64 freshly installed on a WS'03r2x64sp2 box and WS is also a DC (sorry).  Previously, there was a SQL'05sp3 installation on this box and it worked splendito.  I used the SQL'05 for some minor devel and to host a Backup Exec 11D db/installation; it all was splendito.   Then, i removed SQL'05&BE11D to prepare for an upgrade of this arrangement.  Next, i installed said SQL'08 to be the foundation for a planned Backup Exec 12.5 install.  To date, I can't get to a clean install of SQL'08 and thus have not progressed to installing BE12.5.  I now have this painfully annoying situation (as i've been beating on it for 2 days) where a series of errors occur during boot: 1st: srmSvc; Event ID 12317; File Server Resource Manager failed to enumerate share paths or DFS paths.  Mappings from local file paths to share and DFS paths may be incomplete or temporarily unavailable.  FSRM will retry the operation at a later time. 2nd & 3rd (occurs twice): MsSQL$buExpressSQL; Event ID 18456; Login failed for user 'BOWMAN\ExecSQL'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] 4th: Report Server Windows; Event ID 107; Report Server Windows Service (SQLEXPRESS) cannot connect to the report server database. I couldn't find anything to sink my teeth into for the 12317 error; i

Crystal Report Export - Database Logon Failed Error -

 Below is my code in VB.Net.  I am using PUSH method to populate the DataSet.  I use Crystal Report and VS 2003.   I am trying to export a crystal report to a PDF and I am getting a database log on error.   Why would it give me this error since the report is getting its data from the DataSet.  Please help!!!  ---------------------------------------------- Try Dim oStream As New MemoryStream Me.crpt_numIssues.ExportToStream(ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Response.BinaryWrite(oStream.ToArray()) Response.End() Catch ex As Exception Dim mgsText As String mgsText = "ERROR: An error occured. <br>" + ex.ToString Me.ShowErrorPanel(mgsText) End Try ------------------------------ The error is: CrystalDecisions.CrystalReports.Engine.LogOnException: Database logon failed. ---> System.Runtime.InteropServices.COMException (0x8004100F): Database logon failed. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqCo

Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)

Hello,This is the first time I am using this forum. I am stuck and need some help. I received this error message both on SQL 2005 and 2008. I am currently using SQL 2008 DEV for testing purposes and I am experiencing this error message when trying to connect to Database Engine Tuning Advisor. I am using the SA account so I should not have any security issues. Also this is a fresh install of SQL 2008 DEV on a fresh install of Windows XP Pro with all SP. Can some please help.Error:"Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)"=================================== Failed to open a new connection. =================================== Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient) ------------------------------Program Location:    at Microsoft.SqlServer.Management.DTA.Client.TuningServer.InitializeTuningParametersDatabase()   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.InitializeConnection()   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.Connect()   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.AddServerInternal(SqlConnectionInfo connectionInfo, SqlConnection connection)   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.AddServer(SqlConnectionInfo connectionInfo, SqlConnection connection)   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.On

Update Database Schema without redeployment in Entity Framework

Hello. we build an app with 2 layers i.e the presentation and the Business layer which holds the business logic and have the entity framework provide us wtih entities. my question here is is there a way we can change the database schema and not have to redeploy the app to the client.  

restore database failed

Hi everyone.   I had installed sql server 2008 on my local machine to develop a project.After i had done more than a half of that i had some problems with my computer so i had to format it.I backed up the database and i copied the file nomedatabase.bak. After formating and reinstalling the slq server 2008 r2 develope edition i would like to restore the database i had before but when i chose to restore the database  (i created a new database with the same name and than right click on the database -> tasks -> restore ->database  ) i get the following error.   TITLE: Microsoft SQL Server Management Studio ------------------------------ Restore failed for Server 'ALDUXO-PC\ALDUXO'. (Microsoft.SqlServer.SmoExtended) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'aldux_test' database. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&LinkI

Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential cau

Attempting to upgrade from SQL 2005 EE to SQL 2008 EE on Vmware ESX 3.5 virtual server. below is info from Detail.txt related to successful install with failures... 2010-09-02 13:50:46 Slp: Sco: Attempting to check if file 'D:\Data\MSSQL.1\MSSQL\LOG\ERRORLOG' exists 2010-09-02 13:50:46 Slp: Sco: Returning security descriptor O:BAG:SYD:AI(A;ID;FA;;;S-1-5-21-3788118842-658835432-3441893140-1006)(A;ID;FA;;;S-1-5-21-3788118842-658835432-3441893140-1007)(A;ID;FA;;;BA)(A;ID;FA;;;SY)S:AI(AU;IDFA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD) 2010-09-02 13:50:46 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing ConfigRC and scenario ConfigRC. 2010-09-02 13:50:46 Slp: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes. 2010-09-02 13:50:46 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing ConfigRC and scenario ConfigRC. 2010-09-02 13:50:46 Slp: Microsoft.SqlServer.Configuration.SqlEngine.SqlEngineConfigException: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes. 2010-09-02 13:50:46 Slp:    at Microsoft.SqlServer.Configuration.SqlEngine.SqlServerServiceBase.WaitSqlServerStart(Process processSql) 2010-09-02 13:50:46 Slp:    at Microsoft.SqlServer.Configuration.SqlEngine.SqlServerServiceSCM.StartSqlServer(St

Cannot open database " " requested by the login. The login failed.

Hi, I am trying to take the backup of the sitecolletion using stsadm -o command, getting the following error. Cannot open database "dbName " requested by the login. The login failed. Login failed for user  'User'. Any help appriciated. Thanks Srikanth Reddy

Sharepoint Designer update which database

Whenever you are making changes using Sharepoint Designer, which content database is going to be update or which database maintain the information whenever you made the change thri sharepoint designer?

Update Database Record using GridView and Stored Procedure

Hi, I am trying to update record via stored procedure, but i got error at very start point. Problem is when i click on Edit link button within the Gridview it produce error. I can populate values from database fine but its produce error when i click on edit link button. Please see the code below. *********** ASP.net GridView Code I am using *****************<asp:GridView ID="GridView1" runat="server" DataKeyNames="RollID, EmpID" AutoGenerateColumns="False" Width="700px"> <Columns> <asp:TemplateField HeaderText="ApplicationID" Visible="false"> <ItemTemplate> <asp:Label ID="AppsID" runat="server" Visible="false"><%# Eval("RollID") %>'</asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ReleaseID" Visible="false"> <ItemTemplate> <asp:Label ID="rlsID" runat="server" Visible="false"><%# Eval("EmpID") %></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Roll Name"> <ItemTemplate> <asp:Label ID="rlsVersion" runat="server"><%# Eval("Roll_Name")%></asp:Label> </ItemTemplate> <EditI
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend