Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Namespace problem 2

Status
Not open for further replies.

jby1

Programmer
Apr 29, 2003
403
0
0
GB
Hi

I have the following namespaces in project:

Code:
namespace service
{
    public class ServiceClass
    {
    }
}

namespace database
{
    public class DatabaseClass
    {
    }
    namespace service
    {
        public class DatabaseServiceClass
        {
        }
    }
}

I wish to be able to access ServiceClass within DatabaseClass. However, whenever I try to access it through the service namespace, I get an error.

Is there anyway way I can access the ServiceClass from DatabaseClass???

Thank you for any help!
 
If you put this
using ServiceClass = service.ServiceClass;
at the top of your program, you can then say
ServiceClass sc = new ServiceClass()
inside of DatabaseClass.
 
Excellent! Thank you v much for that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top