 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
|
|
|
|
|

August 3rd, 2010, 03:34 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Completely lost starting with Chapter 11
Hello,
I've been following the book rather well up to Chapter 11, but I am completely lost now trying to configure everything. I have been trying to complete the first Try It Out (p. 356) but I keep getting the error "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."
I've tried reading ahead to chapter 18 and Appendix B, but I'm getting lost in terms of what should be done and when. Here's what I've done so far:
- I'm running Microsoft Visual Studio 2010 Professional on Windows 7.
- I downloaded and am running Microsoft SQL Server 2008 R2.
- I downloaded and am running Microsoft SQL Server Management Studio v. 10.50.1600.1
- Per Chapter 18, I have verified the IIS is installed, and installed and configured ASP.NET. I got up to step 5 on the Try It Out that starts on p. 649 but I guess I haven't created the user accounts yet.
- I'm a newbie at all of this so I don't know what other information you might need.
I could use any help you can offer in terms of syncing everything up. One specific question I have is: At what point in the book should I have (or will) set up the C:\BegASPNET\Release folder? I got to this point in the Try It Out in chapter 18 (p. 653) but cannot find the point in the book where this folder is set up. I looked in the intro chapter and all it says it that "Later chapters will have you create..." the Release folder. I'm also stuck because I have yet to see/install the aspnetdb database. I completed Scenario 2 in Appendix B up to step 7.
Please help and thank you! 
|
|

August 3rd, 2010, 04:37 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
There's a lot of stuff in Chapter 18 that you don't need to worry about yet. IIS, for example, is ony needed for deployment. So is the release folder. The only thing relevant in Chapter 18 for Chapter 11 is the part about NTFS permissions for the App_Data folder. I have fixed this confusion in the 4.0 version of the book, but it was too late for the 3.5 version ;-)
So, all you need to worry about is SQL Server. Preferably, install SQL Server 2005 Express or SQL Server 2008 Express. I have both running on my machine (as well as other versions of SQL Server) and using Express makes development a whole lot easier.
You should be able to install the Express edition using the Web Platform Installer: http://www.microsoft.com/web/downloads/platform.aspx
If you're using a commercial version of SQL Server, make sure you remove the User Instance attribute from the connection string. Additionally, don't use the AttachDbFile attribute but attach the database first. Finally, you need to prepare the database using the aspnet_regsql tool as explained in Appendix B.
But again, you're much better off using the Express edition for now. Things "will just work", allowing you to focus on web and database development know. Once you're deeper into the technology, you'll find the step to deployment to production servers a lot easier.
Cheers,
Imar
|
|

August 3rd, 2010, 06:57 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
I downloaded the Web Platform and installed it. However, I am still getting the same error message when I try to open the database in Step 4 of the Try It Out on p. 356 (Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.). Does the SQL server need to be opened in the background? What do I need to do with the sample database within SQL server, if anything? Are there specific tools I need to install with the Web Platform (there are a lot of different things in there)?
Jason
|
|

August 4th, 2010, 02:08 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I downloaded the Web Platform and installed it.
|
Quote:
|
Are there specific tools I need to install with the Web Platform (there are a lot of different things in there)?
|
The WPI by itself doesn't do much, so just installing it doesn't help. You need to run it and then make sure that SQL Server Express is selected. Once SQL Server is installed, you should be able to use it as described.
To test if SQL Server is running, start the SQL Server Management Studio tools as an Administrator and try to log on in to .\SqlExpress or machineName\SqlExpress. Replace machineName with the name of your Windows machine.
Do you know what instances of SQL Server you have installed and how they are called?
Imar
|
|

