Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2015, 02:12 PM
Registered User
 
Join Date: Oct 2015
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Default Chapter 13: (error)"A database with the same name exists, or specified file cannot b"

Hi Imar, hi everybody
In step 6 in the first 'try it out' in chapter 13, when I double click the file PlanetWrox.mdf under App_Data folder a pop-up massage box say:
A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

The full error message:
Unable to open the physical file "C:\BegASPNET\Site\App_Data\PlanetWrox.mdf". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file C:\BegASPNET\Site\App_Data\PlanetWrox.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

How to solve this problem please?

Last edited by Madongeer; November 23rd, 2015 at 02:18 PM..
 
Old November 27th, 2015, 03:55 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look here: It is not liking the connection string.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Madongeer (November 30th, 2015)
 
Old November 30th, 2015, 07:22 PM
Registered User
 
Join Date: Oct 2015
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Smile The database has upgraded!

Thanks Imar, I fixed it myself by changing the permission of the two database files(mdf&ldf). And it works well in VS until I reached Page 505 where I'm supposed to add new tables to the PlanetWrox db, I found that the database is in "Recovery Pending" state, which I can't add or browse the database. I should mention that after changing the permissions and connect the database to VS, VS asked me to upgrade the database, I pressed Yes. Also in SSMS the following message appears when I try to open the db:
Quote:
The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported
I'm using: VS 2015, SSMS 2014 and SQL Server 2012

Last edited by Madongeer; December 1st, 2015 at 03:07 PM..
 
Old December 2nd, 2015, 07:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported
and

Quote:
I'm using: VS 2015, SSMS 2014 and SQL Server 2012
Are you? The error message suggest you have a SQL Server 2014 database (782) that you're trying to connect to a 2012 instance (706).

More info on these versions numbers: http://sqlserverbuilds.blogspot.nl/2...-versions.html

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Chapter 13 "Asynchronous Programming" works with error arvalon BOOK: Professional C# 5.0 and .NET 4.5.1 0 October 22nd, 2015 08:05 AM
Chapter 13 - operating system error 5: "5(access is denied.)" for Planet Wrox DB [email protected] BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 4 March 28th, 2015 07:02 PM
Chapter 13: Not seeing "Edit Columns" choice in SmartTasks Panel for Gridview wgrayson BOOK: Beginning ASP.NET 4 : in C# and VB 7 August 27th, 2012 04:30 AM
Chapter 13 pictureDetails.aspx "The resource cannot be found" Rudy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 November 24th, 2009 04:39 AM
Chapter 2 "An attempt to attach an auto-named database for file.." Gredkins BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 4 May 28th, 2009 11:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.