Wrox Programmer Forums
|
BOOK: Beginning ASP.NET Databases Also see the forum ASP Databases for more general discussions of ASP database issues not directly related to these books.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Databases 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 December 22nd, 2003, 07:38 PM
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default question about "A better connection string"

RE: A better connection string", Chapter 3, pg. 91 and 92:

I used this in a project and Configuation.Setting was underlined in blue. I was able to make it work by adding -
 "Imports System.Configuration" to the .vb file. My question is why was this neccesary and is this the proper way to deal with this?

Thanks,
Vince

 
Old December 23rd, 2003, 04:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, that is correct. ConfigurationSettings lives in the System.Configuarion Namespace. To tell the compiler where it should look for the ConfigurationSettings class, you need to import the correct namespace.

Another way to do this, is to use the full name of the class. For example:

System.Configuration.ConfigurationSettings.AppSett ings.Get("MyDefaultDatabase")

This would get the value of the key MyDefaultDatabase from the config file.

Either the authors of the book forgot the Imports statement, or they have imported this namespace by default on the Property Pages of the VB project.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 12th, 2004, 12:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The System.Configuration is automatically available by default and you do not need to import it.

 
Old January 12th, 2004, 12:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hmmm true. Didn't know that.

Makes you wonder what went wrong in the situation of the OP.

Vince, what kind of project did you use the code in? A Web Project or a Class Library?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 12th, 2004, 02:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can the JIT compiler create the dll needed to run a web app?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection string bex BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 August 3rd, 2008 02:16 PM
connection string nalla ASP.NET 1.0 and 1.1 Professional 2 January 23rd, 2006 04:03 AM
Connection String phungleon Classic ASP Basics 1 March 18th, 2005 05:51 AM
connection string question -Dman100- SQL Server ASP 7 August 17th, 2004 04:10 PM
Connection string tlamazares SQL Server ASP 1 March 29th, 2004 05:16 PM





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