Welcome Guest Search | Active Topics | Members | Log In | Register

Class With No Namespace Options · View
rn5a@rediffmail.com
Posted: Friday, October 05, 2007 2:12:41 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 05/10/2007 14:12:41
Date: Fri, 05 Oct 2007 21:12:41 -0700

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

Thanks

rn5a@rediffmail.com
Posted: Sunday, October 07, 2007 8:36:39 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 07/10/2007 08:36:39
Date: Sun, 07 Oct 2007 15:36:39 -0700

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:1191643961.002580.119360@50g2000hsm.googlegroups.com...
>
>
>
> > 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

sloan
Posted: Sunday, October 07, 2007 8:38:07 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 07/10/2007 08:38:07
Date: Sun, 7 Oct 2007 12:38:07 -0400


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



<rn5a@rediffmail.com> wrote in message
news:1191643961.002580.119360@50g2000hsm.googlegroups.com...
> If a namespace isn't supplied, which namespace does a class belong to?
> Is it a nameless global namespace or System?
>
> Thanks
>


sloan
Posted: Sunday, October 07, 2007 2:41:16 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 07/10/2007 14:41:16
Date: Sun, 7 Oct 2007 18:41:16 -0400

> Under the project properties, there is a default namespace.
>
> In Vb.net, you'll get this default namespace.
>



<rn5a@rediffmail.com> wrote in message
news:1191796599.003683.135970@r29g2000hsg.googlegroups.com...
> 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:1191643961.002580.119360@50g2000hsm.googlegroups.com...
>>
>>
>>
>> > 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
>


Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.055 seconds.