Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Special Edition by Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muhammad, Srinivasa Sivakumar; ISBN: 9780470041789
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-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
  #1 (permalink)  
Old May 24th, 2006, 09:29 AM
Registered User
 
Join Date: May 2006
Location: Weybridge, Surrey, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stupid Problem with Example

I'm confused by example 12.2 in the book - precisely in how to set a ConnectionString for a SQLConnection.

In my example, I have a connection string called "db1Dev" held in my web.config file.

I want to apply it (or, depending on the conditions, an alternative) at run time, to a SQLConnection object.

I can't find any ConfigurationManager anywhere which will allow me to go

    .ConnectionStrings("db1Dev").ConnectionString

.ConnectionStrings, I'm told, cannot be converted to a String, and does not have a property .ConnectionString.

What am I doing wrong?

And a subsidiary question in the same area.

Do I have to use SQLConnection for a password-protected Access database, just as I have to with the DataSources?

Alan
  #2 (permalink)  
Old May 31st, 2006, 08:55 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check out this link. Use WebConfigurationManager.

http://msdn2.microsoft.com/en-us/library/ms151430.aspx


paul




Similar Threads
Thread Thread Starter Forum Replies Last Post
really stupid problem with anchor tags thenoseknows ASP.NET 2.0 Basics 3 August 31st, 2006 09:34 AM
Stupid problem tsimsha Pro VB 6 2 December 16th, 2004 12:45 PM
stupid question j_pres44 Beginning PHP 4 December 13th, 2004 05:06 AM
Stupid Problem... on comparing variables! Varg_88 Classic ASP Basics 1 December 11th, 2004 06:00 PM





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