i want to know that if we are giving a namespace in C# what will be the impact
what will be the impact of what? a performance hit on the program?
pretty much none... you can consider namespaces containers for classes, which don't actually exist in memory in the current program unless you are specifcally "using" that namespace. and in any case, the impact of anything in C# really isn't that bad since C#'s garbage collector is doing all the work for you.
Namespaces just allow you to manage your code better.
Namespace declarations do not impact the resulting application.
They are used by the pre compiler to locate code addressing during the compile phase. You could preface every object and type in your source code with its namespace, and all you are doing is beating up yourself.
The c# compiler examines each object and type in your source code as it compiles. It searches the namespaces you have declared. IOW, declaring the Namespace's at the top of the code allows you to write code without prepending the correct namespace for each and every object and type.
If you need lets say the name of the PC, and did not add System.Net in your uses section, then doing it this way:
string MyPCname = System.Net.Dns.GetHostName();
would do the same thing as adding System.Net to the using section and just write string MyPCname = Dns.GetHostName(). Just because you add System.Net to the using section does not mean that every method in that name space is included in your compiled application. In either case, the compiler either searched your using section, or used your direct implementation to find the address of Dns.GetHostName().
Using the direct call (inluding the namespace) just saved the pre compiler a search step.... Not you. The resulting application performance is not affected using either method of declaration.
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Private Sub btn_addline_Click(ByVal ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...