PC Review


Reply
Thread Tools Rate Thread

Class With No Namespace

 
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      6th Oct 2007
If a namespace isn't supplied, which namespace does a class belong to?
Is it a nameless global namespace or System?

Thanks

 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      7th Oct 2007

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.......



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If a namespace isn't supplied, which namespace does a class belong to?
> Is it a nameless global namespace or System?
>
> Thanks
>



 
Reply With Quote
 
rn5a@rediffmail.com
Guest
Posts: n/a
 
      7th Oct 2007
On Oct 7, 11:38 am, "sloan" <sl...@ipass.net> wrote:
> 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.......
>
> <r...@rediffmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > If a namespace isn't supplied, which namespace does a class belong to?
> > Is it a nameless global namespace or System?

>
> > Thanks- Hide quoted text -

>
> - 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

 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      7th Oct 2007
> Under the project properties, there is a default namespace.
>
> In Vb.net, you'll get this default namespace.
>




<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Oct 7, 11:38 am, "sloan" <sl...@ipass.net> wrote:
>> 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.......
>>
>> <r...@rediffmail.com> wrote in message
>>
>> news:(E-Mail Removed)...
>>
>>
>>
>> > If a namespace isn't supplied, which namespace does a class belong to?
>> > Is it a nameless global namespace or System?

>>
>> > Thanks- Hide quoted text -

>>
>> - 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The type or namespace name 'Generic' does not exist in the class or namespace 'System.Collections' pantagruel Microsoft C# .NET 1 23rd Oct 2007 12:07 AM
A class and namespace has same name, but still must fully qualify the class??? Jack Microsoft VB .NET 8 14th Jul 2007 11:56 PM
The type or namespace 'Installer' does not exist in the class or namespace 'System.Configuration' John Chrisman Microsoft C# .NET 2 18th Nov 2005 11:24 PM
The type or namespace name 'blah' does not exist in the class or namespace 'abc.def' WineNCheese Microsoft Dot NET Framework 3 22nd Apr 2005 12:47 AM
The type or namespace name 'Windows' does not exist in the class or namespace 'System' (are you missing an assembly reference?) =?Utf-8?B?UmF5?= Microsoft Dot NET 1 7th Apr 2004 10:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:20 AM.