473,385 Members | 1,707 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,385 software developers and data experts.

Is there any difference about namespace between VB.NET and C#.

ad
Is there any difference about namespace between VB.NET and C#.

All functions in c# must include in a namespace.

Why I can't find namespace in the files .vb .

How VB.NET implement the concept of namespace
Nov 16 '05 #1
4 2437
I believe there is a "global" or "default" namespace in the CRL. I might be
wrong, but I think VB.NET allows classes to be part of this default
namespace while c# requires all classes to be part of a namespace.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:#U**************@TK2MSFTNGP12.phx.gbl...
Is there any difference about namespace between VB.NET and C#.

All functions in c# must include in a namespace.

Why I can't find namespace in the files .vb .

How VB.NET implement the concept of namespace

Nov 16 '05 #2

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:e6*************@TK2MSFTNGP10.phx.gbl...
I believe there is a "global" or "default" namespace in the CRL. I might
be
wrong, but I think VB.NET allows classes to be part of this default
namespace while c# requires all classes to be part of a namespace.


C# does not require anything be contained in a namespace, the default file
just happens to provide one.
Nov 16 '05 #3

Also, VB.NET provides a default namespace for the project and this
becomes prepended to the namespace to form the CLR namespace.

So, if you have a project with default namespace "Blinex.Charts" and
then a class:

Namespace Assets
Class LimitLine
End Class
End Namespace

Then the namespace in the CLR for referring to that class is
Blinex.Charts.Assets.LimitLine.

So in VB.NET even when you have no Namespace statement, classes are
still in a namespace defined by the project.

In contrast, the C# default namespace just defines the default value
put in the *.cs file. The *.cs file totally determines the actual
namespace though and it can be changed for each file.

HTH,

Sam
On Fri, 18 Mar 2005 17:29:26 -0600, "Daniel O'Connell [C# MVP]"
<onyxkirx@--NOSPAM--comcast.net> wrote:

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:e6*************@TK2MSFTNGP10.phx.gbl...
I believe there is a "global" or "default" namespace in the CRL. I might
be
wrong, but I think VB.NET allows classes to be part of this default
namespace while c# requires all classes to be part of a namespace.


C# does not require anything be contained in a namespace, the default file
just happens to provide one.


B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
Nov 16 '05 #4

"Samuel R. Neff" <bl****@newsgroup.nospam> wrote in message
news:km********************************@4ax.com...

Also, VB.NET provides a default namespace for the project and this
becomes prepended to the namespace to form the CLR namespace.

So, if you have a project with default namespace "Blinex.Charts" and
then a class:

Namespace Assets
Class LimitLine
End Class
End Namespace

Then the namespace in the CLR for referring to that class is
Blinex.Charts.Assets.LimitLine.

So in VB.NET even when you have no Namespace statement, classes are
still in a namespace defined by the project.

In contrast, the C# default namespace just defines the default value
put in the *.cs file. The *.cs file totally determines the actual
namespace though and it can be changed for each file.


I thought it was something like that, but I don't know anywhere enough about
VB to have answered. Thanks for the info.
Nov 16 '05 #5

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

Similar topics

2
by: Empire City | last post by:
Can someone tell me what is the difference in placing the using in the namespace{} and before the namespace{} ? namespace MyProj { using System; using System.Web; } using System;
4
by: SAI | last post by:
Both have "TextBox" element and "Runat server". I don't understand the difference. Please advise. Thanks.
5
by: ad | last post by:
Is there any difference about namespace between VB.NET and C#. All functions in c# must include in a namespace. Why I can't find namespace in the files .vb . How VB.NET implement the...
3
by: Xiaoshen Li | last post by:
Dear All, I saw some people using #include <string.h> some people using #include <cstring> What is the difference between the two? I can find the file string.h at /usr/include. I don't...
15
by: Youssef Mesri | last post by:
What is the difference between these two situations: 1- hold a namespace which contains justs some functions: namespace MyNamespace { void foo1(); void foo2(); void foo3(); void foo4();
1
by: Shadow Lynx | last post by:
If this is not the most appropriate group for this question, please let me know. I noticed an odd priority difference in resolving names in VS 2005 (VWD Express) vs. the .NET 2.0 compiler (the...
12
by: Keith Patrick | last post by:
Can someone tell me the difference in terms of actual implications using: namespace MyNamespace { using System; class MyClass {...} } vs. using System;
1
by: drrngrvy | last post by:
Hi all, Consider: <> namespace a { namespace nested { class a_class {}; } } namespace b { using ::a::nested::a_class; } namespace c { typedef ::a::nested::a_class a_class; }
3
by: Matt | last post by:
Hi everyone, can someone point out the difference between defining a class with the public access modifier and just leaving it as it is (default in vs.net "class") I think that the default...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.