Wrox Programmer Forums
|
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 June 5th, 2016, 10:26 AM
Registered User
 
Join Date: Mar 2016
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12 & 13

While doing the first try it out session in chapter 13, (step 10 threw an error) I realised that I had inadvertently left the delete statement from step 10 in the last try it out session from chapter 12. I opened SQL Server, but could not locate the Planet Wrox DB. Help!
I logged in to SQL Management Studio as (localDB)\v11.0.

Last edited by martine; June 6th, 2016 at 06:14 AM..
 
Old June 6th, 2016, 06:31 AM
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,

I am not sure I understand the problem. Have you tried browsing for your database in the App_Data folder from within Visual Studio (using the Attach command)?

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!
 
Old June 6th, 2016, 08:35 AM
Registered User
 
Join Date: Mar 2016
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can see the database in App_Data, but cannot connect to in in SQL Server.

Step 10 on page 445: When I bring up Genres.aspx in my browser I get this
-----------------
Server Error in '/' Application.

The connection name 'PlanetWroxConnectionString1' was not found in the applications configuration or the connection string is empty.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The connection name 'PlanetWroxConnectionString1' was not found in the applications configuration or the connection string is empty.

Source Error:


Line 19: </Fields>
Line 20: </asp:DetailsView>
Line 21: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PlanetWroxConnectionString1 %>" DeleteCommand="DELETE FROM [Genre] WHERE [Id] = @Id" InsertCommand="INSERT INTO [Genre] ([Name], [SortOrder]) VALUES (@Name, @SortOrder)" ProviderName="<%$ ConnectionStrings:PlanetWroxConnectionString1.Prov iderName %>" SelectCommand="SELECT [Id], [Name], [SortOrder] FROM [Genre]" UpdateCommand="UPDATE [Genre] SET [Name] = @Name, [SortOrder] = @SortOrder WHERE [Id] = @Id">
Line 22: <DeleteParameters>
Line 23: <asp:Parameter Name="Id" Type="Int32" />
---------------------
 
Old June 6th, 2016, 09:00 AM
Registered User
 
Join Date: Mar 2016
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not to worry. I am having to stop & restart and probably missed a step. I will start the exercise again. It would still be good to know though, why I am unable to get to the database using SQL Server Management.
 
Old June 7th, 2016, 07:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> The connection name 'PlanetWroxConnectionString1' was not found in the applications configuration or the connection string is empty.

This sounds like you changed the connection string in web.config (maybe you added a new one and removed the old one) without updating the control that has a reference to it. Check the name of the connection string in web.config and then search the site for PlanetWroxConnectionString1 and update the references to your current connection string.

>> It would still be good to know though, why I am unable to get to the database using SQL Server Management.

Hard to say without knowing more. Can you elaborate?

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
Chapter 12 and 13 Unable to find WROX.Suggestion module on website mfresa BOOK: Professional DotNetNuke 5: Open Source Web Application for ASP.NET ISBN: 978-0-470-43870-1 0 September 3rd, 2010 03:31 PM
Chapter 13 Drag & Drop Boboneil BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 April 13th, 2010 01:01 PM
Chapter 12 & PDA nickLogan BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 June 28th, 2007 11:26 PM
Using example of Chpts 12& 13 to access new DB cvc505 BOOK: Beginning ASP 3.0 0 October 17th, 2003 04:53 PM





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