Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 November 15th, 2005, 08:54 AM
Authorized User
 
Join Date: Mar 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with namespaces (I think)

I need some help in accessing a class in another project.
I have a C# class whose physical location is: Project\Modules\Basket\Shoppingcart.cs

The namespace for Shoppingcart.cs is:
namespace Project.WebModules.Basket

I am accessing ShoppingCart.cs in another class (Orders.cs) whose namespace is:

namespace Project.WebModules.Orders.Business

However, when I try to compile the solution, I get error:
"... The type or namespace name 'Shoppingcart' does not exist in the class or namespace 'Project.WebModules.Basket' (are you missing an assembly reference?)"

However, I am able to use the Shoppingcart class in web forms whose namespaces are: namespace Project.WebModules.Orders.Web

So how can I use the Shoppoingcart class inside classes whose namespace are: Project.WebModules.Orders.Business

regards




 
Old November 16th, 2005, 09:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Put a reference on the DLL that defines the namespace, and add a using statement.

A beginners book on ASP.NET would help you a lot. The book "ASP.NET Website Programming Prob-Design-Solution" is not right for you at this time.
 
Old November 16th, 2005, 12:23 PM
Authorized User
 
Join Date: Mar 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Englere, your scarcastic remarks always put a smile on my face. I know there have been 2 recent posts regarding namespace and for them teh solution was to leave this book and choose something simpler.

But I have been working with this code for a long time now.regards

Anyway, I have already tried to use:
"using Viamed.WebModules.Basket;" inside Orders.cs class...but this does not solve the problem.

regards

 
Old November 19th, 2005, 02:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I recently posted several bits of advice regarding what you should study in order to understand how to change the namespace of an existing project. If you take my advice as being sarcasm you'll get no benefit from it. If you take it as sincere advice to help you focus your studies to learn the underlying issues you can come away with more than you thought you could.

If you only care about namespaces you can search for my comments here around a year ago. I went into it in some detail, but my mistake was in assuming that people understood assemblies, metadata, references, and deployment. Because of my mistake, the people who asked about namespaces were not able to make use of my comments. They did understand my words and my analogies, but they didn't have a good fundamental knowledge of .NET.

To be fair, most beginner books do not cover these subjects adequately, so you need to select the books and websites that do.

The book covered in this message forum is aimed aquarely a middle-level developers and there is no attempt to cover the subjects mentioned above. The book would be well over 1000 pages if it attempted to cover all that.

Sometimes you need a strong foundation upon which to build a house. You should not start building merely because you have a hammer and some nails.

I'm sorry if I offended you, but I give the same advice to co-workers, local user groups, and even to my own son who is now learning programming.

If you put some effort into learning the underlying concepts you can ask specific questions about those areas if you need help. Once you understand these things, you can easily change the namespaces, but more importantly, you'll also be able to do a lot more than that!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Namespaces Amateur BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 27th, 2006 05:19 PM
Problems with namespaces & classes ayamas General .NET 1 October 12th, 2006 03:11 PM
namespaces anchal C# 1 July 3rd, 2006 02:53 PM
XML Namespaces billy_bob_the_3rd XML 1 January 31st, 2005 03:41 PM
NAMESPACES - WHAT ARE THEY? p_nut33 C# 2 July 31st, 2003 03:18 AM





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