Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 9th, 2009, 11:25 AM
Registered User
 
Join Date: Aug 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Need help about DbHelper class.

In method GetHRPaidTimeOffConnectionString(),

I can't use ConfigurationManager class to get connection string in web.config because it doesn't appear in ItelliSense.

When I copy DBHelper.cs file in source code of this book to Framework folder and press Ctrl + F5 to run project,

one error come up:

"The name 'ConfigurationManager' does not exist in the current context."

I think ConfigurationManager class can be accessed in PaidTimeOffUI not DAL layer, right?

What can I do to slove this problem?

Here is DBHelper class:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace V2.PaidTimeOffDAL.Framework
{
    public class DBHelper
    {
        private const string HRPAIDTIMEOFF_CONNSTRING_KEY = "HRPaidTimeOffConnString";

        public static string GetHRPaidTimeOffConnectionString()
        {
            return ConfigurationManager.ConnectionString[HRPAIDTIMEOFF_CONNSTRING_KEY].ConnectionString;
        }
    }
}
  #2 (permalink)  
Old August 10th, 2009, 04:56 AM
Authorized User
 
Join Date: Mar 2008
Location: New York, NY, USA.
Posts: 62
Thanks: 1
Thanked 3 Times in 3 Posts
Send a message via Yahoo to kalel_4444
Default

You need to add a reference to System.Configuration to the V2.PaidTimeOffDAL.

Right Click the V2.PaidTimeOffDAL project, Select Add Reference, under .NET tab add System.Configuration.

the using should now be recognized.

Ronnie
The Following User Says Thank You to kalel_4444 For This Useful Post:
DungPT (August 10th, 2009)
  #3 (permalink)  
Old August 10th, 2009, 05:56 AM
Registered User
 
Join Date: Aug 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default That worked!

Hi Ronnie,

Thank for kindly reply, that is the stupid error!

It works perfectly now.

Thanks again.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using logging class as a static class punitw General .NET 0 August 14th, 2008 03:03 AM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Regarding Class Library (.dll) from class file manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 3rd, 2006 07:32 AM
Class disappears in the class panel hint2310 Visual C++ 0 September 18th, 2004 03:46 PM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM



All times are GMT -4. The time now is 05:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.