 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
 | This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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
|
|
|
|
|

July 29th, 2006, 05:24 AM
|
|
Registered User
|
|
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
First Chapter DiaryDB.mdf
Hi there
i just bought this book and trying to attatched the DiaryDB.mfd file with the SQL server 2000 but everytime i try to attatch i get the SQL server 602 error message. Could you please do a step by step instructions as how to attatch the database with SQL server 2005 and what will be the connection string. I am very desperate to run the very first page.
Thanks
Rhl
|
|

July 29th, 2006, 06:58 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Rhl,
Unfortunately, there are no step by step instructions to give.
The .mdf files that come with the book are all SQL Server 2005 databases. So, you'll need SQL Server 2005 (for example, the free Express Edition) to run the websites.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
|
|

August 11th, 2006, 12:35 AM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm having the same problem with the SurveyEngine database, chapter 4, and with Sql Server 2005. Same 602 error. This was the first project I tried from the book.
The website runs fine, if I follow the setup procedure, which deposits the database under a specific directory, under C:\InetPub\....
I want to do more than just run the website however.
In Visual Studio 2005, I can make a connection to this database, and work on it, if the DB is that specific directory and only that directory.
I cannot connect to this database through VS 2005 if it's in any other directory. Sql Server Management Studio 2005 cannot attach the database regardless of where it's located. I cannot use Sql Express's Management Tool, as its install procedure detects that I'm running the full blown version of Sql Server 2005, and says "forget it".
This seems awfully brittle - I should be able to open it with Sql Server 2005's management studio, and Visual Studio 2005 should be able to connect to the database, regardless of what directory it's located in. Any help?
Do you think you could supply the scripts to create these application databases, for each of the 12 chapters? That would solve everything for me, and would eliminate a whole class of problems for many people.
Thanks.
|
|

August 11th, 2006, 01:19 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
My guess is that you attached your database to SQL Server and try to auto connect to it from within VWD, right?
Here's what you should do to make this work:
1. Move the database from the App_Data folder to another location, like c:\databases
2. Attach the database to SQL Server 2005 using SQL Server Management Studio. This should work, because the database has no locks or references to your site.
3. Open Visual Web Developer and modify the connection string so it points to your SQL Server and no longer to your local database file in App_Data.
Take a look at this article for more details:
http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

August 11th, 2006, 05:32 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My guess is that you attached your database to SQL Server and try to auto connect to it from within VWD, right?
No.
I cannot get Sql Server 2005 to attach to this database, regardless of where it's located on the hard drive. I tried attaching to one other database (for chapter 2) after copying it to disk, thinking it might be a problem specific to this one database, and this doesn't work either.
I followed the directions for attaching a database, it's simple, but just doesn't work. I get this message box from Management Studio:
"An error occurred when attaching the database(s). Click the hyperlink in the Message column for details"
This reveals:
"Attach database failed for server 'SONGBIRD'. (Microsoft.SqlServer.Smo)
Additional Information:
An exception occurred while executing a Transaction-SQL statement or batch (Microsoft.SqlServer.ConnectionInfo)
Could not find row in sysindexes for database ID 14, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database
'C:\INETPUB\WWWROOT\SURVEYENGINE\APP_DATA\SURVEYDB .MDF' CREATE DATABASE is aborted. (Microsoft Sql Server, Error: 602)
Notes on the above:
In Sql Server 2005, I'm running as "sa" (God)
I probed the master database and found that database ID 14 is the next free DBID, which is probably what it was trying to call the database it was attempting to attach.
I can connect to this database using Visual Studio 2005 (not VWD) but only if the database is located in the directory it was installed to, not if it's copied somewhere else.
You'd save us and yourself a lot of grief if you could provide creation scripts for the twelve databases. It only takes a few minutes to script out the entire database + views + stored procedures.
Think about it.
|
|

August 11th, 2006, 11:01 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I was able to work through this problem, getting Sql Server 2005 to attach the database. It took some searching via Google to find the answer, which I share below...
My computer had Sql Server 2000 installed on it, before installing 2005. Fixing the problem required removing the 2K installation, as well as the 2005 installation, and then reinstalling Sql Server 2005.
Apparently the 2005 installation used some of the 2K components, which balked at attaching your database.
I'm now also able to create a connection to this database from Visual Studio 2005, regardless of where the database is located - this fomerly didn't work either.
And so everything seems to be working now.
|
|

August 12th, 2006, 08:02 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great. Glad it's working.
Quote:
|
quote:You'd save us and yourself a lot of grief if you could provide creation scripts for the twelve databases. It only takes a few minutes to script out the entire database + views + stored procedures.
|
It's not just that; it also requires manually writing a lot of INSERT statements to get the initial data in the database.
In many cases (apparently not yours) attaching is as easy as it should be. Just follow a few steps in you're done. AFAIK, you're the first person that reported problems with attaching an existing 2005 database to a 2005 installation.
I'll see if I can create scripts for some of the chapters; not all of them need them....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

November 19th, 2006, 11:16 PM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
FYI - I got the same 602 message trying to attach any database from the book to SQL 2005 Server. My environment was similar to the other individual with the problem - SQL 2000 with a subsequent SQL 2005 installation on top of that. I also have a developmental server with SQL 2005 installed alone that attaches these databases without any problems at all.
Removing SQL 2000 and reinstalling SQL 2005 seems a bit extreme. Another fix would be nice.
|
|

November 21st, 2006, 02:30 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Could something have been wrong with the 2005 installation?
Personally, I have 2000 and 2005 running at the same time, and never had an issue with attaching or detaching database.
So, I am not sure what "fix" you want me to post. Can you elaborate?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Get password value from aspnetdb.mdf |
rsearing |
ASP.NET 2.0 Basics |
8 |
October 12th, 2007 09:12 AM |
| Retrieve from MDF |
toddw607 |
SQL Server 2005 |
0 |
October 8th, 2007 03:28 PM |
| aspnetdb.mdf |
Jackxxx |
ASP.NET 2.0 Basics |
0 |
January 9th, 2007 01:37 PM |
| CoffeeSQL.mdf |
cherry |
Book: Wrox's Visual C# 2005 Express Edition Starter Kit |
2 |
September 4th, 2006 04:08 PM |
|
 |