Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 and Databases
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 and Databases by John Kauffman, Bradley Millington; ISBN: 9780471781349
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 and Databases 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 October 20th, 2006, 03:49 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default TIO-1604-SqlCacheInvalidation problem

After creating the aforementioned page as per the instructions, and after making the changes to the Global.asax file (it's in the root of the web site/project, also as per the instructions), when running my TIO-1604-SqlCacheInvalidation.aspx page, I'm greeted with an error that states, "An attempt to attach an auto-named database for file C:\WINNT\Microsoft.NET\Framework\v2.0.50727\pubs.m df failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share." My database for the project exists in the following location: C:\Websites\BegAspNet2Db\App_Data\pubs.mdf.
Can anyone offer any insight as to what the problem might be and what I should be looking for?
 
Old October 22nd, 2006, 12:54 AM
Authorized User
 
Join Date: May 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I remember this problem came up in earlier versions of SSE and VWD. Are you using the latest downloads?
I'm pretty sure that it is the first problem, in that SSE already has an attachmnt to the file.
CHeck your versions and I'll look into it some more.

 
Old October 23rd, 2006, 09:49 AM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply. I'm a little unclear as to your reference to downloads and versions...are you referring to SQL Server Express and Visual Web Developer, or are you referring to the download/version of the pubs (pubs.mdf) database?

As a footnote to my problem, I've noticed that when I refresh the TIO-1604-SqlCacheInvalidation.aspx page (it's still in the browser displaying the original error message), I get a different error message that states, "When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance." I don't know if this means I should be looking in a different direction to fix the problem.

 
Old October 23rd, 2006, 10:22 AM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, it looks like I've fixed my problem by doing the following: I detached and then deleted the "pubs.mdf" and "pubs.ldf" files I had been using within the project. Then I grabbed a copy of the "pubs.mdf" file from the original Wrox download and put it in my "App_Data" folder. Next, I deleted the connection string that had previously been created (the "<add name="MdfPubs"...>" connection string) in my "web.config" file. I then added a new SQL data source to my page so that I could create a new data connection and have the connection saved in the application configuration file (the "web.config" file). Finally, after running the page and seeing that it now works properly, since I really didn't need the new/second SQL data source I deleted it from the page.





Similar Threads
Thread Thread Starter Forum Replies Last Post
TIO-0903-TextBoxWithLIKE tbroom BOOK: Beginning ASP.NET 2.0 and Databases 1 November 1st, 2006 04:11 PM
TIO-0904-DropDownList tbroom BOOK: Beginning ASP.NET 2.0 and Databases 0 October 13th, 2006 05:00 PM
Chapter 15 TIO 1504 Problem rsearing BOOK: Beginning ASP.NET 2.0 and Databases 2 October 12th, 2006 02:55 PM
WOW--TIO-0905 VERY confusing rsearing BOOK: Beginning ASP.NET 2.0 and Databases 9 October 12th, 2006 12:36 PM





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