<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1964911433259655792</id><updated>2024-10-05T02:59:05.011+01:00</updated><category term="C#"/><category term="General .NET"/><title type='text'>.NET In A Glance</title><subtitle type='html'>All what you need when you need!&#xa;Every thing about the .NET Framework, C#, ASP.NET, LINQ, SQL And Windows Developemnt.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1964911433259655792.post-2939866442594957289</id><published>2011-03-29T14:55:00.001+01:00</published><updated>2011-03-29T14:58:54.954+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Control class’ access: Access Modifiers and Proprieties</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp; If you are hosting a party in your house, how many people can access your house? Only the ones you invite, and how many people will be allowed to go to the second floor? Only you and your family!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; The same thing exist in development world, some times we just don’t want others to access our methods, so we protect them with an Access Modifier.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; It exist 3 type of access modifiers: &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Public: The type or member can be accessed by any other code in the same assembly or another assembly that references it.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Protected: The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Private: The type or member can be accessed only by code in the same class or struct.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Internal : The type or member can be accessed by any code in the same assembly, but not from another assembly.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; Let’s see how we implements them:&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; // public class: &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;public class Car { &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;// protected method: &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;protected void Run(){ } &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;// private field: private&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; int wheels = 4;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; // protected internal property: &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;protected internal int Wheels { get { return wheels; } } } &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; No, any other type can create an instant of our Car, but only types deriving from the Car or the Car it self can start the engine. Our Wheels variable is private, no one can access it except the Car itself so we prevent the others from modifying it’s value, for example any one can change it to 10 or 20 and it won’t be a valid car! But what if we want to see how many wheels does our classes? We simply create a Property field that is read-only.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Properties are pretty easy to use, you just declare like a variable but you define a Get and Set methods for it (or just one, that depends on the scenario) , the getter will return the value of the variable we want, and the setter will set it’s value!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; private int energy=100;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; public int Energy {get{return energy;} &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;set{if(value=&amp;lt;100){energy=value}}};&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Now we have an energy field, that can’t be more than 100, what we did, we wrote a property that will check if the value is less or equal to 100 it will change the energy variable, otherwise nothing happens. (we used an If clause, we will explain it in an other tutorial).&lt;/em&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/2939866442594957289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/control-class-access-access-modifiers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/2939866442594957289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/2939866442594957289'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/control-class-access-access-modifiers.html' title='Control class’ access: Access Modifiers and Proprieties'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1964911433259655792.post-5371796438124514819</id><published>2011-03-29T14:35:00.001+01:00</published><updated>2011-03-29T14:59:14.340+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Understanding the OOP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp; In our first application, you saw that we introduced Classes and Constructors, now this is a part of the Object-Oriented Programming where we program using Objects, that’s makes it easy for us to code and add a better business logic to your application, C# is a OOP compliant language, and supports it very well.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OOP is a programming paradigm using &quot;objects&quot; – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept such as a customer, an order, or a car.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;strong&gt;Fundamental concepts and features:&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; Class:&lt;/strong&gt; A class is a template for an object, a user-defined data type that contains variables, properties of an object. A class defines abstract characteristics of a thing (object), including its characteristics (its &lt;b&gt;attributes&lt;/b&gt;, &lt;b&gt;fields&lt;/b&gt; or &lt;b&gt;properties&lt;/b&gt;) and the &lt;b&gt;things it can do&lt;/b&gt; (behaviors, &lt;b&gt;methods&lt;/b&gt;, &lt;b&gt;operations&lt;/b&gt; or &lt;b&gt;features&lt;/b&gt;). One might say that a class is a blueprint or factory that describes the nature of something. For example, the class &lt;code&gt;Dog&lt;/code&gt; would consist of traits shared by all dogs, such as breed and fur color (characteristics), and the ability to bark and sit (behaviors). Classes provide modularity and structure in an object-oriented computer program. A class should typically be recognizable to a non-programmer familiar with the problem domain, meaning that the characteristics of the class should make sense in context. Also, the code for a class should be relatively self-contained (generally using &lt;b&gt;encapsulation&lt;/b&gt;). Collectively, the properties and methods defined by a class are called &lt;b&gt;members&lt;/b&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;h5&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp; Instance: &lt;span style=&quot;font-weight: normal;&quot;&gt;One can have an instance of a class; the instance is the actual object created at run-time. In programmer vernacular, the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Lassie&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; object is an instance of the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Dog&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; class. The set of values of the attributes of a particular object is called its &lt;/span&gt;&lt;/em&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/State_(computer_science)&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;em&gt;state&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;em&gt;. The object consists of state and the behavior that&#39;s defined in the object&#39;s classes.&lt;/em&gt;&lt;/span&gt;&lt;/h5&gt;&lt;h5&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp; Method: &lt;span style=&quot;font-weight: normal;&quot;&gt;A method is a set of procedural statements for achieving the desired result. It performs different kinds of operations on different data types. In a programming language, methods (sometimes referred to as &quot;functions&quot;) are verbs. &lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Lassie&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;, being a &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Dog&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;, has the ability to bark. So &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;bark()&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; is one of &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Lassie&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&#39;s methods. She may have other methods as well, for example &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;sit()&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; or &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;eat()&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; or &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;walk()&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; or &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;save(Timmy)&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;. Within the program, using a method usually affects only one particular object; all &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Dog&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;s can bark, but you need only one particular dog to do the barking.&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/h5&gt;&lt;em&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; Abstraction:&lt;/strong&gt; Abstraction means grouping the common behaviors. Abstraction refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;Encapsulation: &lt;/strong&gt;Encapsulation conceals the functional details of a class from objects that send messages to it. For example, the &lt;code&gt;Dog&lt;/code&gt; class has a &lt;code&gt;bark()&lt;/code&gt; method variable, data. The code for the &lt;code&gt;bark()&lt;/code&gt; method defines exactly how a bark happens (e.g., by &lt;code&gt;inhale()&lt;/code&gt; and then &lt;code&gt;exhale()&lt;/code&gt;, at a particular pitch and volume). Timmy, &lt;code&gt;Lassie&lt;/code&gt;&#39;s friend, however, does not need to know exactly how she barks. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface — those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in the future, thereby allowing those changes to be made more easily, that is, without changes to clients. For example, an interface can ensure that puppies can only be added to an object of the class &lt;code&gt;Dog&lt;/code&gt; by code in that class. Members are often specified as &lt;b&gt;public&lt;/b&gt;, &lt;b&gt;protected&lt;/b&gt; or &lt;b&gt;private&lt;/b&gt;, determining whether they are available to all classes, sub-classes or only the defining class. Some languages go further: Java uses the &lt;b&gt;default&lt;/b&gt; access modifier to restrict access also to classes in the same package, C# and VB.NET reserve some members to classes in the same assembly using keywords &lt;b&gt;internal&lt;/b&gt; (C#) or &lt;b&gt;Friend&lt;/b&gt; (VB.NET). Eiffel and C++ allow one to specify which classes may access any member.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;Inheritance: &lt;/strong&gt;Inheritance allows the programmer to treat derived class members just like their parent class&#39;s members. This type of relationship is called child-Parent or is-a relationship. &quot;Subclasses&quot; are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. For example, the class &lt;code&gt;Dog&lt;/code&gt; might have sub-classes called &lt;code&gt;Collie&lt;/code&gt;, &lt;code&gt;Chihuahua&lt;/code&gt;, and &lt;code&gt;GoldenRetriever&lt;/code&gt;. In this case, &lt;code&gt;Lassie&lt;/code&gt; would be an instance of the &lt;code&gt;Collie&lt;/code&gt; subclass. Suppose the &lt;code&gt;Dog&lt;/code&gt; class defines a method called &lt;code&gt;bark()&lt;/code&gt; and a property called &lt;code&gt;furColor&lt;/code&gt;. Each of its sub-classes (&lt;code&gt;Collie&lt;/code&gt;, &lt;code&gt;Chihuahua&lt;/code&gt;, and &lt;code&gt;GoldenRetriever&lt;/code&gt;) will inherit these members, meaning that the programmer only needs to write the code for them once.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Each subclass can alter its inherited traits. For example, the &lt;code&gt;Collie&lt;/code&gt; subclass might specify that the default &lt;code&gt;furColor&lt;/code&gt; for a collie is brown-and-white. The &lt;code&gt;Chihuahua&lt;/code&gt; subclass might specify that the &lt;code&gt;bark()&lt;/code&gt; method produces a high pitch by default. Subclasses can also add new members. The &lt;code&gt;Chihuahua&lt;/code&gt; subclass could add a method called &lt;code&gt;tremble()&lt;/code&gt;. So an individual chihuahua instance would use a high-pitched &lt;code&gt;bark()&lt;/code&gt; from the &lt;code&gt;Chihuahua&lt;/code&gt; subclass, which in turn inherited the usual &lt;code&gt;bark()&lt;/code&gt; from &lt;code&gt;Dog&lt;/code&gt;. The chihuahua object would also have the &lt;code&gt;tremble()&lt;/code&gt; method, but &lt;code&gt;Lassie&lt;/code&gt; would not, because she is a &lt;code&gt;Collie&lt;/code&gt;, not a &lt;code&gt;Chihuahua&lt;/code&gt;. In fact, inheritance is an &quot;&lt;b&gt;a… is a&lt;/b&gt;&quot; relationship between classes, while instantiation is an &quot;&lt;b&gt;is a&lt;/b&gt;&quot; relationship between an object and a class: &lt;b&gt;a&lt;/b&gt; &lt;code&gt;Collie&lt;/code&gt; is a &lt;code&gt;Dog&lt;/code&gt; (&quot;a… is a&quot;), but &lt;code&gt;Lassie&lt;/code&gt; is a &lt;code&gt;Collie&lt;/code&gt; (&quot;is a&quot;). Thus, the object named &lt;code&gt;Lassie&lt;/code&gt; has the methods from both classes &lt;code&gt;Collie&lt;/code&gt; and &lt;code&gt;Dog&lt;/code&gt;.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt; (Definitions from Wikipedia)&lt;/em&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/5371796438124514819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/understanding-oop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/5371796438124514819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/5371796438124514819'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/understanding-oop.html' title='Understanding the OOP'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1964911433259655792.post-3164963333757203111</id><published>2011-03-28T15:08:00.001+01:00</published><updated>2011-03-28T15:09:57.959+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Visual Studio C# Express 2010: Your first application!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;em&gt;&amp;nbsp; To write C# applications you need an integrated development environment (IDE), there is lot of them, like Monodevelop, Charpdevolop, and Visual Studio.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; The best one is Visual Studio, it’s from Microsoft and provides full support for the .NET Framework and Microsoft Platform.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Visual Studio 2010 is the latest version, it will costs you around 549$ (more information &lt;/em&gt;&lt;a href=&quot;http://www.microsoft.com/visualstudio/en-us/&quot;&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt;&lt;em&gt;) , but Microsoft have a free edition for educational purpose, named Visual C# Express which you can &lt;/em&gt;&lt;a href=&quot;http://www.microsoft.com/express/downloads/&quot;&gt;&lt;em&gt;download&lt;/em&gt;&lt;/a&gt;&lt;em&gt; for free along with other Express products, and it’s the one we are going to use.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;u&gt;Exploring Visual C# Express 2010: Creating a simple application:&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; After you finished the download, just follow the steps on the setup screen, it’s an easy step (If you don’t know how to setup an application, so there is no need to learn development!) and we won’t discuss.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Now, open the Visual C# and let’s create a new Windows Application, click the Create Project then select Console Application, choose a name (MyFirstApp for example) and click OK.&lt;/em&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXOFeFrr2buRuNHDu1uClhSXtxMLV0UmYThoabbx4H2VvGrAn1HvIl_3nV9DcsDHk1E-ooi4c0bkksOuTktPadFevEWGz4qrjRH9mLEGM2YloqUDgJ7ZMM5EVcG6iLHVgufyvjSTXpI71x/s1600-h/3-27-2011-1-53-56-PM5.png&quot;&gt;&lt;em&gt;&lt;img alt=&quot;3-27-2011 1-53-56 PM&quot; border=&quot;0&quot; height=&quot;367&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9TXKTR6z-pSD1HMGOubii02DAm-jq5RcN4Y9trfUDps5gL6KWanaSi-IPoQyjEgbCyDEdMheGrZWIaa2I0KY6iiQs3oulS_yBJ8atINwWDLPntwMWbjQiKoB7Y6eDmhKusBGjnkQBFWAW/?imgmax=800&quot; style=&quot;background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-27-2011 1-53-56 PM&quot; width=&quot;502&quot; /&gt;&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; As you can see, the IDE has created a file for you: program.cs, There is one thing you have to understand, the C# compiler will look for a method named Main() in a file named program.cs, it’s the main method in your application that you &lt;u&gt;&lt;strong&gt;must&lt;/strong&gt;&lt;/u&gt; have in your program, otherwise, you will get an error. &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; So let’s start coding a simple “Hello World” application. In the Main() method write: Console.WriteLine(“Hello World!”);&amp;nbsp; &lt;/em&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9oo8arh9udQdgWv02ubUWwXxpfuRqYpqKKjtybFsGHh2blyXXxTXI-FMwRlzuXVjPh7rkvXL8Jlo7AaaF6oV9JtEdpikEWGFReHAo541YGHzftE5la5eiH5pM5zWBCsvOBrl-_ZQNzL4m/s1600-h/3-28-2011%202-11-30%20PM%5B10%5D.png&quot;&gt;&lt;em&gt;&lt;img alt=&quot;3-28-2011 2-11-30 PM&quot; border=&quot;0&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitazT56za8lGjehxzJ0TUG7wpDh5JaQD_9YvB7zRmYHgq7tn2PYg9LrExGcKcjQAeLE-4I2ujmlv1dZeTxrk-R4MOxVMovcKsKGyYr0Wn78-Sp002M10bts9rIyHzRS9uiud4pbThJAWSa/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-11-30 PM&quot; width=&quot;363&quot; /&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Let’s execute it and see the result, just click the green arrow or press F5.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeVU-jSe_etnIM1go0lBiyfKWMeitlVf0t2gr2kDMOKV0S6EfZRwZWsAQBTjvpgHqwNJcpMUWcO7nFoQ4MbhNPZM7AhFTW5V-0hpeBYr8u1EFdJ9uYNwiVKihZbh2kz4rg0RbIBLETqZui/s1600-h/3-28-2011%202-15-29%20PM%5B4%5D.png&quot;&gt;&lt;em&gt;&lt;img alt=&quot;3-28-2011 2-15-29 PM&quot; border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQSH0KInBUsJdafu2HdB2EIgNBp_vyNnpcr9xtbaaOSRiITS_lI57eqI9tUfe0Dk5XszbXECJB9BVl5bP03KQSdAQfyzJ35mTADlkR0J5CdFPdeEOk96Vsaqy6rcnHFayZVighlhL3-F5a/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-15-29 PM&quot; width=&quot;459&quot; /&gt;&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;
&lt;em&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Funny no? You just wrote an application!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Now let’s understand what we did, first we asked a pretty lady named Console for a service that she can do for us, we asked her to write something for us in the screen, so she said “ok,give me the sentence” and we gave her Hello World.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; The pretty lady is a class, shown in sky blue color, we asked her to do us the service by calling an existing method that she exposes called WriteLine,and we told her about our sentence by passing it via &lt;strong&gt;parameters&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&amp;nbsp; &lt;/strong&gt;So, you might ask: “Cool, can I create a pretty lady that can calculate numbers?” sure! do want to see a demo? so let’s create a new class file named: Calculator.cs.&lt;/em&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjYWTQ_gQZ_pMWl55yPM44xFTMtl_B7FKOZw2_bAgu0SrE7672NxzwfFsZOIcVQVASqYGcEO_BTIlAea9R94Dw0NiwXc4uF77N3VArp-WVOHyPl0fPmDxximAA5QjHvpodkvvHnB76IQaP/s1600-h/3-28-2011%202-22-42%20PM%5B5%5D.png&quot;&gt;&lt;img alt=&quot;3-28-2011 2-22-42 PM&quot; border=&quot;0&quot; height=&quot;474&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwuGmICGNQTrmF-cIpLijDu3LYcd5vvCr4mCPGNCkqyo6DMfcGjugQiyuBAZx4grryxj0DLv48Gf0DsMRLlUr0nLaJrOgMDo7_4NiGHkZUjkEqXC6mw_nOABsf8L23Lv2t-G662T92EzLQ/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-22-42 PM&quot; width=&quot;493&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Now you have a new &lt;strong&gt;file &lt;/strong&gt;which can contains classes, Visual C# has created for us one class named: MyCalculator,but you can create as much as you want in one single file!&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Ok, until now, our class stands for nothing, so let’s make it useful and add some code; First, declare a method named Add, that accept two parameters and return a variable of type &lt;strong&gt;int &lt;/strong&gt;(integer).&lt;br /&gt;
public int Add(int n1, int n2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int result = n1 + n2;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMemMNti-Hb3TddzdZZkwwltXVmXS0-gXwGTENq-xiaKA5G4koUJvtKBsw2uByUI5kbnqnADfGeTFbyFH1JU88GIR3q5IzmkDBrEkzRBNX0PXl_l7EfHQj66hhQzzzD8BKcdoJN00OS2df/s1600-h/3-28-2011%202-31-45%20PM%5B4%5D.png&quot;&gt;&lt;img alt=&quot;3-28-2011 2-31-45 PM&quot; border=&quot;0&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY5ROg2N05_-wQu90RUL8_7OVLz1wU_DAj1y35sjzJGqW-LgKp_eflKLTFnCToOyyJIITWRfMmrmeZZ6XPPpZ9y6sQHstIugVI-5ivNI4kddV41koPJLGVmiZ21kpgF9KyG9RVobxu7FmC/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-31-45 PM&quot; width=&quot;490&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; Now, we have our genius lady that can calculate! Let’s ask here for a service!&lt;br /&gt;
&amp;nbsp; Go back to our first file program.cs and add the following code in the Main method: &lt;br /&gt;
MyCalculator MyGeniusLady = new MyCalculator();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int result = MyGeniusLady.Add(5, 6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(&quot;5 + 6 = &quot; + result);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.ReadKey();&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja9hI3lqyLxFs9BYC5dRrjxbXW_BvdwDFhnQedvuWz70-8ePmsSLH8bC4isG3vW56tq7cyI1akFf33S1cHGMQrOIczMO8f-UuolHytjI1O_tVCESYYrXvMb32ROIjVVa3SE_pz5Ytvkv2-/s1600-h/3-28-2011%202-36-41%20PM%5B4%5D.png&quot;&gt;&lt;img alt=&quot;3-28-2011 2-36-41 PM&quot; border=&quot;0&quot; height=&quot;112&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQmnmF5-dHo-VJLojGRZ_MEaTcCxZMwbICIVdiU9O5m-10fvHgdKlj0HcdW8sJB3YIKgN3OxFB9uke_HvKWMW1v4GoNkiVTJrE3oF93PCkuN0CuvVdvrtMfkF6VoNRtx1HV2tUkWYsaB_z/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-36-41 PM&quot; width=&quot;478&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Let’s execute our program and see the result!&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRxOPONIE9Lf0WqlekRjUDkeZzh8hmfPuOnsQMhUsTS25MSU7En5Hchyphenhyphen5fG-apGZEjMoMfKTHe6E1QziRPZ8mTZEGObWx4pK3WvvXQv6JPNUbS4Kqk2AYnUn3i3T47abXHSbeXXJiwnyPz/s1600-h/3-28-2011%202-38-09%20PM%5B4%5D.png&quot;&gt;&lt;img alt=&quot;3-28-2011 2-38-09 PM&quot; border=&quot;0&quot; height=&quot;114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0MNEF4JyYBsFvzh-vGVB1HLIfLk3aZ2kXUOP9X4spsPFdd5uLu1JA3ZaJBJZ0J1f_GxJ1guKkQuEGHgBXYq-g9kBgxjq2Ix9_OAEKotFX0wbd1n7CyVx7_hPVC0B8NR1-en4QHqF8f9Lz/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-38-09 PM&quot; width=&quot;418&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Wow! Brilliant no? So what just happened? Let’s explain:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; First, we wrote a method that takes 2 parameters, work with them then return the result as a variable of type Int (return result;). Once the return keyword (In Visual C#, keywords are colored with blue) is reached by the JIT the methods ends, so any thing you write after this word has been reached won’t be executed!&lt;br /&gt;
&amp;nbsp;&amp;nbsp; In our method we used &lt;strong&gt;variables&lt;/strong&gt; which are places in the memory where we can put our data temporally, all our variables will despair once our program exits, so we can use them only to store user input temporally.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Now, we are going to extend our program so it takes user input and work with it rather than our 5 and 6! We need just to modify the code in Main() so it looks like this one:&lt;br /&gt;
static void Main(string[] args)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyCalculator MyGeniusLady = new MyCalculator();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int result = MyGeniusLady.Add(5, 6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Write(&quot;Please enter the first number A: &quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int A = Console.Read();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Write(&quot;Please enter the first number B: &quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int B = Console.Read();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(MyGeniusLady.Add(A,B));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.ReadKey();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFBymCKSynCqOInpd2vlGsKvjPp0dmJb2onNF_yUvvFhm7mLw8tfvflZLQ27VbgLpMeCjxrQ4tIx-814X2MhEfZ1HVH2ZbFz73PGxAzE6sRz2m_dUfHjIGQN5RMeQyD-4rdZzM3qmFuxhR/s1600-h/3-28-2011%202-50-54%20PM%5B9%5D.png&quot;&gt;&lt;img alt=&quot;3-28-2011 2-50-54 PM&quot; border=&quot;0&quot; height=&quot;136&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4Tn3sbpzZBL0pLKIA_esGIkAajzH1WbZm7YE6nO7TKKmCwb6uXoUeT41Krj95QqHkvSQfhUqv5Ej8UFRAyhRtPxL15_FWWNi7vwyc5czgywzQ1OjENjDXpX5e8QJLrMpUoY_KPFy63Kag/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-50-54 PM&quot; width=&quot;483&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Now Test It!&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLWbHY5I93naitrN3CagreUbLZXaLvJ-I_xWwmuBussWfeefLIR2L6Sg6znv86nKwK2Jm0sY2Fmq3YGOqe_VGc1rlSLDhPIOqqTNsThQbyie1HGsEXXWlWjI5sX4aQq0Zo22Cok9-SgLGl/s1600-h/3-28-2011%202-56-18%20PM%5B4%5D.png&quot;&gt;&lt;img alt=&quot;3-28-2011 2-56-18 PM&quot; border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWIpHqt6WvFkA-MpFkVL5pfU5BN1_DTOXxLYd6goEJA_UltDmXUXO2OZ2jivm_FS-P1F4rQVJu-8k26Vl0IpJbstquTK3f2M5x7dZo-38tyFgCz9KsiSLlMRqG4V1-ga3De7RbtoTi8cum/?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;3-28-2011 2-56-18 PM&quot; width=&quot;495&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; What have we done is: we took the user input with the ReadLine() method which returns a String and converted it to Int with the Parse() method and then we &lt;strong&gt;assigned&lt;/strong&gt; it to our variable; You can also see that we wrote this: Console.WriteLine(MyGeniusLady.Add(A,B)); because our method return an Int, we can simply just pass it to the WriteLine method! this has the same result as in the previous example but we just did it in a deferent way! &lt;br /&gt;
&amp;nbsp; Notice: you see the ReadKey() method at the end of the method, we just you it to prevent the console from automatically closing after showing the result. Remove it and test!&lt;br /&gt;
&amp;nbsp;&amp;nbsp; You may ask: “Wait a moment! My lady is not like the Console lady! I had to write more code to ask her to give me some results!” The answer is simple! The console class is &lt;strong&gt;static &lt;/strong&gt;, that means you can call her directly without the need of assigning a variable with a reference to a new instance, Our class is not static, we can create as many variables as we want! But you can always make you class static by adding the static keyword after the public keyword. (Static classes will be discussed in another lesson!)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; This is all for today, Try to understand it! If you need more information about Classes, Console, Methods… etc. please refer to the &lt;a href=&quot;http://msdn.microsoft.com/&quot;&gt;MSDN&lt;/a&gt; Web Site. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/3164963333757203111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/visual-studio-c-express-2010-your-first.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/3164963333757203111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/3164963333757203111'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/visual-studio-c-express-2010-your-first.html' title='Visual Studio C# Express 2010: Your first application!'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9TXKTR6z-pSD1HMGOubii02DAm-jq5RcN4Y9trfUDps5gL6KWanaSi-IPoQyjEgbCyDEdMheGrZWIaa2I0KY6iiQs3oulS_yBJ8atINwWDLPntwMWbjQiKoB7Y6eDmhKusBGjnkQBFWAW/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1964911433259655792.post-7176085475539531379</id><published>2011-03-26T23:34:00.001+01:00</published><updated>2011-03-27T13:00:44.879+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General .NET"/><title type='text'>Getting deeper into .NET: Part II</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:DotNet.svg&quot;&gt;&lt;img align=&quot;right&quot; alt=&quot;&quot; height=&quot;292&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/DotNet.svg/250px-DotNet.svg.png&quot; style=&quot;display: inline; float: right;&quot; width=&quot;250&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;The .NET main components:&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &lt;em&gt;As you can see in the next picture, the .NET framework offers a lot of features, ADO.NET, LINQ, WPF etc..&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp; In every new version Microsoft introduced new components, we are now going to explain every component of those components from the main version (2.0) to the latest available one (4.0).&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&amp;nbsp; &lt;u&gt;Framework 2.0:&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp; This version is the version that Microsoft built the other version on (except 4.0 that has a new engine), The basic .NET components were introduced in Framework 2.0 which are:&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp; &lt;strong&gt; 1. The CLR&lt;/strong&gt;: Already explained.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;2. The BCL&lt;/strong&gt;: Already explained.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;3. WinForms:&lt;/strong&gt; It’s the NET’s graphical application programming interface, it is built on the extant Windows API and some controls merely wrap underlying Windows components and allows you to develop Windows Applications (Visual Studio 2008 for example).&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;4. ASP.NET:&lt;/strong&gt; it is a web application framework that allows you to create rich and dynamic web sites and web services (Microsoft.com for example) and is the successor to the classic ASP.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;5. ADO.NET :&lt;/strong&gt; it’s a set of components that programmers can use to access data and data services, you can connect to a database, get and set data, open and XML file and manipulate it and so on.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&lt;strong&gt; &lt;u&gt;Framework 3.0:&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp; Introduced lot of cool components.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;1. Windows Presentation Foundation:&lt;/strong&gt; is a graphical subsystem for rendering user interfaces in Windows-based applications,Rather than relying on the older GDI subsystem, WPF utilizes DirectX so it can enables you to create a very rich desktop applications (Visual Studio 2010 and Nokia Ovi Suite for example). Very powerful and strong.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;2. Windows Communication Foundation:&lt;/strong&gt; It’s an API that allows you to create connected and service-oriented applications, it also allows your applications&amp;nbsp; to communicate with each other.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp; &lt;strong&gt; 3. Windows Workflow Foundation: &lt;/strong&gt;It is a Microsoft technology that provides an API, an in-process workflow engine, and a rehostable designer to implement long-running processes as workflows within .NET applications. The current version of WF was released as part of the .NET Framework version 4 and is referred to as (WF4).&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&amp;nbsp; &lt;u&gt;Framework 3.5:&lt;/u&gt;&lt;/strong&gt;&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; Data Access has being improved in this release.Introduction of ADO.NET Entity Framework, and the new LINQ.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;1. LINQ:&lt;/strong&gt; It is a component that adds native data querying capabilities to .NET languages, you can query data sources (Databases, XML Files…) directly from your C# or VB.NET code, without the need to learn SQL or other querying language.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;2. ADO.NET Entity Framework:&lt;/strong&gt; It is an object-relational mapping (ORM) framework that allows you to work with data as being objects.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&lt;u&gt;&lt;strong&gt;Framework 4.0:&lt;/strong&gt;&lt;/u&gt;&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp; Improved performance, minimized size (20Mb), and new Engine.&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;1. Parallel LINQ&lt;/strong&gt;: is a managed concurrency library being developed by a collaboration between Microsoft Research and the CLR team at Microsoft. It is composed of two parts: &lt;i&gt;Parallel LINQ&lt;/i&gt; (PLINQ) and &lt;i&gt;Task Parallel Library&lt;/i&gt; (TPL).&lt;sup&gt;[1]&lt;/sup&gt;&lt;sup&gt;[2]&lt;/sup&gt; It also consists of a set of &lt;i&gt;coordination data structures&lt;/i&gt; (CDS) – sets of data structures used to synchronize and co-ordinate the execution of concurrent tasks.&lt;/em&gt;  &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/7176085475539531379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/getting-deeper-into-net-part-ii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/7176085475539531379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/7176085475539531379'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/getting-deeper-into-net-part-ii.html' title='Getting deeper into .NET: Part II'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1964911433259655792.post-2502910313122931580</id><published>2011-03-24T13:47:00.001+01:00</published><updated>2011-03-27T13:01:00.043+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General .NET"/><title type='text'>Geeting deeper into .NET : Part I</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;em&gt; So now after you got an overview about the .NET let’s get deeper into it’s  architecture .&lt;/em&gt; &lt;br /&gt;
&lt;em&gt;The framework conssist mainly of  a CLR, CLS, CIL, and the BCL, this is  only what we are going to need and of course, what we are going to  explain.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;&lt;em&gt;  The CLR:&lt;/em&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;em&gt;Let’s start by the CLR or Common Language Runtime, if you are comming  from Java so this is the Java VM, otherwise, this is a virtual execution  environment for program code and it is the core component of the framework, it  handles the JIT compilation, memory management, and the garbage collection  including interoperability and a very powerfull exception handling.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignright&quot; height=&quot;346&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Overview_of_the_Common_Language_Infrastructure.svg/300px-Overview_of_the_Common_Language_Infrastructure.svg.png&quot; title=&quot;Overview of the .NET compiling architecture.&quot; width=&quot;300&quot; /&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;As you can see in the next picture, when you compile your code, it is not  compiled directly to machine code, instead it is compiled to a well-know  language called Microsoft Intermediate Language (MSIL), this language is very  similar to the Assembly language what maked it easier for the JIT than normal C#  or VB.NET codes.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;Question : &lt;/strong&gt;So, you say that the  .NET does not compile to native language? so how would the CPU understand  it?&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;The answer is quite simple, when you run your program, the CLR  calls for the JIT (Just-In-Time) that will compile your MSIL code to native  assembly code! This may slow your program a little bit but you can get rid of  this by generating a native code using the Ngen tool in the production  enviromment (Will be discuss later) , You will get a faster application but you  may not! You can just make your application &lt;span style=&quot;text-decoration: underline;&quot;&gt;slower &lt;/span&gt;because the JIT makes  performance optimizations for your code, and also, by using the Ngen tool, you  will probably compile some code the current end-user will never use! So the best  thing to do is to keep the JIT alive!&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;&lt;em&gt;   The CLS:&lt;/em&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;em&gt;The CLS is a set of basic language features to allow all CLI (The CLR in  .NET Implementation) Languages to interoperate with each others.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;We  can say that this is a “set of rules” that a languages should respect to be a  valid .NET Language.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;&lt;em&gt; The &lt;strong&gt;CIL&lt;/strong&gt;:&lt;/em&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;em&gt; You’ve certainly see the MSIL above, what is that?  And what does it  serve?&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;The CIl  is the lowest-level human-readable programming language defined  by the Common Language Infrastructure, and all CLI Languages MSUT compile to it.  &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;MSIL is the Microsoft implementation of the CLI, other framework  implementations may name the CLI in an other way, although the runtime engine is  described by an ECMA/ISO specification.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;So, when compiling to MSIL you allow your .NET code written in deffirent  languages to  interoperate with each others more easly.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;&lt;em&gt;  The Base Class Library:&lt;/em&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;em&gt;One of the most important things in the .NET Framework is it’s very huge  Class Library that provides you with every thing you need: UI Controls, Data  Access, file reading and writing …etc  It is much larger in scope than standard  libraries for most other languages including C++ and Delphi.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/2502910313122931580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/geeting-deeper-into-net-part-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/2502910313122931580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/2502910313122931580'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/geeting-deeper-into-net-part-i.html' title='Geeting deeper into .NET : Part I'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1964911433259655792.post-7970642648341203137</id><published>2011-03-24T13:45:00.000+01:00</published><updated>2011-03-27T13:01:10.462+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General .NET"/><title type='text'>Introduction to .NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;em&gt;Let’s start by quoting from wikipedia:  “The .NET Framework (pronounced dot  net) is a software framework for Microsoft Windows operating systems. It  includes a large library, and it supports several programming languages which  allows language interoperability (each language can use code written in other  languages). The .NET library is available to all the programming languages that  .NET supports.” &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;   Our definition: .NET Framework is a great developing plateform  that allows you to do everything you want the way you want!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; &lt;/em&gt;&lt;br /&gt;
&lt;em&gt; &lt;strong&gt;Question : &lt;/strong&gt;I use PHP, why should I change?&lt;br /&gt;
The  answer is pretty simple: PHP allows you to build websites only, but with the  .NET you can build Websites, Windows, Linux, Mac,Windows Phone, iOS,  Android Apps, and websites, you can also build SilverLight/WPF Apps! all this  with one language! awesome no?&lt;br /&gt;
You can even query databases with your  language!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Next, the .NET Framework languages are managed, that means you don’t have to  worry about unloading variables or about crashing the system, the GC will do  every thing for you! It will unload everything unnecessary from the memory  without your intervention! And with the JIT you will compile only what you need  when you need, it is not necessary any more to compile your entire code when you  are going to use only one method! The JIT will compile your MSIL code to Machine  code when and only when you need it to provide you a better performance.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;This is not what the .NET Framework offer, no, this is only a small part of  it’s features, this framework offers a very huge  Base Class Library that  provide you all what you need, from the user interface to the data access, one  important thing about the data access, if you are not familliar with databases  and SQL Syntax don’t worry! The new Entity Framework allows you to treat  Databases’ tables as objects! something you are familliar with! And the LINQ  (Language INtegrated Query) allows you to query your database within your code  with your .NET programming language! Wether your querying a XML File, a SQL  Server Database, Oracle Database, MySQL Database.. You will use one unified  querying suntax!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt; &lt;/em&gt;&lt;br /&gt;
&lt;div lang=&quot;en&quot;&gt;&lt;em&gt; After building your first app using this framework, you will be  surprised : “Wow! How was that easy!” either you are new to the developement or  you are comming from another platform or language (PHP, Java, VB6 …etc).&lt;/em&gt;&lt;/div&gt;&lt;em&gt; &lt;/em&gt;&lt;br /&gt;
&lt;em&gt;With the .NET Framework, building apps was never easier!&lt;/em&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetinaglance.blogspot.com/feeds/7970642648341203137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/introduction-to-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/7970642648341203137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1964911433259655792/posts/default/7970642648341203137'/><link rel='alternate' type='text/html' href='http://dotnetinaglance.blogspot.com/2011/03/introduction-to-net.html' title='Introduction to .NET'/><author><name>DotNET</name><uri>http://www.blogger.com/profile/00562258948132386798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>