Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
|
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 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 10th, 2009, 09:26 AM
Authorized User
 
Join Date: Apr 2009
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap 3 pg 133: The connection name 'AppConnectionString1' was not found in the ap

Hello All,

I just got the following error whilst doing the example on pg 133

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

The information I have suggests that some code should be entered into the web.config file but instinct says that it is not referencing the Northwind database.

Any help would be excellent.

Cheers

Thomas
 
Old December 1st, 2009, 04:48 AM
Friend of Wrox
 
Join Date: Nov 2009
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Default

you can define your own ConnectionString. for example you can define a class to present your general variables:
Code:
public class MyVariables
{
  public const string ConnectionString = "Data Source=<your server>; Initial Catalog=<your database name>";
}
and then use:

Code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
SelectCommand="SELECT [CompanyName] FROM [Customers]"
ConnectionString="<%=MyVariables.ConnectionString %>">
</asp:SqlDataSource>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 15 pg 532 tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 10 April 2nd, 2010 03:37 PM
Chap 1 pg 48 OpenStream not referencing tomche BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 3 September 22nd, 2009 11:58 AM
Chap 15 pg 535: SMTP error (requires secure connection, authentication and ssl) tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 July 19th, 2009 04:10 AM
return *this - Chap 8 pg 418 proslambano BOOK: Ivor Horton's Beginning Visual C++ 2005 0 March 10th, 2007 01:19 PM





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