it is a namespace but is used like a type
I have two projects and refering one to another. To say project DEntity is refering in Project DService. and among the namespaces am using iam refering this particular project too.
When i trying to call the DEntityproject's one of the file's class, its nt happening.
Code:
DEntity.Helper.Opensession() is a namespace but is used like a type
the line of code is this
Code:
DEntity.Helper.Opensession();
Thanks in advance
Re: it is a namespace but is used like a type
Hey,
Is Opensession defined as a method on the Helper Class which lives within the DEntity namespace?
If so, is this method a static method? Do you first have to create an instance of the Helper class before you can access the methods of the class?
Gary
Re: it is a namespace but is used like a type
Opensession defind as a method which lives in helper class.
it is a static method.
Re: it is a namespace but is used like a type
Is it possible for you to post the class that you are using?
Re: it is a namespace but is used like a type
This is the class am creating
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using DzineRepository;
using DRepository;
using DEntity;
namespace UserMaintenanceServices
{
public class UserMaintenanceServices
{
Helper.OpenSession();
}
}
Re: it is a namespace but is used like a type
It's not a namespace and it's not used like a type. DEntity is the namespace, Helper is the type, OpenSession is a method and it's used like a method. That's just like using System.Windows.Forms.MessageBox.Show(). System.Windows.Forms is the namespace, MessageBox is the type and Show is the method.
Re: it is a namespace but is used like a type
so, can we call this method by a single line if the method is defined as public?