Ok,so that means even if refer to the name spaces in multiple project also the DLL gets loaded only once.
For example referring to the Microsoft.Practices.EnterpriseLibrary.Data in business layer and data access layer will ensure that DLL having the namespace is loaded only once through out the entire program execution.
so that means even if refer to the name spaces in multiple project also the DLL gets loaded only once.
This has nothing to do with the using statement, or with the number of projects that it is used in. A DLL is a code library that is used by an executable program, and is loaded into memory when some code in the executable makes a call to one of its methods. Having a using statement in your source code merely allows the compiler to satisfy references to methods or classes that are not defined within any of the source modules of the project. However, if no direct references are made from the program that contains the using statement, then the associated DLL will not be loaded.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
It doesn't "do" anything, it simply instructs the compiler where to look (in referenced DLL's or in .NET language, "assemblies"). They aren't evaluated during runtime at all, it's only used in the preprocessor during the linking phase of the compilation process.
Like the other poster said, if you don't use the "using" statement, you have to explicitly identify where to find certain functions in the included assemblies. It essentially just saves a lot of typing as stated.
Oddly enough, the "using" statement can also be used to re-assign namespaces and class names. You can use it to "alias" namespaces.
Another "using" keyword is to limit the scope of a variable and do automatic clean-up, like:
using (SolidBrush sb = new SolidBrush(Color.Red))
//Use the solid brush here
//Here the solid brush no longer exists, and the object is correctly disposed.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
I am interested in the most efficient way to store values from an object array containing dates, string, double, integer, Boolean, and null values. The values will then be restored back to the array by reading the file at a later date.
BinaryFormatter is very slow and inefficient and looking for another solution.
When I want to write out data quickly and efficiently I tend to implement the ISerializable interface directly on the classes I want to serialise and manage the writing out myself. The reason the BinaryFormatter is so slow is because it's using reflection to work out what to serialize. By specifying this yourself you save the formatter from having to do this which results in a much faster implementation.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
I need to pass an array from C#.net application to oracle stored procedure. Can anyone please let me know how to go about it? Also, which OracleType type do I use in C# when passing input parameter to stored procedure?
FYI, am using System.Data.Common.DbConnection in my C#.
Asking the same question again as you asked yesterday isn't going to get you an answer any faster. People answer the questions on a volunteer only basis, so it's rude to attempt to bump your post like this.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
Hey guys, Here are the complete results from a poll published by Pluralsight last week, asking their users which ORM tool for .NET they think is the best. Although the results are somewhat predictable, it's interesting to take a look at the picture.
Do you use any ORM tool and if so, which one do you prefer? What are the most important features of an Object-Relational Mapper for you?
I prefer Entity Framework despite the fact that I have used LINQ to SQL a lot. I prefer Entity because of it's advantages over LINQ. I prefer Microsoft based framework rather than third party frameworks.
If you need fast lookup based on the key value, a Dictionary is highly recommended. It is fast, however it does not preserve order.
If order is most relevant to you, you might opt for a List of KeyValuePair objects. However I can't easily imagine a situation where I would. Alternatively, you could go for a Dictionary plus a List that holds the keys in the order you want them. I do this occasionally.
I'll chime in with the rest - SortedDictionary. I've used it extensively in VS 2008 projects for just this purpose, where I wanted key lookup of values but also wanted to iterate through the list in key order.
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
Je veux créé un "Web Browser" c'est a dir un navigateur intenet en VB (Visual Basic) qui ne serais pas basé sur le Controle Actve X de Intenet Explorer (IE) mais sur celui que je vais créé. Alors je vous demande comment le créé (Mon webrowser control)?
I created a "Web Browser" is a dir intenet browser in VB (Visual Basic) that would not be based on the Control Actve X of Intenet Explorer (IE) but the one I will created. So I ask you how created (my webrowser control)?
The answers given by Abhinav and Dave Kreskowiak are absolutely correct.
I want to add that
.NET 1 and 1.1 are now obsolete.
Even though Visual Studio 2008 and above provide multi targeting feature, there is no support for .NET 1 and .NET 1.1.
The size of .NET 2 is less, around 22.5 MB. With the introduction of generics and other improvements in .NET 2, I think, if there is a concern about the size of deployment, .NET 2 can still be used, if there is no specific requirement for new features available in the later versions.
For some features like, extension methods and LINQ to objects there are certain work arounds to use them in .NET 2 also.
I am developing an application called mysql query browser in C#.net. I have to mention hardware and software requirements in my SRS.But I dont know how to know what are these and what is the reason behind this....so plz tell me....I am using .net 3.5..thanks...