August 4th, 2010, 02:19 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have verified that the SQL server is running. I was able to login using mymachinename\SQLEXPRESS.
Since there seems to be some sort of sync problem, I tried uninstalling SQL Server R2 2008 Express as well as my Microsoft Visual Studio 2010 Professional and then reinstalled them. Unfortunately, I'm still getting the same error (Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.).
I don't know anything about SQL server so I do not know what you mean by "what instances of SQL server have you installed?" I'm not sure what an instance is. Is that just the version of SQL server?
Sorry for the newbie questions
Jason
|
|

August 4th, 2010, 02:44 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
No problem...
An instance is a SQL Server concept to allow multiple instance of SQL Server on the same machine. The default instance (if you don't specify one during installation) is . or MachineName. In the case of an instance called SqlExpress, you address the instance as .\SqlExpress.
When you log in to SQL Server, you should see a version number. Does it start with a 9 or a 10? (9 implies SQL 2005; 10 SQL 2008).
Other things to check: What do you see when you choose Tools | Options | Database Tools | Data Connections? Is SQLExpress listed there in the instance name? If not, change it to SqlExpress.
And how does the connection string you're using look? Finally, where / when do you get this error? Please be as detailed as possible. Ths is probably easy to fix, but not remotely without seeing the machine.... ;-)
Cheers,
Imar
|
|

August 4th, 2010, 03:17 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The SQL Server version is 10.50.1600.1.
I don't see an option for database tools under Tools > Options. The only options I see are Environment, Text Editor, Query Execution, Query Resultsm SQL Server Object Explorer, Designers, and Source Control.
I don't know what you mean by "how does the connection string look."
The error occurs as follows...I have the PlanetWrox.mdf and PlanetWrox_log.ldf files located in my BegASP > Resources > Chapter 11 folder. I create a new website in Microsoft Visual Studio 2010 Professional. I have ensured that my App_Data folder has the correct permissions (modify). I locate the two above files and drag them to the App_Data folder of the website, and click yes to overwrite. When I doubleclick on the .mdf file in the App_Data, I get the error. Solution Explorer becomes Server Explorer. I can see the .mdf file, but it has a yellow cylinder with a small red x icon next to it.
|
|

August 4th, 2010, 03:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I don't see an option for database tools under Tools > Options.
|
Sorry, you need to look for that in Visual Studio / VWD, not SQL Server. Forgot to mention that.
What happens when you add a new SQL Server database to the App_Data folder for the site? Can you open that file correctly?
And how did you configure permissions for App_Data? Are you sure you configured the correct folder? Have you tried granting permissions to the Everyone account?
Sorry I can't be more explicit. Something is wrong and we need to find out what ;-)
Imar
|
|

August 4th, 2010, 03:37 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
|
|

August 4th, 2010, 05:04 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK, I went through the Option > Tools ... in Visual Studio. SQLExpress is listed as an instance name.
When I try to create a SQL database by adding it to the App_Data folder I get the same error. I configured the App_Data folder as per the instructions in the Try It Out on p. 356. I am sure I configured the correct folder (the App_Data folder corresponding to my database sample website).
I gave full control permissions to both this folder and to the My Documents > Visual Studio 2010 folder (as suggested in the article), but the error continues.
I noticed in the article you suggested that one of the problems seems to be when different people login to the same computer. I definitely don't have that problem as both my wife and I use the same computer user account at home. Another fix seems to be changing "user instance to false (user instance = false)" but I don't see that code within the markup. Where do you locate connection strings?
Does the Visual Studio 2010 professional edition come packaged with SQL? I'm wondering if I could potentially be causing a conflict between the SQL that installs with VS 2010 and another that I am downloading?
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| chapter 11 figure 11-7 relative positioning |
pelopito |
BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 |
2 |
November 29th, 2007 06:11 AM |
| Lost in Chapter 8 |
pjwarez |
BOOK: Beginning Mac OS X Programming |
2 |
October 21st, 2006 12:10 PM |
| Lost in Chapter 2 |
kyleridolfo |
BOOK: Expert One-on-One Access Application Development |
0 |
January 5th, 2005 08:01 PM |
|
 |