adonet,
You need to import only the namespaces that you will need in your application. Importing more than needed simply hurts application performace. The one namespace you will need for all your apps is System. Asides from that, the namespaces you will import will depend on the kind of application you'll be building. For example, for database applications, you will need the types in the System.Data namespace. If you'll be building a Windows Forms (GUI) application, you'll need the System.Windows.Forms namespace, and so on. Again, you should only import the namespaces that contain types you will need in your application.
If you don't know the namespace of a type you want to use, there is a very nice tool that comes with the .NET SDK that allows you to do a search on such type. The tool is called WinCV.EXE (short for Windows Class Viewer) and its found in the "C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin" folder.
Hope this helps!
JC
Friends are angels who lift us to our feet when our wings have trouble remembering how to fly...
Is there anything in .NET to include all the subclasses inside a package instead of including each one seperately as we have in java import java.awt.*;
adonet,
I think WinCV allows you to search for methods as well, that, but I'm not sure. If not, you may try the MSDN Library which should be your best friend when starting out. If you don't have MSDN on your computer, you may use it online at
rsubras,
In .NET, you always include all the subclasses inside packages. You don't have the option to include individual types; you only have the option to include all types in a package. By type, I mean any of the following: class, structure, interface, delegate, or enumeration. Also, packages are called namespaces in the .NET world. Thus, in .NET for example, you would import the System.Data namespace, or the System.Windows.Forms namespace. Hope this helps!
JC
Friends are angels who lift us to our feet when our wings have trouble remembering how to fly...
rsubras,
Including System.Web.UI DOES include System.Web.UI.WebControls but, in order for you to use the types in the WebControls namespace, you would have to preceed them with the word WebControls, as in:
As far as I know, there isn't any way to automatically inlclude all the namespaces within a namesapce. Thus, in order for you to use the types in the WebControls namespace without preceeding them with the word WebControls, you would have to include the WebControls namespace separately, as in:
include System.Web.UI; include System.Web.UI.WebControls;
Hope this helps!
JC
Friends are angels who lift us to our feet when our wings have trouble remembering how to fly...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.