Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Namespace not found
Message
From
18/08/2005 17:44:59
 
 
To
18/08/2005 12:44:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01042013
Message ID:
01042100
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
Hilmar,

As Alan and Perry both said, you need to add the reference ... that's the "required" part, the "using" isn't actually required. That's because you can instantiate classes from that namespace without using a "Using" statement. The "Using" statement makes it easier to use "short-hand" when coding.

As an example, say your main application namespace is "MyCompany" and you have "child" namespaces of MyCompany.Business, MyCompany.DataAccess, MyCompany.DataSets, etc. etc.

As long as a reference to MyCompany.DataSets has been added to your project, you can fully qualify the namespace in code without having to add a "Using" statement:
    MyCompany.DataSets.MyCustomerDataSet oData = new MyCompany.DataSets.MyCustomerDataSet();
but, by the use of a "Using" statement, you can make things a lot more readable:
using MyCompany.DataSets;

...
...

    MyCustomerDataSet oData = new MyCustomerDataSet();
~~Bonnie




>I have two projects in one solution. Files in one project use one namespace, in another project, another namespace.
>
>In one of the projects, I want to use a class from the other project. I put:
>
>
>using MySession // the namespace from the other project
>...
>
>
>and in this line, the compiler complains that the namespace can't be found. (I copied and pasted the namespace, to make sure it wasn't a spelling error.)
>
>What am I missing?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform