<?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: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-7210337449608707951</id><updated>2011-11-27T18:31:14.788-06:00</updated><category term='Sorting'/><category term='Visual Studio'/><category term='dll'/><category term='javascript'/><category term='Download'/><category term='HTTPS'/><category term='singleton'/><category term='AJAX'/><category term='Paging'/><category term='wsdl'/><category term='assembly'/><category term='Datagrid'/><category term='3.5'/><category term='BLL'/><category term='design pattern'/><category term='Gridview'/><category term='disco'/><category term='css'/><category term='indexer'/><category term='sn'/><category term='value type'/><category term='gacutil'/><category term='key signing'/><category term='DataSet'/><category term='template code'/><category term='SSL'/><category term='Anchor'/><category term='boxing'/><category term='DataAdapter'/><category term='DAL'/><category term='2008'/><category term='facade'/><category term='LINQ'/><category term='reflections'/><category term='ADO.net'/><category term='XSLT'/><category term='foreach'/><category term='Web Services'/><category term='PInvoke'/><category term='UML'/><category term='XML'/><category term='oop'/><category term='Class Library'/><category term='reference type'/><category term='Caching'/><category term='IIS'/><category term='config'/><category term='ie'/><category term='C#'/><category term='SOAP'/><category term='Remoting'/><category term='sql'/><category term='DataReader'/><category term='generics'/><category term='reference'/><category term='linked list'/><category term='html'/><category term='Doomsday'/><category term='.NET'/><category term='Silverlight'/><title type='text'>csharpeasy</title><subtitle type='html'>Useful C# &amp; .NET tips</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-7117765148823757661</id><published>2011-02-18T12:47:00.002-06:00</published><updated>2011-02-18T12:51:51.497-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><title type='text'>Grouping items in Order By Statement</title><content type='html'>I like this!!!&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;ORDER BY&lt;br /&gt;CASE WHEN column = 'this' THEN 2 ELSE 1 END asc,&lt;br /&gt;othercolumn asc,&lt;br /&gt;another column desc&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;to group items separately and then apply a secondary sorting within each group...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-7117765148823757661?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/7117765148823757661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=7117765148823757661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/7117765148823757661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/7117765148823757661'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2011/02/grouping-items-in-order-by-statement.html' title='Grouping items in Order By Statement'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-1113278019354538550</id><published>2008-03-20T17:16:00.008-06:00</published><updated>2010-11-10T23:34:50.005-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><title type='text'>OOP Concepts</title><content type='html'>OOP Concepts:&lt;br /&gt;&lt;br /&gt;1. POLYMORPHISM: In object-oriented programming, polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form.&lt;br /&gt;&lt;br /&gt;2.ENCAPSULATION: Conceptually, encapsulation means hiding the internal details of a class's operation.Goal of encapsulation: use an object without understanding or depending on its internal details.&lt;br /&gt;&lt;br /&gt;3.INHERITANCE: Inheritance is used to establish hierarchical class relationships.In inheritance, one class (the subclass) adopts (inherits) the features of another class (the superclass).&lt;br /&gt;&lt;br /&gt;4.ABSTRACTION:In object technology, determining the essential characteristics of an object. Abstraction is one of the basic principles of object-oriented design, which allows for creating user-defined data types, known as objects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-1113278019354538550?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/1113278019354538550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=1113278019354538550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1113278019354538550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1113278019354538550'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2008/03/oop-concepts.html' title='OOP Concepts'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2791261062585870192</id><published>2008-03-19T18:12:00.005-06:00</published><updated>2008-03-19T18:31:05.343-06:00</updated><title type='text'>Dispose(), Destructor/Finalizer</title><content type='html'>Destructors are called by GC (non-deterministic) ~ClassName() in C# &amp;amp; Finalize() method in VB.NET when GC determines it is time for garbage collection.&lt;br /&gt;Not the best place to put cleanup code.&lt;br /&gt;Ex: open a database connection and put the cleanup code in the Destructor. That DB connection &lt;strong&gt;might&lt;/strong&gt; stay open for the life of the entire application. Not good!&lt;br /&gt;&lt;br /&gt;Dispose() method:&lt;br /&gt;A better place to put cleanup code.&lt;br /&gt;Mostly used to cleanup &lt;strong&gt;unmanaged&lt;/strong&gt; resources.&lt;br /&gt;using{} statement automatically calls the Dispose() before exiting.&lt;br /&gt;Recommended to be called only if the object is resource intensive.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://www.dotnetspider.com/qa/Question1450.aspx"&gt;http://www.dotnetspider.com/qa/Question1450.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2791261062585870192?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2791261062585870192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2791261062585870192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2791261062585870192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2791261062585870192'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2008/03/dispose-destructorfinalizer.html' title='Dispose(), Destructor/Finalizer'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-4361994946226793177</id><published>2008-03-19T17:30:00.002-06:00</published><updated>2008-03-19T18:03:26.412-06:00</updated><title type='text'>Access Modifiers (public, private, ...)</title><content type='html'>By default;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;classes&lt;/strong&gt;: internal by default. (can be internal or public, can NOT be private, protected or protected internal)&lt;br /&gt;&lt;strong&gt;interfaces&lt;/strong&gt; &amp;amp; &lt;strong&gt;enumerations&lt;/strong&gt;: always public, no access modifier needed or allowed.&lt;br /&gt;&lt;strong&gt;namespaces&lt;/strong&gt;: always public&lt;br /&gt;&lt;strong&gt;Struct members&lt;/strong&gt;: private by default. (can be public, private, internal)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public&lt;/strong&gt;: accessible from instance &amp;amp; derived classes&lt;br /&gt;&lt;strong&gt;private&lt;/strong&gt;: NOT accessible from instance nor derived classes&lt;br /&gt;&lt;strong&gt;protected&lt;/strong&gt;: NOT accessible from instance but accessible from derived classes&lt;br /&gt;&lt;strong&gt;internal&lt;/strong&gt;: accessible from instance &amp;amp; derived classes WITHIN THE SAME ASSEMBLY ONLY.&lt;br /&gt;&lt;strong&gt;protected internal&lt;/strong&gt;: NOT accessible from instance but accessible from  derived classes of the same assembly.&lt;br /&gt;&lt;br /&gt;So, if a member is marked as protected, then it is accessible from derived classes of the SAME assembly or other assemblies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-4361994946226793177?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/4361994946226793177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=4361994946226793177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/4361994946226793177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/4361994946226793177'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2008/03/access-modifiers-public-private.html' title='Access Modifiers (public, private, ...)'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-1166182863756223947</id><published>2008-03-18T17:34:00.003-06:00</published><updated>2008-03-18T20:18:37.445-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='boxing'/><category scheme='http://www.blogger.com/atom/ns#' term='value type'/><category scheme='http://www.blogger.com/atom/ns#' term='generics'/><category scheme='http://www.blogger.com/atom/ns#' term='reference type'/><title type='text'>Reference &amp; Value Types and Primitive Types</title><content type='html'>&lt;strong&gt;Value types:&lt;/strong&gt;&lt;br /&gt;All numeric data types&lt;br /&gt;Boolean, Char, and Date&lt;br /&gt;All structures, even if their members are reference types&lt;br /&gt;Enumerations, since their underlying type is always Byte, Short, Integer, or Long&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference types:&lt;/strong&gt;&lt;br /&gt;String&lt;br /&gt;All arrays, even if their elements are value types&lt;br /&gt;Class types, such as Form&lt;br /&gt;Delegates&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Primitive types:&lt;/strong&gt;&lt;br /&gt;Some of the data types are used very frequently during programming. To ease coding using these data types, compilers allow us to usesimplified syntax.&lt;br /&gt;So, the data types supported directly by the compiler are called primitive types and these types map to the types in the Base Class Library (BCL).&lt;br /&gt;&lt;br /&gt;For instance, instead of initializing an integer like this;&lt;br /&gt;System.Int32 i = new System.Int32(10); //Throws compiler error&lt;br /&gt;&lt;br /&gt;we can easily initialize it using below line of code:&lt;br /&gt;int i =5;&lt;br /&gt;&lt;br /&gt;So, the primitive type "int" maps to "System.Int32" type in the BCL.&lt;br /&gt;string maps to System.String.&lt;br /&gt;object maps to System.Object.&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Boxing &amp;amp; Unboxing:&lt;/strong&gt;&lt;br /&gt;Boxing refers to the operation of converting a value type to a reference type.&lt;br /&gt;&lt;br /&gt;Int32 v = 5; // Create an unboxed value type variable&lt;br /&gt;Object o = v; // o refers to a boxed version of v&lt;br /&gt;v = 123;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;public static void Main() {&lt;br /&gt;Int32 v = 5; // Create an unboxed value type variable&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;// When compiling the following line, v is boxed 3 times&lt;br /&gt;// wasting heap memory and CPU time&lt;br /&gt;&lt;/strong&gt;Console.WriteLine(v + ", " + v + ", " + v);&lt;br /&gt;&lt;br /&gt;// The lines below use less memory and run faster&lt;br /&gt;Object o = v; // Manually box v (just once)&lt;br /&gt;&lt;br /&gt;// No boxing occurs to compile the following line&lt;br /&gt;Console.WriteLine(o + ", " + o + ", " + o);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;default&lt;/strong&gt; Keyword in Generic Code:&lt;br /&gt;This is an issue with the &lt;strong&gt;generics&lt;/strong&gt; concept in .NET 2.0.&lt;br /&gt;&lt;br /&gt;public class GenericList&lt;t&gt;&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;When we do not know in advance,&lt;br /&gt;whether the type T is a &lt;strong&gt;value&lt;/strong&gt; or a &lt;strong&gt;reference&lt;/strong&gt; type&lt;br /&gt;and if it is a value type whether is it a &lt;strong&gt;numeric&lt;/strong&gt; value or a &lt;strong&gt;struct&lt;/strong&gt;&lt;br /&gt;we can use the &lt;strong&gt;default &lt;/strong&gt;keyword.&lt;br /&gt;&lt;br /&gt;T theTypeInstance= default(T);&lt;br /&gt;&lt;br /&gt;This initializes theTypeInstance;&lt;br /&gt;to null if T is a reference type,&lt;br /&gt;to 0 if numeric,&lt;br /&gt;the references types of the struct to null  &amp;amp;  the numeric types of the struct to 0.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/magazine/cc301569.aspx"&gt;http://msdn2.microsoft.com/en-us/magazine/cc301569.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/magazine/bb984984.aspx"&gt;http://msdn2.microsoft.com/en-us/magazine/bb984984.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/xwth0h0d(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/xwth0h0d(VS.80).aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-1166182863756223947?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/1166182863756223947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=1166182863756223947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1166182863756223947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1166182863756223947'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2008/03/reference-value-types-and-primitive.html' title='Reference &amp; Value Types and Primitive Types'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-8751094018808071852</id><published>2008-03-17T16:11:00.002-06:00</published><updated>2008-03-17T16:29:08.544-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='indexer'/><title type='text'>C# indexer</title><content type='html'>&lt;strong&gt;Declaration:&lt;/strong&gt;&lt;br /&gt;public &lt;type&gt; this [&lt;type&gt; identifier]&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;public string this [int theIndex]&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sample C# Use:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;//Indexer Class Declaration&lt;br /&gt;class MyIntIndexer&lt;br /&gt;{&lt;br /&gt;private string[] theData;&lt;br /&gt;&lt;br /&gt;public MyIntIndexer(int size)&lt;br /&gt;{&lt;br /&gt;theData= new string[size];&lt;br /&gt;&lt;br /&gt;//Initialize&lt;br /&gt;for (int i=0; i &lt; size; i++)&lt;br /&gt;{&lt;br /&gt;theData[i] = "nothing";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string this[int position]&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return theData[position];&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;theData[position] = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;int size = 5;&lt;br /&gt;&lt;br /&gt;MyIntIndexer myIndexer = new MyIntIndexer(size);&lt;br /&gt;&lt;br /&gt;myIndexer[3] = "str3";&lt;br /&gt;myIndexer[1] = "str1";&lt;br /&gt;myIndexer[5] = "str5";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-8751094018808071852?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/8751094018808071852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=8751094018808071852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/8751094018808071852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/8751094018808071852'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2008/03/c-indexer.html' title='C# indexer'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2264478921505670242</id><published>2008-03-10T09:09:00.000-06:00</published><updated>2008-03-20T09:12:47.856-06:00</updated><title type='text'>const vs readonly</title><content type='html'>a const member's value is defined at compile time.&lt;br /&gt;a readonly member's value can be set at runtime as well as compile time.&lt;br /&gt;&lt;br /&gt;static means the member is not tied to the instances of the class. There exists only one copy of the static member regardless of the number of instances.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2264478921505670242?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2264478921505670242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2264478921505670242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2264478921505670242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2264478921505670242'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2008/03/const-vs-readonly.html' title='const vs readonly'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-7047902340576048390</id><published>2007-12-27T15:16:00.000-06:00</published><updated>2007-12-27T15:55:18.489-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='facade'/><category scheme='http://www.blogger.com/atom/ns#' term='singleton'/><title type='text'>Design Patterns</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:arial;"&gt;Creational:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;em&gt;&lt;strong&gt;Abstract Factory:&lt;/strong&gt;&lt;/em&gt; Creates concrete instances of classes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Singleton:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Creates a single instance of a class and ensures there is only one instance in the system.&lt;br /&gt;Class contruction: Keep a private member in the class and let the constructor initialize it only if that member is null.&lt;br /&gt;Application: System resources; there is only one printer in the system and we must access it thru singleton pattern.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:arial;"&gt;Structural:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Facade:&lt;/strong&gt;&lt;/em&gt; Represents an entire system of subclasses.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Proxy:&lt;/strong&gt;&lt;/em&gt; Not the real object itself, just represents the real object.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:arial;"&gt;Behavioral:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Command:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;A command request is encapsulated as an object.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Observer: &lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;Notifies changes to classes.&lt;br /&gt;Application: Error logging.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:trebuchet ms;"&gt;Web Design specific:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;MVC (Model-View-Controller):&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Complete separation of the;&lt;br /&gt;model (database),&lt;br /&gt;view (page view) and&lt;br /&gt;controller (business logic).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-7047902340576048390?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/7047902340576048390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=7047902340576048390' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/7047902340576048390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/7047902340576048390'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/12/design-patterns.html' title='Design Patterns'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2642838303719722617</id><published>2007-11-29T23:47:00.000-06:00</published><updated>2007-11-30T00:11:12.516-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Download'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='2008'/><title type='text'>.NET Framework 3.5 Released!!</title><content type='html'>As most of the .NETers know, Microsoft .NET Framework 3.0 has been in the market for a while.&lt;br /&gt;Along with that .NET Framework 3.5 was also available as a Beta version and as of 19th of November 2007, .NET Framework's 3.5 version has officially been released!&lt;br /&gt;A new toy for us programmers to play around isn't it?! :)&lt;br /&gt;So with this version it's been about two years know after .NET Framework 2.0' release in 2005.&lt;br /&gt;&lt;br /&gt;Here are the direct links to download from Microsoft - for those who wanna skip to the download right away!&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&amp;amp;displaylang=en"&gt;Download Microsoft .NET Framework 3.5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'd suggest to download the express version of Visual Web Developer 2008 along with the new framework:&lt;br /&gt;&lt;a href="http://download.microsoft.com/download/d/c/3/dc3439e7-5533-4f4c-9ba0-8577685b6e7e/vnssetup.exe"&gt;Download Visual Web Developer 2008 Express&lt;/a&gt;&lt;br /&gt;&lt;a href="http://download.microsoft.com/download/d/c/3/dc3439e7-5533-4f4c-9ba0-8577685b6e7e/vcssetup.exe"&gt;Download Visual C# 2008 Express&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Find the rest of the 2008 Express Series by &lt;a href="http://www.microsoft.com/express/download/"&gt;clicking here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I played around little bit with the VWD 2008 Express. Three things that came to my sudden interest:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Microsoft's recent popular keywords: Controls for AJAX, Silverlight &amp;amp; LINQ are available in the toolbox.&lt;/li&gt;&lt;li&gt;CSS Properties &amp;amp; Manage Styles tabs saying "hello!" from the left border of the VWD.&lt;/li&gt;&lt;li&gt;"Split" design mode in addition to 'HTML' and normal 'Design' mode. Was available in Frontpage. Good to see it now in VWD or Visual Studio let's say for those who are lucky to start developing in the 2008 version of Visual Studio! :)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Will keep sharing my experiences with .NET Framework 3.5 and Visual Web Developer!&lt;/p&gt;&lt;p&gt;Please gimme your comments on this and make me happy :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2642838303719722617?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2642838303719722617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2642838303719722617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2642838303719722617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2642838303719722617'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/11/net-framework-35-released.html' title='.NET Framework 3.5 Released!!'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-1281760649890684749</id><published>2007-10-30T22:51:00.000-06:00</published><updated>2007-11-03T17:11:40.938-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Remoting'/><category scheme='http://www.blogger.com/atom/ns#' term='reference'/><category scheme='http://www.blogger.com/atom/ns#' term='assembly'/><title type='text'>Assembly References</title><content type='html'>In this post I'd like to point out one important mistake I noticed that many beginners of .NET do: They forget to create a reference to related the .NET assembly.&lt;br /&gt;Even if you are preparing for an interview question or doing the actual programming, you have to know you need to create an assembly reference in .net so that your compiler can compile the program.&lt;br /&gt;&lt;br /&gt;An example to this mistake: The programmer includes the below code to the top of the C# class file.&lt;br /&gt;&lt;br /&gt;using System.Runtime.Remoting;&lt;br /&gt;using System.Runtime.Remoting.Channels;&lt;br /&gt;using System.Runtime.Remoting.Channels.Tcp;&lt;br /&gt;&lt;br /&gt;However, he/she forgets to tell the compiler where to find the actual assembly file (dll).&lt;br /&gt;Correct the mistake by:&lt;br /&gt;right click the solution, and click on "Add Reference".Select the System.Runtime.Remoting assembly in the list.This is like only telling someone to get sugar from Walmart.&lt;br /&gt;How can that person know where Walmart is, if you don't tell him?!&lt;br /&gt;Don't expect the person to guess or find out himself because the subject in question is NOT a person. He is a computer! And computers are stupid!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-1281760649890684749?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/1281760649890684749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=1281760649890684749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1281760649890684749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1281760649890684749'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/10/assembly-references.html' title='Assembly References'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-3308881351601022422</id><published>2007-10-30T22:11:00.000-06:00</published><updated>2007-10-30T23:48:36.986-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='template code'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>HTML Templates</title><content type='html'>In this tutorial, I'll provide the basic html codes used in website designs. In web application development most developers use WYSIWYG (What You See Is What You Get) type programs like Frontpage, Dreamveawer and Visual Studio. But if you want to take advanced control of your website, sticking to the html codes is inevitable and most developers directly work on the html tags. Let's not forget to say HTML stand for "Hyper-Text Markup Language".&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-6849249797589451";google_ad_width = 125;google_ad_height = 125;google_ad_format = "125x125_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "E1771E";google_color_text = "0066CC";google_color_url = "0066CC";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src=""&gt;http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Let's take a look at how the html structure of a web page is:&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;New Page&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Above is the html template code that has to be present in EVERY html page so that it can be displayed by the browsers like Firefox, Internet Explorer, Netscape etc. Notice that this script is &lt;strong&gt;&lt;em&gt;well-formed&lt;/em&gt;&lt;/strong&gt; i.e. each tag has a matching closing tag.&lt;br /&gt;&lt;br /&gt;There are two major code manipulations to make a web page work.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Javascript&lt;/li&gt;&lt;li&gt;CSS&lt;/li&gt;&lt;/ol&gt;Javascript, in a nutshell, is a &lt;strong&gt;&lt;em&gt;client-side&lt;/em&gt;&lt;/strong&gt; scripting language. I'll tell what this means in just a moment.&lt;br /&gt;CSS stands for "Cascading Style Sheets". As it's name implies, it is used to manipulate the style, look and feel of a web page.&lt;br /&gt;&lt;br /&gt;In addition to these two code manipulations, you need to deal with a third type of code which is &lt;strong&gt;&lt;em&gt;server side&lt;/em&gt;&lt;/strong&gt; scripting and programming if you need a &lt;strong&gt;&lt;em&gt;dynamic&lt;/em&gt;&lt;/strong&gt; page. C#, VB.NET, PHP, ASP CGI are examples of server side programming.&lt;br /&gt;Here comes the difference between Javascript and C#. One is &lt;strong&gt;&lt;em&gt;client side&lt;/em&gt;&lt;/strong&gt; coding and the other one is &lt;strong&gt;&lt;em&gt;server side&lt;/em&gt;&lt;/strong&gt; coding. For instance&lt;strong&gt; C#&lt;/strong&gt; runs and processes the user input in the server and responds to a users request while &lt;strong&gt;Javascript&lt;/strong&gt; runs in the users computer and validates user input or triggers some funny effects when the users moves their mouse.&lt;br /&gt;&lt;br /&gt;We will code html template with more functionalities in the next posts. So bear with me and feel free to share your comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-3308881351601022422?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/3308881351601022422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=3308881351601022422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/3308881351601022422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/3308881351601022422'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/10/html-templates.html' title='HTML Templates'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-4298451082080195921</id><published>2007-10-10T23:07:00.000-05:00</published><updated>2007-12-03T23:32:17.827-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sorting'/><category scheme='http://www.blogger.com/atom/ns#' term='Paging'/><category scheme='http://www.blogger.com/atom/ns#' term='Caching'/><category scheme='http://www.blogger.com/atom/ns#' term='Gridview'/><category scheme='http://www.blogger.com/atom/ns#' term='Datagrid'/><title type='text'>DataGrid Paging and Sorting Implementation</title><content type='html'>&lt;p&gt;&lt;span style="font-size:+0;"&gt;&lt;span style="font-size:+0;"&gt;Unless you use ASP.NET's auto designer mode and auto features, you have to implement sorting and paging methods for the Datagrid in C# or VB.NET codes.&lt;br /&gt;&lt;br /&gt;Declare the page index changed event and its handler in InitializeComponent() method of the C# code.&lt;br /&gt;Implement the method which will set the index to the new page index.&lt;br /&gt;private void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e) {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Do the same for sorting.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the database query returns huge number or records, you may wanna consider Caching the recordset. Otherwise, each PageIndexChanged event will cause hitting the database again and again which results in a performance decrease.&lt;br /&gt;Use the method Cache.Insert(dataset) to do this. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-4298451082080195921?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/4298451082080195921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=4298451082080195921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/4298451082080195921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/4298451082080195921'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/10/datagrid-paging-and-sorting.html' title='DataGrid Paging and Sorting Implementation'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-920190519515975727</id><published>2007-06-12T13:04:00.000-05:00</published><updated>2007-06-12T13:26:38.467-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='XSLT'/><title type='text'>XSLT</title><content type='html'>Terms:&lt;br /&gt;&lt;br /&gt;XSL  stands for EXtensible Stylesheet Language.&lt;br /&gt;XSLT stands for XSL Transformations&lt;br /&gt;&lt;br /&gt;Styles;&lt;br /&gt;CSS for HTML documents.&lt;br /&gt;XSL for XML documents.&lt;br /&gt;&lt;br /&gt;XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.&lt;br /&gt;&lt;br /&gt;XSL consists of three parts:&lt;br /&gt;&lt;br /&gt;    * XSLT - a language for transforming XML documents&lt;br /&gt;    * XPath - a language for navigating in XML documents&lt;br /&gt;    * XSL-FO - a language for formatting XML documents&lt;br /&gt;&lt;br /&gt;A common way to describe the transformation process is to say that XSLT transforms an XML source-tree into an XML result-tree.&lt;br /&gt;&lt;br /&gt;Source: http://www.w3schools.com/xsl/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-920190519515975727?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/920190519515975727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=920190519515975727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/920190519515975727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/920190519515975727'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/06/xslt.html' title='XSLT'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-3193333402447824372</id><published>2007-06-06T02:09:00.000-05:00</published><updated>2007-11-03T17:14:18.349-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTPS'/><title type='text'>Self-Signed SSL on IIS localhost</title><content type='html'>Great accomplishment to make SSL work on localhost! Worth spending couple of hours!&lt;br /&gt;&lt;br /&gt;-Copy makecert.exe from C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin to C:\&lt;br /&gt;&lt;br /&gt;-Run the below line on command window (cmd).&lt;br /&gt;&lt;br /&gt;C:\&gt;makecert -n "CN=%ComputerName%" -ss MY -sr LocalMachine -b 09/09/2006 -e 09/09/2008 -a sha1 -sky exchange -r -pe MYLocalExchangeCA.cer&lt;br /&gt;&lt;br /&gt;%ComputerName% environment variable directly grabs your computer name.&lt;br /&gt;-sky token should be "exchange".&lt;br /&gt;&lt;br /&gt;-Then, go to IIS &gt; The Web Site root &gt; Properties &gt; Directory Security &gt; Secure Communications &gt; Server Certificate &gt; "Assign an existing certificate" &gt; Choose the certificate &gt; Next until Finish. (I'm sorry if you don't see any certificates, something should be wrong.)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_rgxdINqGgsI/RmZpOgceOlI/AAAAAAAAAB0/Fgg6DEqKnAM/s1600-h/ssL1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5072857728227883602" style="MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_rgxdINqGgsI/RmZpOgceOlI/AAAAAAAAAB0/Fgg6DEqKnAM/s320/ssL1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-On the Default Web Site or a Virtual Directory, go to Directory Security tab again &gt; Secure Communications &gt; "Edit" button &amp;amp; make sure "Require Secure Channel (SSL)" is checked.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rgxdINqGgsI/RmZpXQceOmI/AAAAAAAAAB8/jPiN2OuyWRc/s1600-h/SSL2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5072857878551738978" style="MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_rgxdINqGgsI/RmZpXQceOmI/AAAAAAAAAB8/jPiN2OuyWRc/s320/SSL2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-go type https://localhost/ OR https://localhost/[virtual directory] in your browser.&lt;br /&gt;-ignore the warning&lt;br /&gt;-see your site working!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_rgxdINqGgsI/RmZpfgceOnI/AAAAAAAAACE/_BiPqdWVumI/s1600-h/SSL3.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5072858020285659762" style="MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_rgxdINqGgsI/RmZpfgceOnI/AAAAAAAAACE/_BiPqdWVumI/s320/SSL3.JPG" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-3193333402447824372?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/3193333402447824372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=3193333402447824372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/3193333402447824372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/3193333402447824372'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/06/self-signed-ssl-on-iis-localhost.html' title='Self-Signed SSL on IIS localhost'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_rgxdINqGgsI/RmZpOgceOlI/AAAAAAAAAB0/Fgg6DEqKnAM/s72-c/ssL1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-7863038090168670479</id><published>2007-05-27T01:42:00.000-05:00</published><updated>2007-11-03T17:14:57.312-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BLL'/><title type='text'>Marking BLL Dataobjects</title><content type='html'>-&lt;span style="FONT-WEIGHT: bold"&gt;CLASS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[System.ComponentModel.DataObject]&lt;br /&gt;public class ProductsBusinessLogic&lt;br /&gt;&lt;br /&gt;-&lt;span style="FONT-WEIGHT: bold"&gt;METHOD&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[System.ComponentModel.DataObjectMethodAttribute&lt;br /&gt;(System.ComponentModel.DataObjectMethodType.Select, true)]&lt;br /&gt;public ProductsDataTable GetProducts()&lt;br /&gt;&lt;br /&gt;"The DataObject attribute marks the class as being an object suitable for binding to an ObjectDataSource control, whereas the DataObjectMethodAttribute indicates the purpose of the method. As we'll see in future tutorials, ASP.NET 2.0's ObjectDataSource makes it easy to declaratively access data from a class. To help filter the list of possible classes to bind to in the ObjectDataSource's wizard, by default only those classes marked as DataObjects are shown in the wizard's drop-down list. The ProductsBLL class will work just as well without these attributes, but adding them makes it easier to work with in the ObjectDataSource's wizard."&lt;br /&gt;&lt;br /&gt;source: http://asp.net/learn/dataaccess/tutorial02cs.aspx?tabid=63&lt;br /&gt;**************&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;nullable types&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;int?&lt;br /&gt;decimal?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-7863038090168670479?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/7863038090168670479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=7863038090168670479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/7863038090168670479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/7863038090168670479'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/05/marking-bll-dataobjects.html' title='Marking BLL Dataobjects'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2852238322222319776</id><published>2007-05-25T19:28:00.000-05:00</published><updated>2007-05-25T19:31:35.562-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DAL'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO.net'/><title type='text'>Use Class Library for DAL</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Creating the Data Access Layer&lt;/span&gt;&lt;br /&gt;from http://asp.net&lt;br /&gt;&lt;br /&gt;When working with data one option is to embed the data-specific logic directly into the presentation layer (in a web application, the ASP.NET pages make up the presentation layer). This may take the form of writing ADO.NET code in the ASP.NET page's code portion or using the SqlDataSource control from the markup portion. In either case, this approach tightly couples the data access logic with the presentation layer. The recommended approach, however, is to separate the data access logic from the presentation layer. This separate layer is referred to as the Data Access Layer, DAL for short, and is typically implemented as a separate Class Library project.&lt;br /&gt;&lt;br /&gt;******************************************&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.w3schools.com/js/default.asp"&gt;W3 Schools Javascript tutorial&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2852238322222319776?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2852238322222319776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2852238322222319776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2852238322222319776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2852238322222319776'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/05/use-class-library-for-dal.html' title='Use Class Library for DAL'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-5167735056072608746</id><published>2007-05-24T01:54:00.000-05:00</published><updated>2007-11-03T17:31:24.487-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PInvoke'/><title type='text'>PInvoke (Platform Invoke)</title><content type='html'>using System;&lt;br /&gt;using System.Runtime.InteropServices;&lt;br /&gt;&lt;br /&gt;namespace TestPInvoke&lt;br /&gt;{&lt;br /&gt;    /// &lt;summary&gt;&lt;br /&gt;    /// Summary description for Class1.&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    class WrapK32&lt;br /&gt;    {&lt;br /&gt;        [DllImport("kernel32.dll")]&lt;br /&gt;        public static extern bool Beep(int frequency, int duration);&lt;br /&gt;        &lt;br /&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// The main entry point for the application.&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        [STAThread]&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            //&lt;br /&gt;            // TODO: Add code to start application here&lt;br /&gt;            //&lt;br /&gt;            Random random = new Random();&lt;br /&gt;&lt;br /&gt;            for (int i = 0; i &lt; 10000; i++)&lt;br /&gt;            {&lt;br /&gt;                Beep(random.Next(10000), 100);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-5167735056072608746?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/5167735056072608746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=5167735056072608746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5167735056072608746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5167735056072608746'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/05/pinvoke-platform-invoke.html' title='PInvoke (Platform Invoke)'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-8648893959355544991</id><published>2007-05-22T22:38:00.000-05:00</published><updated>2007-05-22T22:45:16.718-05:00</updated><title type='text'>ASP.NET authentication</title><content type='html'>ASP.NET authentication modes:&lt;br /&gt;&lt;br /&gt;Windows&lt;br /&gt;Passport&lt;br /&gt;Forms&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-8648893959355544991?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/8648893959355544991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=8648893959355544991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/8648893959355544991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/8648893959355544991'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/05/aspnet-authentication.html' title='ASP.NET authentication'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-98683948648166650</id><published>2007-05-14T10:39:00.000-05:00</published><updated>2007-05-16T10:36:00.437-05:00</updated><title type='text'>Design Patterns</title><content type='html'>Source: Design Pattern in C#, 2002 by James W Cooper&lt;br /&gt;&lt;br /&gt;"Design Patterns—Elements of Reusable Software, by Gamma,&lt;br /&gt;Helm, Johnson, and Vlissides (1995). This book, commonly referred to as&lt;br /&gt;the Gang of Four, or “GoF,” book, has had a powerful impact on those&lt;br /&gt;seeking to understand how to use design patterns and has become an all time bestseller."&lt;br /&gt;&lt;br /&gt;"Design patterns are just convenient ways of reusing object oriented&lt;br /&gt;code between projects and between programmers."&lt;br /&gt;&lt;br /&gt;"Model-View-Controller framework for Smalltalk (Krasner and Pope 1988), which divided the user interface problem into three parts, as shown in Figure 1-1. The parts were referred to as a data model, which contains the computational parts of the program; the view, which presented the user interface; and the controller, which interacted between the user and the view."&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rgxdINqGgsI/RkiHHVjMcgI/AAAAAAAAABU/UgzXUAW9RHw/s1600-h/dsgPat1.JPG"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_rgxdINqGgsI/RkiHHVjMcgI/AAAAAAAAABU/UgzXUAW9RHw/s400/dsgPat1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5064446341091717634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;"In other words, design patterns describe how objects communicate without&lt;br /&gt;become entangled in each other’s data models and methods."&lt;br /&gt;&lt;br /&gt;"Design patterns focus more on reuse of recurring architectural design&lt;br /&gt;themes, while frameworks focus on detailed design and&lt;br /&gt;implementation.” (Coplien and Schmidt 1995)"&lt;br /&gt;&lt;br /&gt;·  &lt;span style="font-weight:bold;"&gt;Creational patterns&lt;/span&gt; create objects for you rather than having you&lt;br /&gt;instantiate objects directly. This gives your program more flexibility in&lt;br /&gt;deciding which objects need to be created for a given case.&lt;br /&gt;·  &lt;span style="font-weight:bold;"&gt;Structural patterns&lt;/span&gt; help you compose groups of objects into larger&lt;br /&gt;structures, such as complex user interfaces or accounting data.&lt;br /&gt;·  &lt;span style="font-weight:bold;"&gt;Behavioral patterns&lt;/span&gt; help you define the communication between&lt;br /&gt;objects in your system and how the flow is controlled in a complex&lt;br /&gt;program.&lt;br /&gt;&lt;br /&gt;"Program to an interface and not to an implementation. &lt;br /&gt;Putting this more succinctly, you should define the top of any class&lt;br /&gt;hierarchy with an abstract class or an interface, which implements no&lt;br /&gt;methods but simply defines the methods that class will support. Then in all&lt;br /&gt;of your derived classes you have more freedom to implement these&lt;br /&gt;methods as most suits your purposes."&lt;br /&gt;&lt;br /&gt;"&lt;span style="font-weight:bold;"&gt;Object composition.&lt;/span&gt; This is simply the construction of objects that contain others:&lt;br /&gt;encapsulation of several objects inside another one."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*For example, the Listbox, DataGrid, and TreeView are introduced in the Adapter and Bridge patterns. &lt;br /&gt;*We show how to paint graphics objects in the Abstract Factory, &lt;br /&gt;*We introduce the Enumeration interface in the Iterator and in the Composite, where we also take up formatting.&lt;br /&gt;*We use exceptions in the Singleton pattern and,&lt;br /&gt;*discuss ADO.NET database connections in the Façade pattern. &lt;br /&gt;*And we show how to use C# timers in the Proxy pattern.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------&lt;br /&gt;Managed languages are &lt;span style="font-weight:bold;"&gt;garbage collected&lt;/span&gt;.&lt;br /&gt;Garbage collected languages take care of releasing unused&lt;br /&gt;memory: you never have to be concerned with this. As soon as the garbage&lt;br /&gt;collection system detects that there are no more active references to a&lt;br /&gt;variable, array or object, the memory is released back to the system. So&lt;br /&gt;you no longer need to worry as much about running out of memory&lt;br /&gt;because you allocated memory and never released it. Of course, it is still&lt;br /&gt;possible to write memory-eating code, but for the most part you do not&lt;br /&gt;have to worry about memory allocation and release problems.&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;The most significant problem is that the user &lt;span style="font-weight:bold;"&gt;interface &lt;/span&gt;and the &lt;span style="font-weight:bold;"&gt;data handling&lt;/span&gt; are combined in a single program module, rather than being handled separately. It is usually a good idea to keep the data manipulation and the interface manipulation separate so that changing interface logic doesn’t impact the computation logic and vice-versa.&lt;br /&gt;&lt;br /&gt;"We will begin class names with capital letters and instances of classes with lowercase letters. We will also spell instances and classes with a mixture of lowercase and capital letters to make their purpose clearer: swimmerTime"&lt;br /&gt;&lt;br /&gt;"In C# as well as other object oriented languages, you can have several&lt;br /&gt;class methods with the same name as long as they have different calling&lt;br /&gt;arguments or &lt;span style="font-weight:bold;"&gt;signatures&lt;/span&gt;."&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Replacing Methods Using New&lt;/span&gt;&lt;br /&gt;Another way to replace a method in a base class when you cannot declare&lt;br /&gt;the base class method as virtual is to use the new keyword in declaring the&lt;br /&gt;method in the derived class. If you do this, it effectively hides any&lt;br /&gt;methods of that name (regardless of signature) in the base class. In that&lt;br /&gt;case, you cannot make calls to the base method of that name from the&lt;br /&gt;derived class, and must put all the code in the replacement method.&lt;br /&gt;public new void draw(Graphics g) {&lt;br /&gt;g.DrawRectangle (rpen, x, y, w, h);&lt;br /&gt;g.DrawRectangle (rdPen, x +5, y+5, w, h);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;UML&lt;br /&gt;&lt;br /&gt;The symbols in front of the names indicate that member’s visibility, &lt;br /&gt;where “+” means public, &lt;br /&gt;“- ” means private, and&lt;br /&gt;“#” means protected. &lt;br /&gt;Static methods are shown underlined. &lt;br /&gt;Abstract methods may be shown in italics or with an “{abstract}” label.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Hashtables&lt;/span&gt;&lt;br /&gt;A Hashtable is a variable length array where every entry can be referred to&lt;br /&gt;by a key value.&lt;br /&gt;&lt;br /&gt;Typically, keys are strings of some sort, but they can be any sort of object. Each element must have a unique key, although the elements themselves need not be unique. Hashtables are used to allow rapid access to one of a large and unsorted set of entries, and can also be used by reversing the key and the entry values to create a list where each entry is guaranteed to be unique.&lt;br /&gt;&lt;br /&gt;Hashtable hash = new Hashtable ();&lt;br /&gt;float freddy = 12.3f;&lt;br /&gt;hash.Add ("fred", freddy); //add to table&lt;br /&gt;//get this one back out&lt;br /&gt;float temp = (float)hash["fred"];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;File Handling&lt;/span&gt;&lt;br /&gt;The file handling objects in C# provide you with some fairly flexible&lt;br /&gt;methods of handling files.&lt;br /&gt;The File Object&lt;br /&gt;The File object represents a file, and has useful methods for testing for a&lt;br /&gt;file’s existence as well as renaming and deleting a file. All of its methods&lt;br /&gt;are static, which means that you do not ( and cannot) create an instance of&lt;br /&gt;File using the new operator. Instead, you use its methods directly.&lt;br /&gt;if (File.Exists ("Foo.txt"))&lt;br /&gt;File.Delete ("foo.txt");&lt;br /&gt;You can also use the File object to obtain a FileStream for reading and&lt;br /&gt;writing file data:&lt;br /&gt;//open text file for reading&lt;br /&gt;StreamReader ts = File.OpenText ("foo1.txt");&lt;br /&gt;//open any type of file for reading&lt;br /&gt;FileStream fs = File.OpenRead ("foo2.any");&lt;br /&gt;Some of the more useful File methods are shown in the table below:&lt;br /&gt;Static method Meaning&lt;br /&gt;File.FileExists(filename) true if file exists&lt;br /&gt;File.Delete(filename) Delete the file&lt;br /&gt;File.AppendText(String) Append text&lt;br /&gt;File.Copy(fromFile, toFile) Copy a file&lt;br /&gt;File.Move(fromTile, toFile) Move a file, deleting old&lt;br /&gt;copy&lt;br /&gt;File.GetExtension(filename) Return file extension&lt;br /&gt;File.HasExtension(filename) true if file has an&lt;br /&gt;extension.&lt;br /&gt;&lt;br /&gt;Reading Text File&lt;br /&gt;To read a text file, use the File object to obtain a StreamReader object.&lt;br /&gt;Then use the text stream’s read methods:&lt;br /&gt;StreamReader ts = File.OpenText ("foo1.txt");&lt;br /&gt;String s =ts.ReadLine ();&lt;br /&gt;Writing a Text File&lt;br /&gt;To create and write a text file, use the CreateText method to get a&lt;br /&gt;StreamWriter object.&lt;br /&gt;//open for writing&lt;br /&gt;StreamWriter sw = File.CreateText ("foo3.txt");&lt;br /&gt;sw.WriteLine ("Hello file");&lt;br /&gt;If you want to append to an existing file, you can create a StreamWriter&lt;br /&gt;object directly with the Boolean argument for append set to true:&lt;br /&gt;//append to text file&lt;br /&gt;StreamWriter asw = new StreamWriter ("foo1.txt", true);&lt;br /&gt;Exceptions in File Handling&lt;br /&gt;A large number of the most commonly occurring exceptions occur in&lt;br /&gt;handling file input and output. You can get exceptions for illegal&lt;br /&gt;filenames, files that do not exist, directories that do not exist, illegal&lt;br /&gt;filename arguments and file protection errors. Thus, the best way to&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;handle file input and output is to enclose file manipulation code in Try&lt;br /&gt;blocks to assure yourself that all possible error conditions are caught, and&lt;br /&gt;thus prevent embarrassing fatal errors. All of the methods of the various&lt;br /&gt;file classes show in their documentation which methods they throw. You&lt;br /&gt;can assure yourself that you catch all of them by just catching the general&lt;br /&gt;Exception object, but if you need to take different actions for different&lt;br /&gt;exceptions, you can test for them separately.&lt;br /&gt;For example, you might open text files in the following manner:&lt;br /&gt;try {&lt;br /&gt;//open text file for reading&lt;br /&gt;StreamReader ts = File.OpenText ("foo1.txt");&lt;br /&gt;String s =ts.ReadLine ();&lt;br /&gt;}&lt;br /&gt;catch(Exception e ) {&lt;br /&gt;Console.WriteLine (e.Message );&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-98683948648166650?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/98683948648166650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=98683948648166650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/98683948648166650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/98683948648166650'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/05/design-patterns.html' title='Design Patterns'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_rgxdINqGgsI/RkiHHVjMcgI/AAAAAAAAABU/UgzXUAW9RHw/s72-c/dsgPat1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-5246673364107222476</id><published>2007-05-11T23:07:00.000-05:00</published><updated>2007-10-12T01:06:32.852-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><title type='text'>SQL Queries</title><content type='html'>Specifying Identity column:&lt;br /&gt;&lt;br /&gt;ALTER TABLE Menus&lt;br /&gt;ADD MenuID numeric(18, 0) IDENTITY NOT NULL&lt;br /&gt;&lt;br /&gt;Adding a Primary Key:&lt;br /&gt;&lt;br /&gt;ALTER TABLE Orders&lt;br /&gt;ADD CONSTRAINT PK_Orders PRIMARY KEY (OrderID)&lt;br /&gt;&lt;br /&gt;Adding a Foreign Key: (Primary Key is in 'Orders' Table)&lt;br /&gt;&lt;br /&gt;ALTER TABLE Roles_Menus&lt;br /&gt;ADD FOREIGN KEY (RoleID) REFERENCES Roles(RoleID);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-5246673364107222476?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/5246673364107222476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=5246673364107222476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5246673364107222476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5246673364107222476'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/05/sql-queries.html' title='SQL Queries'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-1697205324448199743</id><published>2007-04-29T23:05:00.000-05:00</published><updated>2007-11-03T17:40:43.301-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataReader'/><category scheme='http://www.blogger.com/atom/ns#' term='DataAdapter'/><category scheme='http://www.blogger.com/atom/ns#' term='ADO.net'/><category scheme='http://www.blogger.com/atom/ns#' term='DataSet'/><title type='text'>ADO.net - DataSet vs. DataReader</title><content type='html'>&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;ADO.net&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;DataSet vs. DataReader&lt;/li&gt;&lt;/ul&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DataReader&lt;/span&gt; [while(r.Read())]&lt;br /&gt;&lt;br /&gt;When a database query is being executed, DataReader reads the rows one by one and populates the result, let's say on the web page making the request.&lt;br /&gt;Important feature: Data is displayed as soon as partial results become available.&lt;br /&gt;-Works as read-only. Can't update the DB.&lt;br /&gt;-Always maintains connection.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DataSet&lt;/span&gt; [foreach(...)]&lt;br /&gt;&lt;br /&gt;-Important feature: Data is not displayed until the whole result of the query is received. Once we get the whole result, we can start displaying the rows of data.&lt;br /&gt;-Shouldn't be considered as a local copy of a DB. Can hold data from &lt;span style="FONT-WEIGHT: bold"&gt;different tables&lt;/span&gt; and &lt;span style="FONT-WEIGHT: bold"&gt;relate &lt;/span&gt;them.&lt;br /&gt;-Enables operations like binding.&lt;br /&gt;-Provides flexibility to create a datatable on the memory, on-the-fly.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DataAdapter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;is used to retrieve data from a DB. Can also update the DB back.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Examples: (DataSet File name: DataSet1.xsd)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DataReader example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;private void Query_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// NO SqlDataAdapter IS NEEDED!!!&lt;br /&gt;SqlConnection &lt;span style="FONT-WEIGHT: bold"&gt;objConn &lt;/span&gt;= new SqlConnection();&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;objConn&lt;/span&gt;.ConnectionString = "Data Source=hc\\sqlexpress; integrated security=SSPI; Initial Catalog=ContructionProject";&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;objConn&lt;/span&gt;.Open();&lt;br /&gt;SqlCommand &lt;span style="FONT-WEIGHT: bold"&gt;objCmd &lt;/span&gt;= new SqlCommand("myStoredP_1", &lt;span style="FONT-WEIGHT: bold"&gt;objConn&lt;/span&gt;);&lt;br /&gt;objCmd.CommandType = System.Data.CommandType.StoredProcedure;&lt;br /&gt;&lt;br /&gt;SqlDataReader &lt;span style="FONT-WEIGHT: bold"&gt;myreader &lt;/span&gt;= &lt;span style="FONT-WEIGHT: bold"&gt;objCmd&lt;/span&gt;.ExecuteReader();&lt;br /&gt;&lt;br /&gt;while (&lt;span style="FONT-WEIGHT: bold"&gt;myreader&lt;/span&gt;.Read())&lt;br /&gt;{&lt;br /&gt;listBox1.Items.Add(myreader[0].ToString()+" " + myreader[1].ToString());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;objConn.Close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DataSet example with Fill() method:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;private void myDataSet_Query_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;SqlConnection &lt;span style="FONT-WEIGHT: bold"&gt;objConn &lt;/span&gt;= new SqlConnection();&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;objConn&lt;/span&gt;.ConnectionString = "Data Source=hc\\sqlexpress; integrated security=SSPI; Initial Catalog=ContructionProject";&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;objConn&lt;/span&gt;.Open();&lt;br /&gt;SqlCommand objCmd = new SqlCommand("myStoredP_1", &lt;span style="FONT-WEIGHT: bold"&gt;objConn&lt;/span&gt;);&lt;br /&gt;objCmd.CommandType = System.Data.CommandType.StoredProcedure;&lt;br /&gt;&lt;br /&gt;SqlDataAdapter &lt;span style="FONT-WEIGHT: bold"&gt;a&lt;/span&gt; = new SqlDataAdapter(objCmd);&lt;br /&gt;DataSet1 &lt;span style="FONT-WEIGHT: bold"&gt;s&lt;/span&gt; = new DataSet1();&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;a&lt;/span&gt;.Fill(&lt;span style="FONT-WEIGHT: bold"&gt;s&lt;/span&gt;,&lt;span style="FONT-WEIGHT: bold"&gt; s&lt;/span&gt;.myStoredP_1.TableName);&lt;br /&gt;&lt;br /&gt;foreach (DataSet1.myStoredP_1Row &lt;span style="FONT-WEIGHT: bold"&gt;dr&lt;/span&gt; in &lt;span style="FONT-WEIGHT: bold"&gt;s&lt;/span&gt;.myStoredP_1.Rows)&lt;br /&gt;{&lt;br /&gt;MessageBox.Show(dr.FName.ToString());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//foreach (DataRow dr in s.Tables[0].Rows)&lt;br /&gt;//{&lt;br /&gt;// MessageBox.Show(dr[1].ToString() + dr[0].ToString());&lt;br /&gt;//} /*This foreach loop works as well*/&lt;br /&gt;&lt;br /&gt;objConn.Close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;DataSet example with GetData() method:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;private void DataSet_GetData_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// NO NEED TO USE SQLCOMMAND OR CONNECTION STRING!!&lt;br /&gt;&lt;br /&gt;DataSet1 &lt;span style="FONT-WEIGHT: bold"&gt;dseg&lt;/span&gt; = new DataSet1();&lt;br /&gt;DataSet1TableAdapters.myStoredP_1TableAdapter &lt;span style="FONT-WEIGHT: bold"&gt;egAdap&lt;/span&gt; = new DataSet1TableAdapters.myStoredP_1TableAdapter();&lt;br /&gt;&lt;br /&gt;DataSet1.myStoredP_1DataTable &lt;span style="FONT-WEIGHT: bold"&gt;dt&lt;/span&gt; = &lt;span style="FONT-WEIGHT: bold"&gt;egAdap&lt;/span&gt;.GetData();&lt;br /&gt;foreach (DataSet1.myStoredP_1Row &lt;span style="FONT-WEIGHT: bold"&gt;dr&lt;/span&gt; in dt.Rows)&lt;br /&gt;{&lt;br /&gt;listBox1.Items.Add(dr.ID + " " + dr.FName);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;* ADO.net does not support &lt;span style="FONT-WEIGHT: bold"&gt;bulk &lt;/span&gt;inserts to the DB!&lt;br /&gt;* System.Data namespaces: SqlClient, OleDb, ODBC, OracleClient&lt;br /&gt;* Use of ODBC is discouraged because it is slow, unsecure and has limited functionality.&lt;br /&gt;* Oracle: No &lt;span style="FONT-WEIGHT: bold"&gt;multiple &lt;/span&gt;SELECT statements!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-1697205324448199743?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/1697205324448199743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=1697205324448199743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1697205324448199743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1697205324448199743'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/class-notes-april-29-1-of.html' title='ADO.net - DataSet vs. DataReader'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-5453132829388688171</id><published>2007-04-27T22:18:00.000-05:00</published><updated>2007-10-12T01:05:40.903-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# programming notes</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_rgxdINqGgsI/RjLVzVjMcfI/AAAAAAAAABM/09MLLhOZ1T0/s1600-h/TernaryOperator.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5058340409425293810" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_rgxdINqGgsI/RjLVzVjMcfI/AAAAAAAAABM/09MLLhOZ1T0/s400/TernaryOperator.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Two references to the same object--Interesting!!!&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_rgxdINqGgsI/RjLVkFjMcdI/AAAAAAAAAA8/Z0etVuBwkbo/s1600-h/CS_ref1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5058340147432288722" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_rgxdINqGgsI/RjLVkFjMcdI/AAAAAAAAAA8/Z0etVuBwkbo/s400/CS_ref1.JPG" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_rgxdINqGgsI/RjLVqVjMceI/AAAAAAAAABE/Q9dhGcc-9Pg/s1600-h/CS_ref2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5058340254806471138" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_rgxdINqGgsI/RjLVqVjMceI/AAAAAAAAABE/Q9dhGcc-9Pg/s400/CS_ref2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Source: C# 2005 for Dummies, Wiley.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-5453132829388688171?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/5453132829388688171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=5453132829388688171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5453132829388688171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5453132829388688171'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/c-programming-notes.html' title='C# programming notes'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_rgxdINqGgsI/RjLVzVjMcfI/AAAAAAAAABM/09MLLhOZ1T0/s72-c/TernaryOperator.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-1492950184883551609</id><published>2007-04-27T22:10:00.000-05:00</published><updated>2007-11-03T17:41:52.837-06:00</updated><title type='text'>Important Subjects</title><content type='html'>Single point of failure&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Load balancing&lt;br /&gt;&lt;br /&gt;High-availability&lt;br /&gt;&lt;br /&gt;Caching&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;thin client&lt;br /&gt;&lt;br /&gt;thick client&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Replay Attacks&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Proxy&lt;br /&gt;&lt;br /&gt;Credentials&lt;br /&gt;&lt;br /&gt;Single sign-on&lt;br /&gt;&lt;br /&gt;ClearTrust&lt;br /&gt;Strong password -Weak password&lt;br /&gt;&lt;br /&gt;Connection Pool&lt;br /&gt;&lt;br /&gt;Windows Service&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-1492950184883551609?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/1492950184883551609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=1492950184883551609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1492950184883551609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1492950184883551609'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/class-notes-april-22-4-of.html' title='Important Subjects'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-4026396277096963000</id><published>2007-04-23T17:52:00.002-05:00</published><updated>2007-11-03T17:42:22.281-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='config'/><title type='text'>Web.config</title><content type='html'>WEB.CONFIG file in a web application&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Allow / Deny users&lt;/li&gt;&lt;/ul&gt;Below code will deny access to the &lt;span style="FONT-WEIGHT: bold"&gt;anonymous &lt;/span&gt;users and Windows users with a &lt;span style="FONT-WEIGHT: bold"&gt;Guests Role.&lt;/span&gt; However, the user &lt;span style="FONT-WEIGHT: bold"&gt;yyyy &lt;/span&gt;under &lt;span style="FONT-WEIGHT: bold"&gt;xxx &lt;/span&gt;domain will be granted access.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;allow users="xxx\yyyy"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;deny users="?"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;deny roles="Guests"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;WARNING!&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;allow users="*"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;deny users="yyyy"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Due to the design of .NET, the above will grant access to &lt;span style="FONT-WEIGHT: bold"&gt;all authenticated users&lt;/span&gt; even though yyyy seems to be denied!&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;When WEB.CONFIG is updated&lt;/span&gt; (even with an insignificant change, like addition of a space character) &lt;/li&gt;&lt;/ul&gt;-The entire web application will be forced to restart This is an enhancement over .NET 1.1&lt;br /&gt;-What if, I don't want my application to restart each time an update is made to WEB.CONFIG in .NET 2.0?&lt;br /&gt;Solution: Create another &lt;span style="FONT-WEIGHT: bold"&gt;configuration file&lt;/span&gt; like easy.config and put the most frequently changing setting in this file.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;appsettings configsource="easy.config"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Good practice: Create a seperate config file for &lt;span style="FONT-WEIGHT: bold"&gt;Connection Strings&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Adding a key &amp;amp; value pair in WEB.CONFIG:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;appSettings&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;add key="x" value="5"/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;/appSettings&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Publishing the site &lt;span style="FONT-WEIGHT: bold"&gt;locally&lt;/span&gt;:&lt;/li&gt;&lt;/ul&gt;This is also an enhancement in .NET 2.0. Whenever we publish the site locally, the .NET framework creates a .dll and the .aspx files for our access.&lt;br /&gt;This is especially useful if we don't have IIS (Internet Information Services) installed.&lt;br /&gt;We can easily debug our web application in our local PC.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Reconfiguration of ASP.NET: (a real-time problem)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In some instances, we may need to reconfigure ASP.NET.&lt;br /&gt;(For example, if the IIS was installed later than ASP.NET.)&lt;br /&gt;&lt;br /&gt;run the ASP.NET reconfiguration utility:&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;&gt; aspnet_regiis.exe -u (for uninstallation)&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;&gt; aspnet_regiis.exe -i (for installation)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;BONUS knowledge for IIS: &lt;/li&gt;&lt;/ul&gt;Suppose that somebody is continuously trying to access your ftp site.&lt;br /&gt;The person is not granted access but the bandwidth will be used unwantedly.&lt;br /&gt;I can get the IP address of this unwanted internet user by checking my log file. And I want to block this IP addresss from my ftp site.&lt;br /&gt;IIS&lt;span style="FONT-WEIGHT: bold"&gt; can not&lt;/span&gt; do this! (Even though it can not, it is good to know :) )&lt;br /&gt;However, this IP-denial can be achieved in &lt;span style="FONT-WEIGHT: bold"&gt;proxy-level&lt;/span&gt;. HOW??&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-4026396277096963000?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/4026396277096963000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=4026396277096963000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/4026396277096963000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/4026396277096963000'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/class-notes-april-22-3-of.html' title='Web.config'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-5169783074792547386</id><published>2007-04-23T17:52:00.001-05:00</published><updated>2007-11-03T17:42:55.285-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='Remoting'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='disco'/><category scheme='http://www.blogger.com/atom/ns#' term='wsdl'/><title type='text'>NET Remoting, Web Services etc.</title><content type='html'>&lt;div style="TEXT-ALIGN: center"&gt;Web Service concepts&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;.NET Remoting&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;It is mainly related to interprocess communication.&lt;br /&gt;The processes can be within the same computer, computers on the same network or even the computers across different networks.&lt;br /&gt;.NET Remoting enables these remote processes to communicate with each other.&lt;br /&gt;.NET Remoting supports communication over different protocols.&lt;br /&gt;&lt;br /&gt;In the past, the interprocess communication was handled by DCOM (Distributed-Component Object Model). But DCOM did not support different platforms and had some drawbacks related to firewalls. It communicated over ports that are usually blocked by firewalls. (can we still call the firewall a "firewall" if many ports are open?? ) Port 80 might be used but in that case, the firewall has to support &lt;span style="FONT-WEIGHT: bold"&gt;binary traffic&lt;/span&gt; on port 80. (Q: What is binary traffic?)&lt;br /&gt;&lt;br /&gt;Now that we have some practice with Web Services, we can compare it to .NET Remoting.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;What was Web Services anyway??&lt;/span&gt;&lt;br /&gt;-Web Services enable applications to pass messages to each other regardless of their &lt;span style="FONT-WEIGHT: bold"&gt;platform&lt;/span&gt;, &lt;span style="FONT-WEIGHT: bold"&gt;programming language&lt;/span&gt; and &lt;span style="FONT-WEIGHT: bold"&gt;object model. &lt;/span&gt;&lt;br /&gt;-Web services know nothing about the client making the request.&lt;br /&gt;-It only receives a message and responds to it in a format called &lt;span style="FONT-WEIGHT: bold"&gt;SOAP &lt;/span&gt;(Simple Object Access Protocol).&lt;br /&gt;&lt;br /&gt;*Web Services &lt;span style="FONT-WEIGHT: bold"&gt;ONLY &lt;/span&gt;use &lt;span style="FONT-WEIGHT: bold"&gt;HTTP &lt;/span&gt;protocol to communicate. .NET Remoting can use any protocol!&lt;br /&gt;*Web Services is &lt;span style="FONT-WEIGHT: bold"&gt;stateless &lt;/span&gt;and creates a &lt;span style="FONT-WEIGHT: bold"&gt;new object&lt;/span&gt; each time it receives a request. .NET Remoting has state management options, supports &lt;span style="FONT-WEIGHT: bold"&gt;callbacks&lt;/span&gt;.&lt;br /&gt;*Objects are serialized using XML included in SOAP messages. No other way than XML in Web Services. .NET Remoting does not work if the data types are not defined. This is a limit to using different data types if there is not support for it. However, objects can be passed by value or by reference.&lt;br /&gt;*Web Services can operate across different platforms. .NET Remoting requires the applications built on .NET.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In .NET remoting, the communication occurs over &lt;span style="FONT-WEIGHT: bold"&gt;channels&lt;/span&gt;. The applications use the channels to send or receive messages. There are two existing channels: TcpChannel and HttpChannel in .NET Remoting.&lt;br /&gt;&lt;br /&gt;Below is a snapshot of the application I have tested. The one on top is the Server. The window at the bottom is the client making the request. The Server responds to the client with a message.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_rgxdINqGgsI/RjAvA1jMcbI/AAAAAAAAAAs/A3j5dFQfglE/s1600-h/netremoting2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5057594072958267826" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_rgxdINqGgsI/RjAvA1jMcbI/AAAAAAAAAAs/A3j5dFQfglE/s400/netremoting2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Links:&lt;br /&gt;http://www.developer.com/net/cplus/article.php/10919_1479761_1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;SOAP (Simple Object Access Protocol)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;SOAP is a protocol that enables the applications to communicate across the computer networks.&lt;br /&gt;The communication is achieved by using XML format.&lt;br /&gt;The communication occurs usually using HTTP.&lt;br /&gt;&lt;br /&gt;Below is a snapshot of the soap messages created by the HelloWorld Web Service that we have created. The top block makes the request and the bottom block displays the corresponding response.&lt;br /&gt;Note that, only the return &lt;span style="FONT-WEIGHT: bold"&gt;types &lt;/span&gt;are specified, &lt;span style="FONT-WEIGHT: bold"&gt;not &lt;/span&gt;the returned &lt;span style="FONT-WEIGHT: bold"&gt;values&lt;/span&gt;. Because the Web Service method has not been &lt;span style="FONT-WEIGHT: bold"&gt;invoked &lt;/span&gt;yet.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_rgxdINqGgsI/RjAykFjMccI/AAAAAAAAAA0/B5dsoLSFx2U/s1600-h/soap.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5057597977083539906" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_rgxdINqGgsI/RjAykFjMccI/AAAAAAAAAA0/B5dsoLSFx2U/s400/soap.JPG" border="0" /&gt;&lt;/a&gt;OK, SOAP does this, SOAP does that. Where does this all fit in real-world? Where do I use SOAP? Please add the best practices of using SOAP to my post here.&lt;br /&gt;There is one application I can only guess for the time being. It might not be correct though.&lt;br /&gt;Let's take the example of a Small Business web site. Assume that, this site is selling computer parts. Nowadays, we see that there are options on the web site when we are about to make a purchase, like "Click here to check how many items are available." When you click this link, the small business web site connects to the Distributor's web site or database and queries the most current value. Of course, the distributor wouldn' t prefer to provide access to their database to everyone. They would prefer an interface instead. So, these kind of messaging between different web sites might be good application for SOAP. Remember, it is just my understanding and might not be true.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;XML (Extensible Mark-up Language)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;XML is like HTML. The main difference is that we can specify and use our own tags.&lt;br /&gt;Every tag has to have a closing tag OR needs to be self-closing, using the forward slash /.&lt;br /&gt;Needs to conform to the rules of being &lt;span style="FONT-WEIGHT: bold"&gt;Well-formed&lt;/span&gt;.&lt;br /&gt;Needs to be &lt;span style="FONT-WEIGHT: bold"&gt;valid&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;For months, I have not understood why XML became so popular! You see books written on XML everywhere, people talk about it etc. Still having trouble understanding it.&lt;br /&gt;&lt;br /&gt;For example, Microsoft has released Small Business Starter Kit in ASP.NET. Using this kit, you can advertise your products, display their pictures, specify the price, edit the definition etc. All these features of the product are defined within an XML file. You can easily edit these attributes I mentioned (item definition, price etc.) even by a text editor. For instance, the previous price of item A is $1175, then open the XML file and easily change it to $1250. But, what if you need to update each of the one-thousand items' prices?! See my post in ASP.NET forums. &lt;a href="http://forums.asp.net/thread/1408825.aspx"&gt;http://forums.asp.net/thread/1408825.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My only understanding is that, the XML format is both &lt;span style="FONT-WEIGHT: bold"&gt;machine&lt;/span&gt; and &lt;span style="FONT-WEIGHT: bold"&gt;human readable&lt;/span&gt; format. Everything is written in simple text and there is no encryption. For instance, you can not easily access a database so easily; you need to have at least MS Access installed to access your tables, in case of an Access Database. SQL server requires correct connection string, username/password etc. Why bother with these? Open the XML document with your Notepad and reach the information you need and even edit the file yourself!&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;WSDL (Web Service Definition Language) - wsdl.exe&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;-Having its description based on XML, WSDL defines the communication used on Web Services.&lt;br /&gt;-The services are described as a collection of ports (or network endpoints).&lt;br /&gt;-The definitions are abstract and they are separated from the actual use which clarifies the ports being used at that instance. This allows to use the same codes again and again.&lt;br /&gt;-The client connects to the web site and uses WSDL to discover what services are offered.&lt;br /&gt;-After determining the available services, one of the functions or methods can be called using SOAP.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Web Services Discovery Tool - disco.exe&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;-Discovers (queries, interrogates) and saves the documents of each of the XML Web Services in a particular web site to the local disk.&lt;br /&gt;-disco.exe and wsdl.exe are used in conjunction with the web services.&lt;br /&gt;-Produces .wsdl, .disco, .xsd and .discomap files which can later be used by wsdl.exe as an input to create XML Web Service clients.&lt;br /&gt;1. Use disco.exe to discover available services and download&lt;br /&gt;2. Then use wsdl.exe to produce the proxy files.&lt;br /&gt;3. Compile the project.&lt;br /&gt;&lt;br /&gt;Generating a proxy class for our code (When we are not allowed to add a web reference)&lt;br /&gt;&gt; &lt;span style="FONT-WEIGHT: bold"&gt;wsdl &lt;/span&gt;/out:C:\Webservice_HelloWorld.cs C:\Webservice_HelloWorld.wsdl&lt;br /&gt;&lt;br /&gt;1. wsdl parses the web service description.&lt;br /&gt;2. Generates proxy classes.&lt;br /&gt;3. Consumer uses these proxy classes to call the methods of that particular web service.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.exforsys.com/tutorials/vb.net-2005/instantiating-invoking-web-services-creating-proxy-classes-with-wsdl.html"&gt;A useful link for above process.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-Not all web services have to provide support for public discovery. It can be used privately.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;UDDI (Universal Description Discovery and Integration)&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;is an XML-based registry for businesses to list their company on the internet.&lt;br /&gt;The companies can list themselves with name, location... and the web services they offer.&lt;br /&gt;By this way, companies can have their systems inter-operating with other companies.&lt;br /&gt;&lt;br /&gt;Case study: Different types of digital photography software do not inter operate and many people find it difficult to print their digital photos. The companies producing digital cameras have come together to support networks where end-users can easily have their digital photos printed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-5169783074792547386?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/5169783074792547386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=5169783074792547386' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5169783074792547386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5169783074792547386'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/class-notes-april-22-2-of.html' title='NET Remoting, Web Services etc.'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_rgxdINqGgsI/RjAvA1jMcbI/AAAAAAAAAAs/A3j5dFQfglE/s72-c/netremoting2.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2499504407794148808</id><published>2007-04-23T17:12:00.000-05:00</published><updated>2007-11-03T17:43:51.460-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='foreach'/><category scheme='http://www.blogger.com/atom/ns#' term='reflections'/><title type='text'>Delegates, Reflections, INVOKE</title><content type='html'>&lt;span style="FONT-WEIGHT: bold"&gt;Delegates&lt;/span&gt;:&lt;br /&gt;-Similar to pointers in C++.&lt;br /&gt;-Has something to do with &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;Callback &lt;/span&gt;functions.&lt;br /&gt;-Generic delegate copy is created at the run-time.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Reflections:&lt;/span&gt;&lt;br /&gt;-Enables us to query the namespaces, methods...&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;foreach&lt;/span&gt; statement:&lt;br /&gt;-Quite useful when there is an &lt;span style="FONT-WEIGHT: bold"&gt;array &lt;/span&gt;of strings, or an &lt;span style="FONT-WEIGHT: bold"&gt;array &lt;/span&gt;of &lt;span style="FONT-WEIGHT: bold"&gt;int&lt;/span&gt;s, or an &lt;span style="FONT-WEIGHT: bold"&gt;array &lt;/span&gt;of objects to talk about. Simply, an array of something.&lt;br /&gt;&lt;br /&gt;Below program section makes use of the &lt;span style="FONT-WEIGHT: bold"&gt;Reflections &lt;/span&gt;and &lt;span style="FONT-WEIGHT: bold"&gt;foreach &lt;/span&gt;statement and used to query the methods in a .dll file. The methods are added to the listbox in the Windows form.&lt;br /&gt;&lt;br /&gt;Notice the return types of below methods: They are &lt;span style="FONT-WEIGHT: bold"&gt;array&lt;/span&gt;s.&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Type[]&lt;/span&gt; Assembly.GetTypes();&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;MethodInfo[]&lt;/span&gt; Type.GetMethods();&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="FONT-FAMILY: courier new"&gt;private void Discover_button_Click_1(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;System.Reflection.Assembly cx = System.Reflection.Assembly.LoadFile(textBox1.Text);&lt;br /&gt;&lt;br /&gt;foreach (Type t in cx.GetTypes())&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;foreach( System.Reflection.MethodInfo mi in t.GetMethods())&lt;br /&gt;{&lt;br /&gt;listBox1.Items.Add(mi.Name);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;Use the code below to easily select the .dll file you need. Don't forget to add a &lt;span style="FONT-WEIGHT: bold"&gt;OpenFileDialog &lt;/span&gt;and an Open File &lt;span style="FONT-WEIGHT: bold"&gt;button &lt;/span&gt;to your design.&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="FONT-FAMILY: courier new"&gt;private void OpenFile_button_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;openFileDialog1.ShowDialog();&lt;br /&gt;string filename = openFileDialog1.FileName;&lt;br /&gt;textBox1.Text = filename;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;BONUS QUESTION:&lt;/span&gt;&lt;br /&gt;-We have queried the methods in our CalculateInterest Class Library. The query produced two methods: CalculateSimpleInterest() &amp;amp; CalculateCompoundInterest().&lt;br /&gt;-Now, how can we actually &lt;span style="FONT-WEIGHT: bold"&gt;run &lt;/span&gt;the CalculateSimpleInterest() method and learn the interest for a given principal, rate and time?&lt;br /&gt;&lt;br /&gt;We have to INVOKE this function to achieve the above purpose.&lt;br /&gt;Research &lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;Activator.Getobject()&lt;/span&gt; method!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2499504407794148808?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2499504407794148808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2499504407794148808' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2499504407794148808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2499504407794148808'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/class-notes-april-22-1-of.html' title='Delegates, Reflections, INVOKE'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-5251207516283843196</id><published>2007-04-19T17:33:00.000-05:00</published><updated>2007-04-19T18:10:11.251-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UML'/><title type='text'>UML: Unified-Modeling Language</title><content type='html'>Defined by OMG (Object Management Group).&lt;br /&gt;Set of graphical components that &lt;span style="font-style: italic; font-weight: bold;"&gt;model &lt;/span&gt;the &lt;span style="font-weight: bold;"&gt;objects &lt;/span&gt;and the &lt;span style="font-weight: bold;"&gt;relationships &lt;/span&gt;between them.&lt;br /&gt;&lt;br /&gt;Let's consider the case of construction business.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Architects &lt;/span&gt;design the buildings and &lt;span style="font-weight: bold;"&gt;builders &lt;/span&gt;use these designs to realize what is described in the blueprints. Blueprints are a common language between architects and the builders.&lt;br /&gt;&lt;br /&gt;Similarly, UML standard is a &lt;span style="font-weight: bold;"&gt;common language&lt;/span&gt; between all software developers. Apart from the implementations, all members of a team can see the classes and objects used in the design, which is especially useful in situations where the design is quite complex.&lt;br /&gt;&lt;br /&gt;UML has nine modelling diagrams. The first three are below:&lt;br /&gt;&lt;br /&gt;&lt;span id="ArticleLabel"&gt;&lt;li&gt;&lt;a href="http://dn.codegear.com/article/31863#use-case-diagram"&gt;Use case diagrams&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 40px;"&gt;Describes &lt;span style="font-weight: bold;"&gt;what &lt;/span&gt;a specific model &lt;span style="font-weight: bold;"&gt;does&lt;/span&gt;. (Not &lt;span style="font-weight: bold;"&gt;how &lt;/span&gt;it does that!)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://dn.codegear.com/article/31863#classdiagrams"&gt;Class diagrams&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 40px;"&gt;Displays all of the classes in a system and the inter-relationships between classes. Name, Attributes and Operations of each class are displayed. (Does not give any idea what happens when the classes interact!)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://dn.codegear.com/article/31863#object-diagrams"&gt;Object diagrams&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 40px;"&gt;Displays the objects being used, instead of classes. (An object is an instance of a class) Like a university has multiple departments, we can have multiple objects of the same class. Object diagrams display all of the objects in the system.&lt;/li&gt;&lt;/span&gt;&lt;br /&gt;Source: &lt;a href="http://dn.codegear.com/article/31863"&gt;http://dn.codegear.com/article/31863&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-5251207516283843196?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/5251207516283843196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=5251207516283843196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5251207516283843196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/5251207516283843196'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/uml-unified-modeling-language.html' title='UML: Unified-Modeling Language'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-6720936697631195626</id><published>2007-04-18T22:53:00.000-05:00</published><updated>2007-11-03T17:24:34.005-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Doomsday'/><category scheme='http://www.blogger.com/atom/ns#' term='Anchor'/><title type='text'>4. Finding the Weekday of a Given Date</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_rgxdINqGgsI/Ribr9NI-RLI/AAAAAAAAAAk/WR5H5nUaCps/s1600-h/DayFinder_cengizpasa2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5054987068501804210" style="DISPLAY: block; MARGIN: 0px 75px 33px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_rgxdINqGgsI/Ribr9NI-RLI/AAAAAAAAAAk/WR5H5nUaCps/s400/DayFinder_cengizpasa2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Is April 18, 2007 a &lt;span style="FONT-WEIGHT: bold"&gt;Wednesday&lt;/span&gt;?&lt;br /&gt;This program asks the user to enter a random date, like 4/18/2007.&lt;br /&gt;Then it will tell you the weekday, like Wednesday.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I am encouraging the readers of this title to refer to &lt;a href="http://www.theworldofstuff.com/other/day.html"&gt;this link&lt;/a&gt; first. It is the source for my implementation. It is a more general approach rather than a simple calculation.&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Program.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;using System;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;using System.Text;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;namespace DayFinder&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Date D = new Date(); // Don't need my coding to define the constructor.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Console.Write("Enter month: ");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;D.month = uint.Parse(Console.ReadLine());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Console.Write("Enter day: ");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;D.day = uint.Parse(Console.ReadLine());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Console.Write("Enter year (yyyy): ");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;D.year = uint.Parse(Console.ReadLine());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Console.WriteLine("You have entered: "+D.month+"/"+D.day+"/"+D.year);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;//Assuming the entries are legal:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/*********************************************&lt;br /&gt;For July 13, 1989:&lt;br /&gt;1. Divide the last two digits of the year by 12. 89 divided by 12 is 7, with 5 left over.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;2. Find how many 4's go into the remainder evenly. 5 divided by 4 is 1, with a remainder that we ignore.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;3. Add these three numbers. 7 + 5 + 1 = 13.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;4. Divide the sum by 7 and take the remainder. 13 divided by 7 is 1, with a remainder of 6.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;5. Add the remainder to the century's anchor day to find the year's Doomsday. Wendesday + 6 = Tuesday.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;6. Use the month's Doomsday to find the day you need. July's Doomsday is 7/11, a Tuesday, so July 13 is a Thursday.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Source: http://www.theworldofstuff.com/other/day.html&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;*********************************************************/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint yearTwoDigits = D.year % 100;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint ydivision = yearTwoDigits / 12;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint yremainder = yearTwoDigits % 12;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint NumberOfFours = yremainder / 4;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint FinalRemainder = (ydivision + yremainder + NumberOfFours) % 7;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint AnchorDay = UtilityFunctions.GetAnchorDay(((uint) (D.year/100) * 100) % 400);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint YearsDoomsDay = (FinalRemainder + AnchorDay) % 7;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int difference = (int) D.day - (int) UtilityFunctions.GetMonthsDoomsDay(D.month, D.year);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int ExactDay = (int) YearsDoomsDay + difference; //Need typecasting&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if (ExactDay &lt;0) face="courier new"&gt;ExactDay += 7;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;else if (ExactDay &gt; 7)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ExactDay=ExactDay % 7;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;string WeekDay=UtilityFunctions.GetExactDay(ExactDay);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Console.WriteLine("This date is a "+WeekDay);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Console.Read();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;// Logic Errors: 2/29/2007 =&gt; Thursday. There is no such 2/29 in 2007!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;// Day undefined for 7/3/1989!&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;UtilityFunc.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;using System;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;using System.Text;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;namespace DayFinder&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;class Date&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public uint month; //public is needed!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public uint day;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public uint year;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;class UtilityFunctions&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;public static uint GetAnchorDay(&lt;/span&gt;uint &lt;span style="FONT-WEIGHT: bold"&gt;AnchorCheck)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;uint AnchorDay= 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;switch (AnchorCheck)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 100:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;AnchorDay = 0; //"Sunday"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 200:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;AnchorDay = 5; //"Friday"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 300:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;AnchorDay = 3; //"Wednesday"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 0:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;AnchorDay = 2; //"Tuesday"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;return AnchorDay;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;public static int GetMonthsDoomsDay(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;uint &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;Month, &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;uint &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;Year)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int DoomsDay = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;switch (Month)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 1: //January&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 3 + (int)isLeap(Year);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 2: //February&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 28;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 3: //...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 4:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 4;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 5:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 9;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 6:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 6;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 7:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 11;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 8:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 8;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 9:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 5;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 10:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 10;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 11:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 7;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 12:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DoomsDay = 12;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;return DoomsDay;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;internal static uint isLeap(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;uint &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;Year)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if ((Year % 4) == 0) return 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;else return 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;public static string GetExactDay(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;int &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;ExactDay)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;string WeekDay=null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;switch (ExactDay)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 0:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Sunday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 1:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Monday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 2:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Tuesday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 3:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Wednesday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 4:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Thursday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 5:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Friday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case 6:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WeekDay = "Saturday";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;return WeekDay;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;}&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-6720936697631195626?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/6720936697631195626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=6720936697631195626' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/6720936697631195626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/6720936697631195626'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/4th-program-finding-weekday-of-given.html' title='4. Finding the Weekday of a Given Date'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_rgxdINqGgsI/Ribr9NI-RLI/AAAAAAAAAAk/WR5H5nUaCps/s72-c/DayFinder_cengizpasa2.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-1671532989285546282</id><published>2007-04-18T15:48:00.000-05:00</published><updated>2007-10-12T01:03:53.240-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linked list'/><title type='text'>3. Doubly-linked list</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/en/d/d8/Doublylinkedlist.png"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 45px; WIDTH: 450px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://upload.wikimedia.org/wikipedia/en/d/d8/Doublylinkedlist.png" border="0" /&gt;&lt;/a&gt;In addition to the properties of the singly-linked list, each node in a doubly-linked list contains a link to the previous node in the chain.&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Program.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Doubly_LinkedList&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;char Answer = 'y';&lt;br /&gt;Node n;&lt;br /&gt;Node head = new Node();&lt;br /&gt;Node currNode;&lt;br /&gt;Node TempNode;&lt;br /&gt;currNode = head;&lt;br /&gt;&lt;br /&gt;while (Answer == 'y')&lt;br /&gt;{&lt;br /&gt;n = new Node();&lt;br /&gt;Console.Write("Enter Node Data: ");&lt;br /&gt;n.Data = int.Parse(Console.ReadLine());&lt;br /&gt;TempNode = currNode;&lt;br /&gt;currNode.Next = n;&lt;br /&gt;currNode = n;&lt;br /&gt;currNode.Prev = TempNode;&lt;br /&gt;&lt;br /&gt;Console.Write("Answer (y/n): ");&lt;br /&gt;Answer = char.Parse(Console.ReadLine());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Console.WriteLine("Printing the Node Data: (Forward)");&lt;br /&gt;&lt;br /&gt;TempNode = head;&lt;br /&gt;while (TempNode.Next != null)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;TempNode = TempNode.Next;&lt;br /&gt;Console.WriteLine(TempNode.Data);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Console.WriteLine("Printing the Node Data: (BACKward)");&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(currNode.Data);&lt;br /&gt;currNode = currNode.Prev;&lt;br /&gt;} while (currNode != head);&lt;br /&gt;&lt;br /&gt;Console.Read();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Node.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;blockquote style="FONT-FAMILY: courier new"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Doubly_LinkedList&lt;br /&gt;{&lt;br /&gt;class Node&lt;br /&gt;{&lt;br /&gt;public Node()&lt;br /&gt;{&lt;br /&gt;Data = 0;&lt;br /&gt;Next = null;&lt;br /&gt;Prev = null;&lt;br /&gt;}&lt;br /&gt;public int Data;&lt;br /&gt;public Node Next;&lt;br /&gt;public Node Prev;&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-1671532989285546282?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/1671532989285546282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=1671532989285546282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1671532989285546282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/1671532989285546282'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/3rd-program-doubly-linked-list.html' title='3. Doubly-linked list'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-3943754273330871053</id><published>2007-04-18T15:10:00.000-05:00</published><updated>2007-10-12T01:04:05.567-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linked list'/><title type='text'>2. Singly-linked list</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/commons/3/37/Singly_linked_list.png"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://upload.wikimedia.org/wikipedia/commons/3/37/Singly_linked_list.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Each node consists of one data member and one link to the next node. The last node in the chain will always point to a &lt;span style="FONT-WEIGHT: bold"&gt;null &lt;/span&gt;value.&lt;br /&gt;&lt;br /&gt;My implementation consists of two cs files including two classes.&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Program.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;namespace&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;myLinkedList&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;args&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;char Answer='y';&lt;br /&gt;Node n;&lt;br /&gt;Node head=new Node();&lt;br /&gt;Node &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;currNode&lt;/span&gt;;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;currNode&lt;/span&gt; = head;&lt;br /&gt;&lt;br /&gt;while (Answer == 'y')&lt;br /&gt;{&lt;br /&gt;n = new Node();&lt;br /&gt;Console.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;WriteLine&lt;/span&gt;("Enter Node Data:");&lt;br /&gt;n.Data = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;currNode&lt;/span&gt;.Next = n;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;currNode&lt;/span&gt; = n;&lt;br /&gt;&lt;br /&gt;Console.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;WriteLine&lt;/span&gt;("Answer (y/n): ");&lt;br /&gt;Answer=char.Parse(Console.ReadLine());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Console.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;WriteLine&lt;/span&gt;("Printing the Node Data:");&lt;br /&gt;&lt;br /&gt;while (head.Next != null)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;head = head.Next;&lt;br /&gt;Console.WriteLine(head.Data);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Console.Read();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;myNode&lt;/span&gt;.cs&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;namespace&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;myLinkedList&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;public class Node&lt;br /&gt;{&lt;br /&gt;public Node()&lt;br /&gt;{&lt;br /&gt;Data = 0;&lt;br /&gt;Next = null;&lt;br /&gt;}&lt;br /&gt;public int Data;&lt;br /&gt;public Node Next;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;OVERVIEW:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;Although&lt;/span&gt;, this program produces the output I desire, it causes a &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;memory leak,&lt;/span&gt; doesn't it?&lt;br /&gt;&lt;br /&gt;Notice the line: &lt;span style="FONT-WEIGHT: bold;font-family:courier new;" &gt;head = head.Next;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;There is a virtual &lt;span style="FONT-WEIGHT: bold"&gt;head &lt;/span&gt;node that is hidden. If we intended to create 3 nodes, the program actually creates 4 nodes. Then it starts printing the data by skipping the first node.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-3943754273330871053?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/3943754273330871053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=3943754273330871053' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/3943754273330871053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/3943754273330871053'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/2nd-program-singly-linked-list.html' title='2. Singly-linked list'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2544419656664907371</id><published>2007-04-17T15:09:00.000-05:00</published><updated>2007-10-12T01:03:02.513-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sn'/><category scheme='http://www.blogger.com/atom/ns#' term='key signing'/><category scheme='http://www.blogger.com/atom/ns#' term='Class Library'/><category scheme='http://www.blogger.com/atom/ns#' term='dll'/><category scheme='http://www.blogger.com/atom/ns#' term='gacutil'/><title type='text'>ClassLibrary: Creating dll files</title><content type='html'>As opposed to running a C# application as a Console application, we can define it as a &lt;strong&gt;ClassLibrary&lt;/strong&gt; and include it within the other programs we are gonna implement in the future.&lt;br /&gt;&lt;br /&gt;The main differences of a console application is as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Console:&lt;/strong&gt; The compiled file's extension is .exe so it is executable.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ClassLibrary:&lt;/strong&gt; The compiled file's extension is .dll thus it is NOT executable by itself. However, it is well suited for inclusion by other programs.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;ClassLibraries may be used in two ways:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Private &lt;/li&gt;&lt;li&gt;Public&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;for Private ClassLibraries:&lt;br /&gt;Does it happen when we SIGN and explicitly select the .dll file in Visual Studio, under Project properties??&lt;br /&gt;&lt;br /&gt;As for the public ClassLibraries:&lt;br /&gt;The .dll file may be published to a global folder under Windows directory. So, any application can use it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This process can be done as follows:&lt;br /&gt;First of all, the project must be created as a ClassLibrary in Visual Studio.&lt;br /&gt;Then implement the program codes just like I did in InterestCalculation program in the previous post. Compile the program. This will produce the .dll file.&lt;br /&gt;Then go to VS Command Prompt and run this: &gt; &lt;strong&gt;&lt;span style="font-family:courier new;"&gt;sn -k c:\easy.snk&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;You will get: &gt; &lt;span style="font-family:courier new;"&gt;Key pair written to c:\easy.snk&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Next thing to do is to use .NET GLOBAL ASSEMBLY CACHE utility.&lt;/li&gt;&lt;li&gt;In the command prompt, type: &gt; gacutil -i C:\{Location of the .dll file}\InterestCalculation.dll&lt;/li&gt;&lt;li&gt;This won't work: You'll get the following error: &gt; &lt;span style="font-family:courier new;"&gt;Failure adding assembly to the cache: Attempt to install an assembly without a strong name.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;The reason was because we haven't digitally signed the project of ClassLibrary. This digital signature is a randomly generated key specific to each of the persons. This is what we did in the 1st step above.&lt;/li&gt;&lt;li&gt;Go to Project Properties (Right-click in Solution Explorer) and switch to SIGNING TAB. &lt;/li&gt;&lt;li&gt;Enable checkbox "Sign the Assembly." Choose a strong name key file. Browse and select the key file [C:\easy.snk in this example].&lt;/li&gt;&lt;li&gt;Now re-do the 3rd step above.&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;This procedure required a minor fix in our case. In Visual Studio 2003, we had to correct the line &lt;span style="font-family:courier new;"&gt;[assembly: AssemblyKeyFile("")]&lt;/span&gt; &lt;strong&gt;as&lt;/strong&gt; &lt;span style="font-family:courier new;"&gt;[assembly: AssemblyKeyFile(@"C:\easy.snk")]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;I have Visual C# 2005 Express in my computer. Unfortunately, the above correction was NOT successful and now I am not able to install the assembly to global directory. If anybody has a idea about this, please post it to my blog. Thanks!&lt;/li&gt;&lt;/ul&gt;&lt;p align="center"&gt;&lt;strong&gt;Overview:&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;The Global Assembly Cache is so useful to share the previously written program codes. This is a &lt;strong&gt;PUBLIC&lt;/strong&gt; method of sharing the codes among applications. So, what is the &lt;strong&gt;PRIVATE&lt;/strong&gt; method to accomplish this??&lt;/p&gt;&lt;p&gt;Let's assume that two developers Gerry and Jerry are team members for software development. They are responsible for implementing their own part. However, by mistake, they have used &lt;strong&gt;SAME namespace&lt;/strong&gt; names in the implementation! What will happen during compilation of the project??&lt;/p&gt;&lt;p&gt;The Strong Name Tool (SN.exe) enables us to sign our assemblies with strong names. For the example above, even though Gerry and Jerry used same namespaces by mistake, the digital signing of the application will &lt;strong&gt;prevent&lt;/strong&gt; any compile errors and enable each of the developers to use even the &lt;strong&gt;same names&lt;/strong&gt; for &lt;strong&gt;namespaces and classes.&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2544419656664907371?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2544419656664907371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2544419656664907371' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2544419656664907371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2544419656664907371'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/classlibrary-creating-dll-files.html' title='ClassLibrary: Creating dll files'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-2758533601332325822</id><published>2007-04-17T14:24:00.000-05:00</published><updated>2007-10-12T01:05:05.771-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>1. Interest Calculation</title><content type='html'>This is the first Console program I have written in the C# &amp;amp; .NET class:&lt;br /&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Program.cs&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;namespace Interest&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine("Enter the money (p):");&lt;br /&gt;int p = int.Parse(Console.ReadLine());&lt;br /&gt;Console.WriteLine("Enter the rate of interest (R):");&lt;br /&gt;double R = double.Parse(Console.ReadLine());&lt;br /&gt;Console.WriteLine("Enter the time (T):");&lt;br /&gt;int T = int.Parse(Console.ReadLine());&lt;br /&gt;&lt;br /&gt;InterestCalc IC = new InterestCalc();&lt;br /&gt;Console.WriteLine("Simple Interest:");&lt;br /&gt;Console.WriteLine(IC.CalculateSimpleInterest(p, R, T));&lt;br /&gt;Console.WriteLine("Compound Interest:");&lt;br /&gt;Console.WriteLine(IC.CalculateCompoundInterest(p, R, T));&lt;br /&gt;Console.Read();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;InterestFunctions.cs&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Interest&lt;br /&gt;{&lt;br /&gt;class InterestCalc&lt;br /&gt;{&lt;br /&gt;public InterestCalc()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public double CalculateSimpleInterest(int p, double r, int t)&lt;br /&gt;{&lt;br /&gt;return (p*r*t)/100;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public double CalculateCompoundInterest(int p, double r, int t)&lt;br /&gt;{&lt;br /&gt;return p*(1+r/100)*t;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;WHAT I HAVE LEARNED?&lt;/strong&gt;&lt;/p&gt;The organization of the codes in C# consists of two main code blocks:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;namespace&lt;/li&gt;&lt;li&gt;class&lt;/li&gt;&lt;/ol&gt;&lt;em&gt;namespace&lt;/em&gt;s can include different &lt;em&gt;class&lt;/em&gt;es. We can place the codes of each of the classes in different files.&lt;br /&gt;-In this example, the class including the main program is named &lt;strong&gt;class Program{}&lt;/strong&gt; and saved in &lt;strong&gt;Program.cs&lt;/strong&gt; file.&lt;br /&gt;-On the other hand, the second class including the functions for the interest calculation is named &lt;strong&gt;class InterestFunctions{}&lt;/strong&gt; and is saved in &lt;strong&gt;InterestFunctions.cs&lt;/strong&gt; file.&lt;br /&gt;&lt;br /&gt;Both classes are implemented under the SAME namespace called &lt;strong&gt;namespace Interest{}&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-2758533601332325822?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/2758533601332325822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=2758533601332325822' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2758533601332325822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/2758533601332325822'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2007/04/this-is-first-console-program-i-have.html' title='1. Interest Calculation'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7210337449608707951.post-54822298853855255</id><published>2006-11-21T11:13:00.000-06:00</published><updated>2007-10-11T22:08:12.625-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ie'/><title type='text'>How to disable "click to activate and use this control"</title><content type='html'>&lt;span style="FONT-STYLE: italic"&gt;Easy tips for Webmasters:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Hate the &lt;span style="FONT-WEIGHT: bold"&gt;"click to activate and use this control" &lt;/span&gt;message?&lt;br /&gt;&lt;br /&gt;Two different ways:&lt;br /&gt;&lt;br /&gt;1) Automatic code generation:&lt;br /&gt;&lt;a href="http://www.ediy.co.nz/click-to-activate-and-use-this-control-fix-for-internet-explorer-xidc20771.html"&gt;Click Here:&lt;/a&gt; Place your html code and get the new code with the message disabled.&lt;br /&gt;&lt;br /&gt;2) Manual code:&lt;br /&gt;&lt;a href="http://www.ediy.co.nz/scripts/noieactivate.zip"&gt;Click here:&lt;/a&gt; Place the script &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;right after&lt;/span&gt; your flashcontrol or other controls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7210337449608707951-54822298853855255?l=csharpeasy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpeasy.blogspot.com/feeds/54822298853855255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7210337449608707951&amp;postID=54822298853855255' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/54822298853855255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7210337449608707951/posts/default/54822298853855255'/><link rel='alternate' type='text/html' href='http://csharpeasy.blogspot.com/2006/11/how-to-disable-click-to-activate-and.html' title='How to disable &quot;click to activate and use this control&quot;'/><author><name>dotneteasy</name><uri>http://www.blogger.com/profile/14184174099574183750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
