Class With No Namespace

  • Thread starter Thread starter rn5a
  • Start date Start date
R

rn5a

If a namespace isn't supplied, which namespace does a class belong to?
Is it a nameless global namespace or System?

Thanks
 
Which language are you using?

Under the project properties, there is a default namespace.

In Vb.net, you'll get this default namespace.

...

in C#? I'm not sure.

But unless you put "namespace System", you won't get that.

I don't think doing "namespace System" would be wise.......
 
Which language are you using?

Under the project properties, there is a default namespace.

In Vb.net, you'll get this default namespace.

..

in C#? I'm not sure.

But unless you put "namespace System", you won't get that.

I don't think doing "namespace System" would be wise.......







- Show quoted text -

Sloan, suppose I am the following code in a class (.vb) file:

Imports System
Imports System.Data
Imports System.Data.SqlClient

Public Class DBSettings
Public sqlCmd As SqlCommand
Public sqlConn As SqlConnection
Private ConnectionString As String

Public Function QueryDB(ByVal qry As String) As SqlDataReader
sqlConn = New SqlConnection(ConnString)
sqlCmd = New SqlCommand(qry, sqlConn)

sqlConn.Open()
Return sqlCmd.ExecuteReader
sqlConn.Close()
End Function
End Class

Now which namespace will the above class belong to? I use Visual Web
Developer 2005 (& not VS.NET) to create & edit ASP.NET applications
(using VB.NET & not C#).

Thanks,

Ron
 
Back
Top