|
|

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

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

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

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