Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Namespace not found
Message
De
18/08/2005 19:13:51
 
 
À
18/08/2005 19:11:56
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01042013
Message ID:
01042122
Vues:
20
>Oh thanks!!!! My first answer for .net, yet you have to take the glory. I suppose you spent several minutes contemplating...Hmmmm...how can I top Perry's answer.

Uh oh ... you're on to me. How'd you know I was so devious? <g>

~~Bonnie


>
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform