473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How To Use Nested Namespace [Help]

Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help
Nov 20 '05 #1
14 3282
By default, your project name becomes the "root namespace" of your assembly.
If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering
to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or
you change in project properties) and Foo is in the namespace:

RootNamespace.A.B.C.Foo

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #2
By default, your project name becomes the "root namespace" of your assembly.
If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering
to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or
you change in project properties) and Foo is in the namespace:

RootNamespace.A.B.C.Foo

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #3
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C.Foo
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #4
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C.Foo
"Tiraman" <ti*****@netvision.net.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #5
"Martin Robins" <martin - robins @ ntlworld dot com> schrieb
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C.Foo


Not in VB.NET. ;-)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
"Martin Robins" <martin - robins @ ntlworld dot com> schrieb
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C.Foo


Not in VB.NET. ;-)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to use a nested
namespace.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may take a look at the two links below.
Namespace Naming Guidelines
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpconnamespacenamingguidelines.asp

Namespace Statement
http://msdn.microsoft.com/library/de...us/vblr7/html/
vastmnamespace.asp

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #8
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to use a nested
namespace.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may take a look at the two links below.
Namespace Naming Guidelines
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpconnamespacenamingguidelines.asp

Namespace Statement
http://msdn.microsoft.com/library/de...us/vblr7/html/
vastmnamespace.asp

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #9
Ok ,

I found where I can change the Root Namespace which is good but let me
describe you what I want to do .

lets say that I have a company name Comp and we have 3 Departments (A,B,C)

now each department working on some namespace and on its class's and I want
to make one namespace

that will include them all (not the code !!! just the call or the import to
those namespace's ) and if we will open a new department tomorrow

I want the ability to add a call or include or import to the new department
(namespace) into the root namespace

so every one that use this root namespace will be able to use other public
functions .

10x
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u6**************@TK2MSFTNGP09.phx.gbl...
By default, your project name becomes the "root namespace" of your assembly. If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or you change in project properties) and Foo is in the namespace:

RootNamespace.A.B.C.Foo

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like
Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help


Nov 20 '05 #10
Ok ,

I found where I can change the Root Namespace which is good but let me
describe you what I want to do .

lets say that I have a company name Comp and we have 3 Departments (A,B,C)

now each department working on some namespace and on its class's and I want
to make one namespace

that will include them all (not the code !!! just the call or the import to
those namespace's ) and if we will open a new department tomorrow

I want the ability to add a call or include or import to the new department
(namespace) into the root namespace

so every one that use this root namespace will be able to use other public
functions .

10x
"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u6**************@TK2MSFTNGP09.phx.gbl...
By default, your project name becomes the "root namespace" of your assembly. If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or you change in project properties) and Foo is in the namespace:

RootNamespace.A.B.C.Foo

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like
Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help


Nov 20 '05 #11
Hi Peter ,

your suggestion was good and the articles helped me :-)

let me ask you one more thing please ,

I created a dll name A.B.C.dll and i put that dll under c:\MyDlls\

The Dll Namespace Is A.B.C and i have a class name Test under that dll .

when i m doing this in my aspx file
Import Namespace="A.B.C"
And Than
Dim myParam As New Test

I m getting an error that my Test is not defined

But when i m moving the dll into the bin folder under my project every thing
comes in order :-)

i will be happy to know how to put all of my dll's in one place and use them
from my projects with out moving them into the bin folder .

bye and 10x for your help :-)

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:2P**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to use a nested
namespace.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may take a look at the two links below.
Namespace Naming Guidelines
http://msdn.microsoft.com/library/de...us/cpgenref/ht ml/cpconnamespacenamingguidelines.asp

Namespace Statement
http://msdn.microsoft.com/library/de...us/vblr7/html/ vastmnamespace.asp

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #12
Hi Peter ,

your suggestion was good and the articles helped me :-)

let me ask you one more thing please ,

I created a dll name A.B.C.dll and i put that dll under c:\MyDlls\

The Dll Namespace Is A.B.C and i have a class name Test under that dll .

when i m doing this in my aspx file
Import Namespace="A.B.C"
And Than
Dim myParam As New Test

I m getting an error that my Test is not defined

But when i m moving the dll into the bin folder under my project every thing
comes in order :-)

i will be happy to know how to put all of my dll's in one place and use them
from my projects with out moving them into the bin folder .

bye and 10x for your help :-)

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:2P**************@cpmsftngxa06.phx.gbl...
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to use a nested
namespace.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may take a look at the two links below.
Namespace Naming Guidelines
http://msdn.microsoft.com/library/de...us/cpgenref/ht ml/cpconnamespacenamingguidelines.asp

Namespace Statement
http://msdn.microsoft.com/library/de...us/vblr7/html/ vastmnamespace.asp

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #13
Hi Tiraman,

Thank you for your quick response.
From my understanding, the error will be orrcur in the runtime, am I right?

As I reply in another post in this newsgroup titled "Namespace Question",
this may be caused by that the Test.Dll is not in the three place the
ASP.NET application will search the assembly.
(1.GAC 2.bin 3.codebase)

You may refer to that issue for detailed information.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #14
Hi Tiraman,

Thank you for your quick response.
From my understanding, the error will be orrcur in the runtime, am I right?

As I reply in another post in this newsgroup titled "Namespace Question",
this may be caused by that the Test.Dll is not in the three place the
ASP.NET application will search the assembly.
(1.GAC 2.bin 3.codebase)

You may refer to that issue for detailed information.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Joshua Beall | last post by:
Hi All, I remember reading that both nested classes and namespaces would be available in PHP5. I know that namespaces got canceled (much sadness...), however, I *thought* that nested classes...
3
by: Rubén Campos | last post by:
Organizing classes, types, structures, enums and whatever other entities into nested namespaces requires to include into every header and implementation file the complete path of namespaces. Let me...
6
by: SpOiLeR | last post by:
Why doesn't following code compile? Problem line is commented in code. ---------------------- Cut here------------------------------- #include <iostream> #include <list> #include <string> ...
1
by: Sebastian Dau | last post by:
Hi there, I'm trying to design a form with the help of the VS2003 C++ Forms designer. This works pretty good as long as the form is not included in a nested namespace. Example (works) ...
14
by: Tiraman | last post by:
Hi , I would like to use nested namespace . I have 3 namespace as dll's : Namespace A Namespace B Namespace C And i want to have some namespace that contain them all , some thing like
37
by: Tim N. van der Leeuw | last post by:
Hi, The following might be documented somewhere, but it hit me unexpectedly and I couldn't exactly find this in the manual either. Problem is, that I cannot use augmented assignment operators...
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
3
by: Wayne Shu | last post by:
When I read the chapter of the namespace of the book C++ Primer(3e). It explain the using directive as follow: "A using directive makes the namespace member names visible as if they were declared...
2
by: Wolfgang | last post by:
Hi, I'm trying to understand how could I inherit a nested class. Say for instance - I've four classes namely class A, class B, class C, class D. class B is nested inside class A class D is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.