<?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'><id>tag:blogger.com,1999:blog-5274981767425509778</id><updated>2009-11-28T22:02:54.965+01:00</updated><title type='text'>Geert Verhoeven</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default?start-index=26&amp;max-results=25'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>46</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-5628922906368283441</id><published>2008-06-03T20:45:00.000+01:00</published><updated>2008-07-03T08:09:31.608+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>Adding references - WebSite versus WebApplication</title><content type='html'>On my current project I’m creating an ASP.NET site in Visual Studio 2005 SP1.&lt;br /&gt;&lt;br /&gt;NOTE: By default, Visual Studio 2005 only allows you to create ASP.NET sites by using the WebSite template but after installing SP1, you can also use the WebApplication template.&lt;br /&gt;&lt;br /&gt;For this project we are using the WebSite template since this is the customer’s standard. While developing the application, I noticed that when using the WebSite template, the Add Reference works differently then when using the WebApplication template.&lt;br /&gt;&lt;br /&gt;When adding a reference to dll A using the WebSite template, Visual Studio automatically adds a reference to all dll’s that dll A references. This is done to ease the deployment but it can give some unwanted side effects.&lt;br /&gt;&lt;br /&gt;To make this clearer, I’ve created a simple solution structure that shows this issue. In the image on the left, you can see 4 projects:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_DMJte_aP-lA/SGx2QnAs2vI/AAAAAAAAAJI/hyyi7FqqGPc/s1600-h/Solution+Explorer.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5218676095937469170" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_DMJte_aP-lA/SGx2QnAs2vI/AAAAAAAAAJI/hyyi7FqqGPc/s400/Solution+Explorer.JPG" border="0" /&gt;&lt;/a&gt; &lt;div style="FLOAT: left"&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;DalLib&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;BllLib: contains a link to DalLib&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;WebSite: project using the WebSite template; contains a link to BllLib&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;WebApplication: project using the WebApplication template; contains a link to BllLib&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="CLEAR: both"&gt;&lt;p&gt;When you compile this solution, you will notice that the Visual Studio will add the DalLib to the bin folder of the WebSite project. Because of this, you gain access to all the public classes within DalLib from the WebSite. Since I want to avoid direct access from UI to Dal, this is not what I want. When using the WebApplication template, you don’t have this problem.&lt;/p&gt;&lt;p&gt;A possible solution is to make the classes within the DalLib internal and set an InternalsVisible attribute in the AssemblyInfo.cs file of the DalLib (thanks Gert for the tip). &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/SGx3LcR-flI/AAAAAAAAAJQ/cjGJ0QD_VRQ/s1600-h/Attribute.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5218677106669420114" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/SGx3LcR-flI/AAAAAAAAAJQ/cjGJ0QD_VRQ/s400/Attribute.JPG" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;InternalsVisible is a new attribute from.NET 2.0 and is defined in the System.Runtime.CompilerServices namespace.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-5628922906368283441?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/5628922906368283441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=5628922906368283441' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5628922906368283441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5628922906368283441'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2008/06/adding-references-website-versus.html' title='Adding references - WebSite versus WebApplication'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_DMJte_aP-lA/SGx2QnAs2vI/AAAAAAAAAJI/hyyi7FqqGPc/s72-c/Solution+Explorer.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-5621276623035995761</id><published>2008-03-26T20:40:00.001+01:00</published><updated>2008-03-26T20:53:01.072+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>Vertical split view in Visual Studio 2008</title><content type='html'>Just noticed that in Visual Studio 2008 it is possible to change the split screen behavior.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Visual Studio allows you to set the default view (Split, Source or Design) and to choose between a horizontal split and a vertical split. Especially this last option is very handy when you have a widescreen monitor.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;To change the settings, go to &lt;strong&gt;Tools\Options\Html Designer&lt;/strong&gt;&lt;/p&gt;&lt;a href="http://1.bp.blogspot.com/_DMJte_aP-lA/R-qpcZ6TOdI/AAAAAAAAAJA/hDeeUvJKga4/s1600-h/Untitled.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5182140626700024274" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_DMJte_aP-lA/R-qpcZ6TOdI/AAAAAAAAAJA/hDeeUvJKga4/s400/Untitled.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-5621276623035995761?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/5621276623035995761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=5621276623035995761' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5621276623035995761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5621276623035995761'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2008/03/vertical-split-view-in-visual-studio_26.html' title='Vertical split view in Visual Studio 2008'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_DMJte_aP-lA/R-qpcZ6TOdI/AAAAAAAAAJA/hDeeUvJKga4/s72-c/Untitled.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-7621360938721965550</id><published>2008-02-08T15:46:00.001+01:00</published><updated>2008-02-08T15:57:28.098+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Quiz'/><title type='text'>Quiz 1: Generic class with static fields</title><content type='html'>&lt;p&gt;In the following piece of code you can see 2 instantiations of a generic class. What is the output of this console application?&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:d0460669-0da7-48e0-9691-2e9712db37fe" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 472px; padding-top: 0px"&gt;&lt;pre  style="width:100%;;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;using&lt;/span&gt;&lt;span style="color: #000000;"&gt; System;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;using&lt;/span&gt;&lt;span style="color: #000000;"&gt; System.Collections.Generic;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;namespace&lt;/span&gt;&lt;span style="color: #000000;"&gt; DEMO&lt;br /&gt;{&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; Program&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Main(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;[] args)&lt;br /&gt;        {&lt;br /&gt;            GenClass&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; x &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; GenClass&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;();&lt;br /&gt;            GenClass&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;double&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; y &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; GenClass&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;double&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;();&lt;br /&gt;&lt;br /&gt;            x.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;            y.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(y.Get(&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; GenClass&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;T&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;T&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; list &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;T&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;();&lt;br /&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Add(T x)&lt;br /&gt;            {&lt;br /&gt;                list.Add(x);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; Get(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; index)&lt;br /&gt;            {&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; list[index].ToString();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I'll post the response in a comment.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-7621360938721965550?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/7621360938721965550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=7621360938721965550' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/7621360938721965550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/7621360938721965550'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2008/02/quiz-1-generic-class-with-static-fields.html' title='Quiz 1: Generic class with static fields'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-4445455911003149385</id><published>2008-01-27T16:23:00.001+01:00</published><updated>2008-01-27T16:45:28.889+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>Anonymous types and equality</title><content type='html'>&lt;strong&gt;Introduction to anonymous types&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;Most of the applications created in .NET contain classes defined by the developer. There are two types of classes. First you have the type that only contains fields and is used to transfer data, then you have a second type that also provides functionality to the application by implementing logic in methods, events, ... . &lt;br /&gt;  &lt;br /&gt;As from the .NET 3.5 framework, Microsoft has added anonymous types. Anonymous types that are created dynamically at compile time. &lt;br /&gt;  &lt;br /&gt;With anonymous types, the developer no longer has to define the type structure. Sounds great doesn't it. Although there are some limitations. For example, anonymous types can only be used as local variables. This means that the definition of a type is only valid within a single method. It is possible to pass instances of an anonymous type between methods but then the parameter of the receiving method should be of type object which is mostly not a best practice and difficult to work with. &lt;br /&gt;  &lt;br /&gt;This limits the use of anonymous types. As for most of the .NET 3.5 language enhancements, anonymous types are implemented to be able to support Linq. &lt;br /&gt;  &lt;br /&gt;To create an anonymous type, you need to use the &lt;strong&gt;var&lt;/strong&gt; keyword in combination with the new object initialization syntax (also one of the .NET 3.5 language enhancements). &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sample&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;In the following sample, I'll show you how to create an anonymous type as well as how an anonymous type behaves when using equality methods. &lt;/p&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:45a990a1-2234-494c-97c9-2c92258b35a0" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 477px; padding-top: 0px"&gt;&lt;pre  style="width:100%;;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;using&lt;/span&gt;&lt;span style="color: #000000;"&gt; System;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; Program&lt;br /&gt;{&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Main(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;[] args)&lt;br /&gt;   {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Creation of an anonymous type&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;      var p1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      {&lt;br /&gt;         FirstName &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Geert&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;         LastName &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Verhoeven&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;         Age &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;26&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      };&lt;br /&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Error: &lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Property or indexer 'AnonymousType#1.Age' &lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; cannot be assigned to -- it is read only    &lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; p1.Age = 27;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      Console.WriteLine(p1.ToString());&lt;br /&gt;&lt;br /&gt;      var p2 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      {&lt;br /&gt;         FirstName &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Geert&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;         LastName &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Verhoeven&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;         Age &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;26&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      };      &lt;br /&gt;&lt;br /&gt;      var p3 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; p1;&lt;br /&gt;      &lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Comparison based on the == method.&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;      Console.WriteLine(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;person1 == person2: {0}&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;          p1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; p2);&lt;br /&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Comparison based on the equals method.&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;      Console.WriteLine(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;person1.Equals(person2): {0}&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;          p1.Equals(p2));&lt;br /&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Comparison based on the == method.&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;      Console.WriteLine(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;person1 == person3: {0}&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;br /&gt;          p1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; p3);&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Output:&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/R5yiQ3ym-ZI/AAAAAAAAAIo/471hY0-Ucvg/s1600-h/Output.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5160177683797571986" style="cursor: hand" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/R5yiQ3ym-ZI/AAAAAAAAAIo/471hY0-Ucvg/s400/Output.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are some important things to note when looking at this output. &lt;br /&gt;  &lt;br /&gt;At first, if you look at the result of the ToString() method, you can see that the behavior is different then with normal types. By default, when not overridden, the ToString() method returns the&amp;#160; types fullname. This means that an anonymous type has an override for the ToString() method. &lt;br /&gt;  &lt;br /&gt;Secondly, the Equals method behaves differently as well. When not overridden, the Equals method checks whether 2 objects refer to the same memory object. This means that the anonymous type for the Equals method as well. &lt;br /&gt;  &lt;br /&gt;The == operator still acts the same as with normal objects. From these results we can conclude that when using the Equals method, an anonymous types acts like a value type. When using the == operator, the anonymous type acts like a reference type. &lt;br /&gt;  &lt;br /&gt;Now how is this possible since we didn't write any code for these overrides? When opening the assembly with a tool like Reflector, we can see the structure of the generated anonymous type and see that the compiler did this for us.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:52c14ea0-1b0b-4536-946b-a89437d18fc5" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 472px; padding-top: 0px"&gt;&lt;pre  style="width:100%;;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;internal&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;sealed&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;f__AnonymousType0&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;FirstName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar, &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;LastName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar, &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Age&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;{&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;readonly&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Age&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Age&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;i__Field;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;readonly&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;FirstName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;FirstName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;i__Field;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;readonly&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;LastName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;LastName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;i__Field;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;f__AnonymousType0(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;FirstName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar FirstName, &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;LastName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar LastName, &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Age&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar Age);&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;override&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;bool&lt;/span&gt;&lt;span style="color: #000000;"&gt; Equals(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;object&lt;/span&gt;&lt;span style="color: #000000;"&gt; value);&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;override&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; GetHashCode();&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;override&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; ToString();&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Age&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar Age { &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;get&lt;/span&gt;&lt;span style="color: #000000;"&gt;; }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;FirstName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar FirstName { &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;get&lt;/span&gt;&lt;span style="color: #000000;"&gt;; }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;LastName&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;j__TPar LastName { &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;get&lt;/span&gt;&lt;span style="color: #000000;"&gt;; }&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-4445455911003149385?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/4445455911003149385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=4445455911003149385' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/4445455911003149385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/4445455911003149385'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2008/01/anonymous-types-and-equality.html' title='Anonymous types and equality'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_DMJte_aP-lA/R5yiQ3ym-ZI/AAAAAAAAAIo/471hY0-Ucvg/s72-c/Output.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-6571773340096158215</id><published>2008-01-17T23:17:00.001+01:00</published><updated>2008-01-18T14:06:20.570+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>Strange behavior with extension methods</title><content type='html'>&lt;p&gt;In a previous post, I already explained what extension methods are and how they work. While doing some tests, I noticed a strange behavior which I will explain in this post.&lt;/p&gt;&lt;p&gt;The order in which .NET searches for the method to be executed is as follow:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Instance methods of the class &lt;/li&gt;&lt;li&gt;Static methods within the class &lt;/li&gt;&lt;li&gt;Extension methods specified for the class &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Because the static methods have a higher priority then the extension methods, this can give strange behavior.&lt;/p&gt;&lt;p&gt;In the following sample, the goal is to create an extension method that enables making comparisons on DateTime objects on different levels. The comparison level allows you for example to only compare until the month and not use the day/time while doing the comparison.&lt;/p&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:03e8a33e-9389-4b8d-b28c-9698755c245b" style="margin: 0px; padding: 0px; display: inline; float: none;"&gt;&lt;pre style="width: 100%;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; System;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; System.Collections.Generic;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Program&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Main(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[] args)&lt;br /&gt;{&lt;br /&gt;   DateTime d1 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;2008&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;   DateTime d2 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;2008&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;10&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;      //&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Compile time error:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;      //&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Member 'object.Equals(object, object)'&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;      //&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; cannot be accessed with an instance&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;      //&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; reference; qualify it with a type&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;      //&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; name instead &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      d1.Equals(d2, DateComparisonLevel.Month);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;enum&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateComparisonLevel&lt;br /&gt;{&lt;br /&gt;Year,&lt;br /&gt;Month&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; MyUtils&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Equals(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime orgDate,&lt;br /&gt;     DateTime compDate, DateComparisonLevel level)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;      switch&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (level)&lt;br /&gt;   {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;         case&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateComparisonLevel.Year:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;            return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; orgDate.Date.Equals(&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;                      new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime(&lt;br /&gt;                       compDate.Year,&lt;br /&gt;                       orgDate.Month,&lt;br /&gt;                       orgDate.Day));&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;         case&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateComparisonLevel.Month:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;            return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; orgDate.Date.Equals(&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;                      new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime(&lt;br /&gt;                       compDate.Year,&lt;br /&gt;                       compDate.Month,&lt;br /&gt;                       orgDate.Day));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;      return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When trying to compile this code, you will receive a compile time error on the following line:&lt;/p&gt;&lt;div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:3710d131-12de-4631-b6be-e2f6b4919014" style="margin: 0px; padding: 0px; display: inline; float: none;"&gt;&lt;pre style="width: 100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;d1.Equals(d2, DateComparisonLevel.Month);&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Error:&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(102, 102, 102);font-size:85%;" &gt;Member 'object.Equals(object, object)' cannot be accessed with an instance reference; qualify it with a type name instead.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;This is because DateTime derives from System.Object. Since System.Object contains a method with definition &lt;/p&gt;&lt;pre&gt;public static &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean"&gt;bool&lt;/a&gt; &lt;b&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object/Equals%28Object,Object%29:Boolean"&gt;Equals&lt;/a&gt;&lt;/b&gt;(&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object"&gt;object&lt;/a&gt; objA, &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object"&gt;object&lt;/a&gt; objB);&lt;/pre&gt;&lt;p&gt;the compiler takes this method in case of the extension method. Since the method of the System.Object class is a static method, it can not be called from an instance of an object. The only way to solve this is to rename the Equals method in the code. This way, the Object.Equals method will no longer interfer.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Microsoft considers this as a bug.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-6571773340096158215?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/6571773340096158215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=6571773340096158215' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/6571773340096158215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/6571773340096158215'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2008/01/strange-behavior-with-extension-methods.html' title='Strange behavior with extension methods'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-4433988354652615528</id><published>2008-01-17T23:03:00.001+01:00</published><updated>2008-01-18T10:03:54.994+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>Introduction to extension methods</title><content type='html'>&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Extension methods allow you to extend an existing type without needing access to the type's code. Before .NET 3.5, this wasn't possible without having access to the type's code or without using the System.Reflection.Emit namespace.&lt;/p&gt;&lt;p&gt;In short, extension methods are static methods that can be executed by instances of the extended object. Behind the scenes, the call to the extension method is nothing more then a call to a static method.&lt;/p&gt;&lt;p&gt;Behind the scenes, extension methods are marked with the System.Runtime.CompilerServices.ExtensionAttribute which is located in the Systme.Core.dll. So a reference to this DLL is necessary in order to create extension methods.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;If you have a class that you want to extend but you don't have the source code, extension methods can be an answer. Also when extending a class with extension methods, you don't have the risk of breaking existing code which you can have when changing the type's definition.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Simple sample&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;In this sample, I'm adding a method IsWeekend to the DateTime type which will return a boolean to indicate whether a given date falls in the weekend or not.&lt;/p&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:a96cc94a-0129-425e-b8ea-e468e9c5ef9c" style="margin: 0px; padding: 0px; display: inline; float: none; width: 474px;"&gt;&lt;pre style="width: 100%;"&gt;&lt;div&gt;&lt;!--  Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/  --&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; System;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Program&lt;br /&gt;{&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Main(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[] args)&lt;br /&gt;  {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Tuesday&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        DateTime d1 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;2008&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Saturday&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        DateTime d2 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;2008&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;5&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;); &lt;br /&gt;&lt;br /&gt;      Console.WriteLine(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;{0:d} is weekend: {1}&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;                          d1, d1.IsWeekend());&lt;br /&gt;      Console.WriteLine(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;{0:d} is weekend: {1}&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;                          d2, d2.IsWeekend());&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; MyUtils&lt;br /&gt;{&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; IsWeekend(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime date)&lt;br /&gt;  {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (date.DayOfWeek &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;==&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DayOfWeek.Saturday&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;||&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; date.DayOfWeek &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;==&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DayOfWeek.Sunday);&lt;br /&gt;  }&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Extension methods must be created within a static class (each method within the class must be static as well). The first parameter of the method is marked with the &lt;strong&gt;this&lt;/strong&gt; keyword and indicates the type to which the method should be applied (in this case DateTime). It is possible to add multiple parameters. Only the parameters after the first parameter, should be provided when using the method.&lt;/p&gt;&lt;p&gt;When you've implemented an extension method for a specific type, you will see that it is showed by intellisense with a specific icon.&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/R4_SqmgaQCI/AAAAAAAAAIg/Qt52uWQo6A8/s1600-h/Screen+1+-+Intellisense.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5156571727695331362" style="" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/R4_SqmgaQCI/AAAAAAAAAIg/Qt52uWQo6A8/s400/Screen+1+-+Intellisense.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It is possible to create a separate assembly with all your extension methods. Note that you need to add using statements for the namespaces where the extension methods are located.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-4433988354652615528?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/4433988354652615528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=4433988354652615528' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/4433988354652615528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/4433988354652615528'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2008/01/introduction-to-extension-methods.html' title='Introduction to extension methods'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DMJte_aP-lA/R4_SqmgaQCI/AAAAAAAAAIg/Qt52uWQo6A8/s72-c/Screen+1+-+Intellisense.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-3926415762876276780</id><published>2007-12-26T11:03:00.000+01:00</published><updated>2008-01-03T08:07:51.695+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>Installation issues with Windows Live Writer when using a corporate proxy server</title><content type='html'>When installing Windows Live Writer on a machine that is connected via a corporate proxy to the internet can be a real pain. Since the installer is downloading .exe files, the files can be blocked.&lt;br /&gt;&lt;br /&gt;Today I've found this &lt;a href="http://weblogs.asp.net/rachit/archive/2007/12/20/windows-live-writer-2008-on-corporate-machine.aspx"&gt;blog post&lt;/a&gt; which shows a way to install the Windows Live tools on a corporate machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-3926415762876276780?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/3926415762876276780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=3926415762876276780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3926415762876276780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3926415762876276780'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/12/installation-issues-with-windows-live.html' title='Installation issues with Windows Live Writer when using a corporate proxy server'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-7482413094882011590</id><published>2007-11-21T08:40:00.000+01:00</published><updated>2007-11-21T09:03:28.117+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><title type='text'>Visual Studio 2008 available</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;For those of you who didn't know yet, Visual Studio 2008 is available since a few days.&lt;br /&gt;&lt;br /&gt;MSDN Subscribers can download the full version where as others can download a 90-day trial.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Yesterday I've been able to install it on a Windows XP SP2 machine without any problems. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;NOTE: When opening a solution or project file created in a previous version, an upgrade wizard will be launched. If you upgrade your project, you can not open it any more with the previous version.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-7482413094882011590?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/7482413094882011590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=7482413094882011590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/7482413094882011590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/7482413094882011590'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/11/visual-studio-2008-available.html' title='Visual Studio 2008 available'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-3194823638968024317</id><published>2007-10-04T17:52:00.000+01:00</published><updated>2007-10-04T19:15:34.364+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>Firefox's "functionality" to show your saved passwords in clear text</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;While making a joke about Firefox, I noticed that a lot of people don't know that Firefox has a functionality that makes it possible to show your saved passwords. This can be handy for you whenever you forget one but also very handy for someone who uses your pc with the same account.&lt;br /&gt;&lt;br /&gt;Before judging, I must say this password manager can be disabled or secured but by default it is enabled without security. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;h4&gt;The problem&lt;/h4&gt;If you browse to a site that requires you to sign in with name and password (for example &lt;a href="http://www.gmail.com/"&gt;http://www.gmail.com/&lt;/a&gt;), Firefox will give you the possibility to save your password as in IE. &lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/RwS4_ClzlsI/AAAAAAAAAHY/-u98a3Janu8/s1600-h/1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5117418469766436546" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/RwS4_ClzlsI/AAAAAAAAAHY/-u98a3Janu8/s400/1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However, with Firefox it is possible to actually see the passwords in clear text. This is how to do it:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Go to Tools\Options and select the Security tab&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/RwS5bSlzltI/AAAAAAAAAHg/ZIeErf7_g80/s1600-h/se.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5117418955097741010" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_DMJte_aP-lA/RwS5bSlzltI/AAAAAAAAAHg/ZIeErf7_g80/s400/se.JPG" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Click “Show Passwords”&lt;br /&gt;This will open a new screen and show you the sites and accounts; not the passwords.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/RwS5qClzluI/AAAAAAAAAHo/2fdjWPWFa0U/s1600-h/p.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5117419208500811490" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/RwS5qClzluI/AAAAAAAAAHo/2fdjWPWFa0U/s400/p.JPG" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Click “Show Passwords” and choose “Yes” in the warning dialog (don’t do this when other people are standing next to you)&lt;br /&gt;&lt;br /&gt;This will add an additional column in the table which shows your passwords in clear text.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/RwS58ilzlvI/AAAAAAAAAHw/r1JnQLKz8Mk/s1600-h/p.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5117419526328391410" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/RwS58ilzlvI/AAAAAAAAAHw/r1JnQLKz8Mk/s400/p.JPG" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I think you understand that this can be dangerous! &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h4&gt;The solution&lt;/h4&gt;As mentioned before, there is a way to disable (by unchecking the "Remember passwords for this site" option) or secure this.&lt;br /&gt;&lt;br /&gt;To secure this, Firefox uses a master passwords to access your saved passwords. You can do this by checking the “Use a master password” in the “Security” tab from the Options window. Firefox will ask you to enter a new password.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/RwS6JilzlwI/AAAAAAAAAH4/L7FjejMq24U/s1600-h/m.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5117419749666690818" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/RwS6JilzlwI/AAAAAAAAAH4/L7FjejMq24U/s400/m.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The master password needs to be entered each time you want Firefox to use your saved passwords or to view the list of passwords.&lt;/span&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/5274981767425509778-3194823638968024317?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/3194823638968024317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=3194823638968024317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3194823638968024317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3194823638968024317'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/10/firefox-reveals-your-passwords-in-clear.html' title='Firefox&apos;s &quot;functionality&quot; to show your saved passwords in clear text'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DMJte_aP-lA/RwS4_ClzlsI/AAAAAAAAAHY/-u98a3Janu8/s72-c/1.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-8396270798870488400</id><published>2007-09-21T15:44:00.001+01:00</published><updated>2007-09-25T06:37:35.863+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>Implementing the IEquatable interface properly</title><content type='html'>I've posted an article on &lt;a href="http://www.codeproject.com/useritems/IEquatable.asp"&gt;CodeProject&lt;/a&gt; that illustrates why it is important to override the Object.Equals method when implementing the IEquatable interface.&lt;br /&gt;&lt;br /&gt;The article first explains when to use the IEquatable and how to do a proper implementation.&lt;br /&gt;&lt;br /&gt;If you have any questions or comments, feel free to post them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-8396270798870488400?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/8396270798870488400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=8396270798870488400' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8396270798870488400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8396270798870488400'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/09/implementing-iequatable-interface.html' title='Implementing the IEquatable interface properly'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-5119287938739603960</id><published>2007-09-10T18:40:00.000+01:00</published><updated>2007-09-11T06:46:00.307+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><category scheme='http://www.blogger.com/atom/ns#' term='Book'/><title type='text'>Passed the 70-526 exam</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/RuYqz6qUhhI/AAAAAAAAAHA/NBquABBp1Cw/s1600-h/9983.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5108817898706863634" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/RuYqz6qUhhI/AAAAAAAAAHA/NBquABBp1Cw/s400/9983.gif" border="0" /&gt;&lt;/a&gt; &lt;span style="font-family:trebuchet ms;"&gt;Two weeks ago I've passed the MCTS exam for Windows Application (070-526). To study this exam I've used the &lt;a href="http://www.microsoft.com/MSPress/books/9983.aspx"&gt;MS PRESS&lt;/a&gt; book which helped me very good. The book explains the topics very well and contains good exercises. &lt;/span&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;Most of the questions where more or less discussed in the book. I did get a lot of questions on deployment and printing.&lt;br /&gt;&lt;br /&gt;After taking 2 weeks of I'm back on track for the next exam 70-548 (MCPD Windows Applications).&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-5119287938739603960?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/5119287938739603960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=5119287938739603960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5119287938739603960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5119287938739603960'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/09/passed-70-526-exam.html' title='Passed the 70-526 exam'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_DMJte_aP-lA/RuYqz6qUhhI/AAAAAAAAAHA/NBquABBp1Cw/s72-c/9983.gif' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-8632753674271293517</id><published>2007-08-20T20:47:00.001+01:00</published><updated>2007-08-20T20:51:20.983+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><title type='text'>How Windows Vista fills your disk</title><content type='html'>&lt;div&gt;&lt;p&gt;Recently I reinstalled my PC and installed Windows Vista on it. After using it for a month, I noticed that the free disk space was becoming very limited. In explorer the disk property showed me that I used 46GB but when I selected all my folders and retrieved the size, it was only 21GB. &lt;/p&gt;&lt;p&gt;So where did that 25GB go? Aparently it is the system restore utility (which uses shadow copies) that is happily using my free disk space. Especially on a laptop with limited disk space this is not funny. Opposed to Windows XP, Vista doesn't provide a graphical utility to manage the system restore memory settings. Although, there is a way to change these settings.&lt;/p&gt;&lt;p&gt;If you open a command prompt and type &lt;strong&gt;vssadmin list shadowstorage&lt;/strong&gt;, you can see the used space.&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/Rsnwa6qUhfI/AAAAAAAAAGw/3PKX5mKfp9E/s1600-h/Screen+1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5100872398187824626" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_DMJte_aP-lA/Rsnwa6qUhfI/AAAAAAAAAGw/3PKX5mKfp9E/s400/Screen+1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;To change the settings, you need to use the &lt;strong&gt;vssadmin resize shadowstorage /for=[disk_drive]: /on=[disk_drive]: /maxsize=[max_size]&lt;/strong&gt;. The sample below sets these settings on my machine to a maximum of 1GB:&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/RsnwhqqUhgI/AAAAAAAAAG4/0PllB3A-YPE/s1600-h/Vista+2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5100872514151941634" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/RsnwhqqUhgI/AAAAAAAAAG4/0PllB3A-YPE/s400/Vista+2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;vssadmin resize shadowstorage /for=c: /on=c: /maxsize=1GB&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;References:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a title="http://blogs.technet.com/filecab/archive/2006/11/16/identifying-how-much-disk-space-is-used-for-restore-points-in-windows-vista.aspx" href="http://blogs.technet.com/filecab/archive/2006/11/16/identifying-how-much-disk-space-is-used-for-restore-points-in-windows-vista.aspx"&gt;http://blogs.technet.com/filecab/archive/2006/11/16/identifying-how-much-disk-space-is-used-for-restore-points-in-windows-vista.aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-8632753674271293517?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/8632753674271293517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=8632753674271293517' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8632753674271293517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8632753674271293517'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/08/how-windows-vista-fills-your-disk.html' title='How Windows Vista fills your disk'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_DMJte_aP-lA/Rsnwa6qUhfI/AAAAAAAAAGw/3PKX5mKfp9E/s72-c/Screen+1.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-8164071288592821527</id><published>2007-08-06T20:37:00.001+01:00</published><updated>2007-08-06T20:40:14.376+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><title type='text'>"Upgrade patch can not be installed ..." while installing Visual Studio SP1 for Vista</title><content type='html'>To be able to use Visual Studio 2005 on a Windows Vista machine, you need to install a special service pack: (&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=90E2942D-3AD1-4873-A2EE-4ACC0AACE5B6&amp;displaylang=en"&gt;Visual Studio 2005 Service Pack 1 Update for Windows Vista&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;When starting the installation I received the following error:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/Rrd47P5h_CI/AAAAAAAAAGo/DYU2sAjoUvs/s1600-h/Windows+Installer+Error.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5095674462668454946" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_DMJte_aP-lA/Rrd47P5h_CI/AAAAAAAAAGo/DYU2sAjoUvs/s400/Windows+Installer+Error.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:#999999;"&gt;The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The service pack is searching for specific components that are not available. These components ship with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&amp;amp;displaylang=en"&gt;standard SP1&lt;/a&gt;. So before installing the Vista specific service pack, you need to install the standard SP1.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-8164071288592821527?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/8164071288592821527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=8164071288592821527' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8164071288592821527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8164071288592821527'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/08/patch-can-not-be-installed-while.html' title='&amp;quot;Upgrade patch can not be installed ...&amp;quot; while installing Visual Studio SP1 for Vista'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_DMJte_aP-lA/Rrd47P5h_CI/AAAAAAAAAGo/DYU2sAjoUvs/s72-c/Windows+Installer+Error.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-6116199574958793493</id><published>2007-08-06T20:25:00.001+01:00</published><updated>2007-08-06T20:41:03.686+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Reporting Services on a Vista machine</title><content type='html'>Since a while I have reinstalled my test pc to be able to experiment with the new Windows operating system. When trying to install Reporting Services 2005, the setup gave me the following warning:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/Rrd19f5h_AI/AAAAAAAAAGY/V9qa0kIlx7k/s1600-h/Configuration+Check.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5095671202788277250" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/Rrd19f5h_AI/AAAAAAAAAGY/V9qa0kIlx7k/s400/Configuration+Check.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://1.bp.blogspot.com/_DMJte_aP-lA/Rrd2Bv5h_BI/AAAAAAAAAGg/UlkyBOMQzsg/s1600-h/IIS+Feature+Requirement.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5095671275802721298" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_DMJte_aP-lA/Rrd2Bv5h_BI/AAAAAAAAAGg/UlkyBOMQzsg/s400/IIS+Feature+Requirement.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color:#666666;"&gt;IIS Feature Requirement ...&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;It seems that Reporting Services can't find IIS although it is installed on my PC (note Vista has IIS 7).&lt;/p&gt;&lt;p&gt;After googling a while, I found the following article: &lt;a title="http://support.microsoft.com/kb/920201/en-us" href="http://support.microsoft.com/kb/920201/en-us"&gt;http://support.microsoft.com/kb/920201/en-us&lt;/a&gt;. Apparently it is necessary to install specific IIS 7 components in order to be able to install Reporting Services on a Vista machine. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-6116199574958793493?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/6116199574958793493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=6116199574958793493' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/6116199574958793493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/6116199574958793493'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/08/reporting-services-on-vista-machine.html' title='Reporting Services on a Vista machine'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_DMJte_aP-lA/Rrd19f5h_AI/AAAAAAAAAGY/V9qa0kIlx7k/s72-c/Configuration+Check.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-725880457898331785</id><published>2007-07-28T09:22:00.001+01:00</published><updated>2007-07-28T09:31:02.138+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><category scheme='http://www.blogger.com/atom/ns#' term='Book'/><title type='text'>Passed the 70-536 exam</title><content type='html'>&lt;p&gt;Yesterday I've passed the &lt;a href="http://www.microsoft.com/learning/exams/70-536.mspx"&gt;70-536&lt;/a&gt; exam (TS: Microsoft .NET Framework 2.0—Application Development Foundation). &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/MSPress/books/9469.aspx" target="_blank" atomicselection="true"&gt;&lt;img height="101" src="http://www.microsoft.com/MSPress/books/imgt/9469.gif" width="101" align="right"&gt;&lt;/a&gt; &amp;nbsp;To study the exam I've used the &lt;a href="http://www.microsoft.com/MSPress/books/9469.aspx" target="_blank"&gt;Microsoft Training Kit&lt;/a&gt;. The book is easy to read and has good practices. It covers all the topics discussed in the exam. Sometimes not in so much details but that is normal I guess.&lt;/p&gt; &lt;p&gt;The next exam that I'm going to do is &lt;a href="http://www.microsoft.com/learning/exams/70-526.mspx"&gt;70-526&lt;/a&gt; (TS: Microsoft .NET Framework 2.0 – Windows-Based Client Development). I could have choosen for the upgrade exam (MCSD to MCPD) but I prefer to do the exams one by one. This gives me an extra review on things that I don't use that often.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-725880457898331785?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/725880457898331785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=725880457898331785' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/725880457898331785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/725880457898331785'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/passed-70-536-exam.html' title='Passed the 70-536 exam'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-5187973722221334418</id><published>2007-07-25T19:10:00.001+01:00</published><updated>2007-07-25T19:15:10.196+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>Windows Live Writer: creating blog entries in just a few seconds</title><content type='html'>In a &lt;a href="http://geertverhoeven.blogspot.com/2007/07/blogging-with-office-2007_17.html"&gt;previous&lt;/a&gt; post I've mentioned the possibilities of Word 2007 to create new blog entries. A &lt;a href="http://weblog.shaoken.be/"&gt;colleague&lt;/a&gt; of me informed me about a tool names Windows Live Writer which is a tool created by Microsoft to create blog entries. After testing it for a while, I'm now using Live Writer as my primary blogging tool. You can download it &lt;a href="http://born2code.net/go.php?http://download.microsoft.com/download/f/9/a/f9a19f2d-cec4-4a25-9b0b-eb9655ea7561/Writer.msi"&gt;here&lt;/a&gt; (currently in Beta).&lt;br /&gt;&lt;p&gt;Especially in combination with the free &lt;a href="http://www.istaysharp.net/index.php?title=SyntaxColor4Writer"&gt;SyntaxColor4Writer&lt;/a&gt; plug-in, creating posts that contains code is no longer a time consuming job. The plug-in allows you to add code to your blog without having to worry about the colors and formatting.&lt;/p&gt;&lt;p&gt;Currently it supports 20 different formats including C#, VB.NET, HTML, XML, SQL, ...&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/RqeSj_5h-_I/AAAAAAAAAGQ/IwC-kAoKdQA/s1600-h/ScreenShot.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5091199050911448050" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/RqeSj_5h-_I/AAAAAAAAAGQ/IwC-kAoKdQA/s400/ScreenShot.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-5187973722221334418?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/5187973722221334418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=5187973722221334418' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5187973722221334418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5187973722221334418'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/windows-live-writer-creating-blog.html' title='Windows Live Writer: creating blog entries in just a few seconds'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DMJte_aP-lA/RqeSj_5h-_I/AAAAAAAAAGQ/IwC-kAoKdQA/s72-c/ScreenShot.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-8513247236689214570</id><published>2007-07-25T18:17:00.000+01:00</published><updated>2007-07-25T13:27:34.317+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Create a function that returns a table</title><content type='html'>In SQL Server it is easy to create a function that returns a table when used in the from clause. In Oracle this is not as easy as it seems but since my current client uses Oracle, I was forced to find a solution so here it is. &lt;br /&gt;&lt;br&gt;To create a function that returns a table in Oracle you need to follow a few steps:&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Create a type that corresponds to a single record &lt;br /&gt;&lt;li&gt;Create a type that corresponds to a table and that has the previously declared type as recordtype &lt;br /&gt;&lt;li&gt;Create the function&lt;/li&gt;&lt;/ul&gt;To use the function, you need to include it in the TABLE() function.&lt;br&gt;&lt;br /&gt;Here is an example on how to do it:&lt;ul&gt;&lt;br /&gt;&lt;li&gt;First I create a simple table that will be used for the sample. &lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:4cdc8cf7-be65-42d3-8ea7-b7d2629de8ea" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 476px; padding-top: 0px"&gt;&lt;pre style="width: 100%"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; Create a dummy table to show how it works.&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; The table contains a hierarchy between boss &lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; and employee.&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt;&lt;span style="color: #000000"&gt; employee&lt;br /&gt;(&lt;br /&gt;  emp_id       &lt;/span&gt;&lt;span style="font-weight: bold; color: #000000"&gt;NUMBER&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;10&lt;/span&gt;&lt;span style="color: #000000"&gt;),&lt;br /&gt;  full_name    &lt;/span&gt;&lt;span style="font-weight: bold; color: #000000"&gt;VARCHAR2&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;50&lt;/span&gt;&lt;span style="color: #000000"&gt;),&lt;br /&gt;  emp_boss_id  &lt;/span&gt;&lt;span style="font-weight: bold; color: #000000"&gt;NUMBER&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;10&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; Insert dummy data:&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Geert Verhoeven&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;2&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Ford Parker&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;3&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Al Bino&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;4&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;April May&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;5&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Abbie Birthday&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;3&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;6&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Gene E. Yuss&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;3&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;7&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Juana Bea&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;3&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;8&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Willie Maykit&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;4&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;9&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Zoltan Pepper&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;4&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;INSERT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt;&lt;span style="color: #000000"&gt; (&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;10&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #ff0000"&gt;Scott Shawn DeRocks&lt;/span&gt;&lt;span style="color: #ff0000"&gt;'&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;4&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;COMMIT&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;li&gt;Then I create the types needed to be able to return a table&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:e41e93c6-bd1e-4115-bfe4-e5e402e1a269" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="width: 100%"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; Create a type that corresponds to a row that you want to have returned.&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt;&lt;span style="color: #000000"&gt; TYPE ind_employee &lt;/span&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;span style="color: #000000"&gt; OBJECT (emp_id &lt;/span&gt;&lt;span style="font-weight: bold; color: #000000"&gt;NUMBER&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;10&lt;/span&gt;&lt;span style="color: #000000"&gt;), full_name  &lt;/span&gt;&lt;span style="font-weight: bold; color: #000000"&gt;VARCHAR2&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;50&lt;/span&gt;&lt;span style="color: #000000"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br&gt; Create a type that corresponds to a table of rows with the specified type.&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt;&lt;span style="color: #000000"&gt; TYPE ind_employee_table &lt;/span&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;OF&lt;/span&gt;&lt;span style="color: #000000"&gt; ind_employee;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;li&gt;After this is done, you can create a function that returns a table.&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:068f0910-168c-4494-ad77-a5b29d39de13" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 446px; padding-top: 0px"&gt;&lt;pre style="width: 100%"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; Create the function.&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;OR&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #ff00ff"&gt;REPLACE&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;FUNCTION&lt;/span&gt;&lt;span style="color: #000000"&gt; FN_GET_EMPLOYEE_DESCENDANTS (&lt;br /&gt;    pin_emp_id &lt;/span&gt;&lt;span style="color: #808080"&gt;IN&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: #000000"&gt;NUMBER&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;) &lt;/span&gt;&lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt;&lt;span style="color: #000000"&gt; ind_employee_table PIPELINED &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;IS&lt;/span&gt;&lt;span style="color: #000000"&gt;  &lt;br /&gt;    &lt;br /&gt;TYPE t_ref_cursor &lt;/span&gt;&lt;span style="color: #0000ff"&gt;IS&lt;/span&gt;&lt;span style="color: #000000"&gt; REF &lt;/span&gt;&lt;span style="color: #0000ff"&gt;CURSOR&lt;/span&gt;&lt;span style="color: #000000"&gt;;    &lt;br /&gt;lc_employees        t_ref_cursor;&lt;br /&gt;lr_out_rec          ind_employee :&lt;/span&gt;&lt;span style="color: #808080"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; ind_employee(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;&lt;span style="color: #000000"&gt;, &lt;/span&gt;&lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000ff"&gt;OPEN&lt;/span&gt;&lt;span style="color: #000000"&gt; lc_employees &lt;/span&gt;&lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; The connect by prior handles the hierarchy.&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000"&gt;        &lt;/span&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;br /&gt;            emp_id,&lt;br /&gt;            full_name &lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt;&lt;span style="color: #000000"&gt; employee    &lt;br /&gt;        START &lt;/span&gt;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt;&lt;span style="color: #000000"&gt; emp_id &lt;/span&gt;&lt;span style="color: #808080"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; pin_emp_id&lt;br /&gt;        CONNECT &lt;/span&gt;&lt;span style="color: #0000ff"&gt;BY&lt;/span&gt;&lt;span style="color: #000000"&gt; PRIOR emp_id &lt;/span&gt;&lt;span style="color: #808080"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; emp_boss_id;&lt;br /&gt;  &lt;br /&gt;        LOOP&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt;&lt;span style="color: #000000"&gt; lc_employees &lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;br /&gt;                lr_out_rec.emp_id,    &lt;br /&gt;                lr_out_rec.full_name;&lt;br /&gt;            &lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000ff"&gt;EXIT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt;&lt;span style="color: #000000"&gt; lc_employees&lt;/span&gt;&lt;span style="color: #808080"&gt;%&lt;/span&gt;&lt;span style="color: #000000"&gt;NOTFOUND;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000ff"&gt;PIPE&lt;/span&gt;&lt;span style="color: #000000"&gt; ROW(lr_out_rec);&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;&lt;span style="color: #000000"&gt; LOOP;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000ff"&gt;CLOSE&lt;/span&gt;&lt;span style="color: #000000"&gt; lc_employees;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;REMARKS: The PIPELINED command and PIPE ROW() method, work together to make sure that each row is returned to the caller immediately after it is processed. This helps to avoid having big objects in memory. &lt;br&gt;&lt;br /&gt;&lt;li&gt;To use the function, you need to use the TABLE() function.&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:7873f7a5-4bfe-4e70-a6f4-c77f171d5607" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="width: 100%"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #008080"&gt;--&lt;/span&gt;&lt;span style="color: #008080"&gt; Sample query:&lt;/span&gt;&lt;span style="color: #008080"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #808080"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt;&lt;span style="color: #000000"&gt;(FN_GET_EMPLOYEE_DESCENDANTS(&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;));&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;li&gt;This gives the following results:&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:50ad5bb9-2515-4a25-8452-bbb6d4d91392" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="width: 100%"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000"&gt;EMP_ID    FULL_NAME&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;    Geert Verhoeven&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;3&lt;/span&gt;&lt;span style="color: #000000"&gt;    Al Bino&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;5&lt;/span&gt;&lt;span style="color: #000000"&gt;    Abbie Birthday&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;6&lt;/span&gt;&lt;span style="color: #000000"&gt;    Gene E. Yuss&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;7&lt;/span&gt;&lt;span style="color: #000000"&gt;    Juana Bea&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;4&lt;/span&gt;&lt;span style="color: #000000"&gt;    April May&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;8&lt;/span&gt;&lt;span style="color: #000000"&gt;    Willie Maykit&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;9&lt;/span&gt;&lt;span style="color: #000000"&gt;    Zoltan Pepper&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: #800000"&gt;10&lt;/span&gt;&lt;span style="color: #000000"&gt;    Scott Shawn DeRocks&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-8513247236689214570?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/8513247236689214570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=8513247236689214570' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8513247236689214570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/8513247236689214570'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/create-function-that-returns-table.html' title='Create a function that returns a table'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-7568740517373982407</id><published>2007-07-19T18:05:00.001+01:00</published><updated>2007-07-19T18:05:41.142+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>How (not) to create a deadlock with the Thread.Join() method</title><content type='html'>&lt;p&gt;In one of my projects I needed to be able to execute multiple tasks at the same&amp;nbsp;time and show the results when all the tasks were finished. &lt;/p&gt; &lt;p&gt;The tasks included updating of the user interface. Since you cannot update a control on the user interface from a thread different than the thread that owns the control, you need to use the Control.Invoke method. &lt;/p&gt; &lt;p&gt;Control.Invoke(delegate method) executes the specified delegate on the thread that owns the control. So this way, you can&amp;nbsp;have&amp;nbsp;a&amp;nbsp;second&amp;nbsp;thread&amp;nbsp;make a call to the main thread to update the user interface. So far so good.&lt;/p&gt; &lt;p&gt;The goal was to load&amp;nbsp;multiple datasets in different threads and call a Control.Invoke for each dataset to bind it to a control on&amp;nbsp;the form. After all the threads were finished, I wanted to show the form to the&amp;nbsp;user.&amp;nbsp;&lt;/p&gt; &lt;p&gt;To be able to check that all the threads were finished, I used the Thread.Join() method. This method blocks the main method until the thread finishes. If you create a loop that loops through all the threads you started and call Thread.Join() you are sure that all threads have finished.&lt;/p&gt; &lt;p&gt;The issue with this is that Thread.Join() blocks the main thread. So it also blocks the calls made via Control.Invoke. This is why you can't use Thread.Join() in combination with Control.Invoke. Pretty logic but if you don't realize what is going wrong, you can spent quite some time on it.&lt;/p&gt; &lt;p&gt;References:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a title="http://msdn2.microsoft.com/en-us/library/system.threading.thread.join(vs.80).aspx" href="http://msdn2.microsoft.com/en-us/library/system.threading.thread.join(vs.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.threading.thread.join(vs.80).aspx&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a title="http://msdn2.microsoft.com/en-us/library/zyzhdc6b(vs.80).aspx" href="http://msdn2.microsoft.com/en-us/library/zyzhdc6b(vs.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/zyzhdc6b(vs.80).aspx&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-7568740517373982407?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/7568740517373982407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=7568740517373982407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/7568740517373982407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/7568740517373982407'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/how-not-to-create-deadlock-with.html' title='How (not) to create a deadlock with the Thread.Join() method'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-6563501503101731054</id><published>2007-07-17T11:10:00.001+01:00</published><updated>2007-07-17T11:11:09.686+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Office 2007'/><title type='text'>Blogging with Office 2007</title><content type='html'>&lt;span xmlns=""&gt;&lt;p&gt;Since a few days I'm using Word 2007 to create new blog entries. I've tried several utilities to add new blog entries but was always struggling with the layout. After doing a few tests, I'm very pleased with Word 2007. The only pity is that since I'm using Blogger, I can't upload images and don't have the possibility to add tags (Categories). &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Here is a link on how to get it started &lt;a href="http://spsfactory.blogspot.com/2007/03/blogger-is-integrated-in-microsoft.html"&gt;http://spsfactory.blogspot.com/2007/03/blogger-is-integrated-in-microsoft.html&lt;/a&gt;.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-6563501503101731054?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/6563501503101731054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=6563501503101731054' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/6563501503101731054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/6563501503101731054'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/blogging-with-office-2007_17.html' title='Blogging with Office 2007'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-9113012858186974809</id><published>2007-07-09T20:31:00.001+01:00</published><updated>2007-07-09T20:41:02.743+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>Add a new code group based on a .snk file by using the caspol command line</title><content type='html'>&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;For one of my projects, I needed to be able to give the FullTrust permission to my smart client applications. Since all the applications created at the client are signed using the same strong name key, I've used this to set up the security requirements. &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;p&gt;Normally I would use the ".NET Framework 2.0 Configuration" but not all the user's have the .NET Framework SDK installed (which includes the configuration tool), I used the caspol.exe command line to set the security permissions. &lt;/p&gt;&lt;p&gt;Since it took me quiet some time to get all the parameters right, I thought to give you a head start by posting the commands. &lt;/p&gt;&lt;p&gt;Steps to follow to add a new code group that gives fulltrust to all applications signed by a given snk file. In order to add the strong name to the security policies, you either need to have a signed dll/exe or the snk file. The below sample uses an .snk file. &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Extract the public key from the .snk file (in this case Sample.snk) by using the sn.exe tool:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;sn -p sample.snk sample.pk&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;li&gt;Now you need to have the hex value of the public key (saved in sample.pk). Since notepad doesn't support the format of the .pk file, you need to have a hex editor to open it. I used the free HxD tool which has all the features you need (&lt;/span&gt;&lt;a href="http://mh-nexus.de/hxd/"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://mh-nexus.de/hxd/&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;Open HxD.exeOpen the sample.pk file and copy the hex value.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/RpKOLDnKpvI/AAAAAAAAAGA/dqOci7K2lxs/s1600-h/Screen1.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5085283249853998834" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_DMJte_aP-lA/RpKOLDnKpvI/AAAAAAAAAGA/dqOci7K2lxs/s400/Screen1.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;3. The following command creates the new key in the machine security policy:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;caspol -machine -addgroup 1 -strong -hex "0024000004800000940000000602000000240000525341310004000001000100DDEEAD8B27321D3FB0E872FABDFA62627CCA03864AF3F7A19C6D978788F5DCD89BEFD1B897BAC5C74253091FB6747E2723D5239B802F074B1AC930A9C187D52FCF3ED65AF467F4F656F392CF5E6E2FF69071C398EA931B2EB862F6CE832350B24A6524F06F9F5F630A2B00B30F59A87BC847989D2D09DDD7A49BE92FE2EFB5B2" -noname -noversion FullTrust -name "Code Group Name" -description "Code Group Description" -exclusive on&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;The hex key can not contain any spaces or carriage returns so you need to remove them from the copied result.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/_DMJte_aP-lA/RpKOUjnKpwI/AAAAAAAAAGI/6C-ra4dCR_4/s1600-h/Screen2.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5085283413062756098" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_DMJte_aP-lA/RpKOUjnKpwI/AAAAAAAAAGI/6C-ra4dCR_4/s400/Screen2.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;References: &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;sn.exe: &lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/k5b5tt23(VS.80).aspx"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://msdn2.microsoft.com/en-us/library/k5b5tt23(VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;caspol.exe: &lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://msdn2.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-9113012858186974809?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/9113012858186974809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=9113012858186974809' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/9113012858186974809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/9113012858186974809'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/add-new-code-group-based-on-snk-file-by.html' title='Add a new code group based on a .snk file by using the caspol command line'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_DMJte_aP-lA/RpKOLDnKpvI/AAAAAAAAAGA/dqOci7K2lxs/s72-c/Screen1.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-4024221504209381822</id><published>2007-07-06T18:21:00.000+01:00</published><updated>2007-07-06T18:47:23.799+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ClickOnce'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>Problems when signing my ClickOnce application</title><content type='html'>&lt;div&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;When I tried to sign my ClickOnce application, I received the following error: &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/Ro56iTnKppI/AAAAAAAAAFQ/88Y_SHr4uMo/s1600-h/error.JPG"&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5084135759146559122" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/Ro56iTnKppI/AAAAAAAAAFQ/88Y_SHr4uMo/s400/error.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:78%;color:#666666;"&gt;Unable to find manifest signing certificate in the certificate store.&lt;/span&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;I’ve noticed that even after removing the sign option in the project properties page, the .csproj file (opened with notepad) still contained parameters indicating that the application needed to be signed. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;SignManifests&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;b&gt;true&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;SignManifests&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;ManifestCertificateThumbprint&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;b&gt;ACBE668D16D794DA9E35301D49C834864C4D9C2A&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;ManifestCertificateThumbprint&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;ManifestKeyFile&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;b&gt;GuiWinApp_TemporaryKey.pfx&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;ManifestKeyFile&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;After removing these lines of code and reselecting the .snk file in the property pages, everything worked fine.&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_DMJte_aP-lA/Ro6AFjnKpuI/AAAAAAAAAF4/Ui_3weBrwrg/s1600-h/screen.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5084141862295086818" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_DMJte_aP-lA/Ro6AFjnKpuI/AAAAAAAAAF4/Ui_3weBrwrg/s400/screen.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/5274981767425509778-4024221504209381822?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/4024221504209381822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=4024221504209381822' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/4024221504209381822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/4024221504209381822'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/07/problems-when-signing-my-clickonce.html' title='Problems when signing my ClickOnce application'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_DMJte_aP-lA/Ro56iTnKppI/AAAAAAAAAFQ/88Y_SHr4uMo/s72-c/error.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-5197066778065663276</id><published>2007-04-05T19:42:00.000+01:00</published><updated>2007-09-11T06:54:02.920+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>Creating and using code snippets</title><content type='html'>&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;One of the features that I really appreciate in Visual Studio 2005 is "code snippets". Code snippets help you to speed up the development by giving you shortcuts to frequently used code. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;For example if you want to create a for loop, you simply type for and press the "TAB" button twice. &lt;/span&gt;&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/RhVDZan9nFI/AAAAAAAAAEw/mzbuPA66UHw/s1600-h/Screen+1.bmp"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5050016661088607314" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/RhVDZan9nFI/AAAAAAAAAEw/mzbuPA66UHw/s400/Screen+1.bmp" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;Visual Studio will then automatically generate the code for you as you can see below. &lt;/span&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_DMJte_aP-lA/RhVDqan9nGI/AAAAAAAAAE4/DCZRAPH--tc/s1600-h/Screen+2.bmp"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5050016953146383458" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_DMJte_aP-lA/RhVDqan9nGI/AAAAAAAAAE4/DCZRAPH--tc/s400/Screen+2.bmp" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;By using the tab key, you can navigate to the marked words which enables to specify your own names.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;That's not all. The nicest thing about code snippets is that you can create your own code snippets.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;In the following example, I'll show you how.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;Create a new file &lt;strong&gt;cend.snippet &lt;/strong&gt;within Visual Studio 2005 and save it under the ...\&lt;strong&gt;My Documents\Visual Studio 2005\Code Snippets\Visual C#\My Code Snippets&lt;/strong&gt; folder.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;Copy the following code in the file, I'll explain the code in a minute:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#990000;"&gt;xml&lt;/span&gt; &lt;span style="color:#cc0000;"&gt;version&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;=&lt;/span&gt;"&lt;span style="color:#3333ff;"&gt;1.0&lt;/span&gt;" &lt;span style="color:#cc0000;"&gt;encoding&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;=&lt;/span&gt;"&lt;span style="color:#3333ff;"&gt;utf-8&lt;/span&gt;" &lt;span style="color:#3333ff;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;CodeSnippets&lt;/span&gt; &lt;span style="color:#cc0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;=&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;u&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/u&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;CodeSnippet&lt;/span&gt; &lt;span style="color:#cc0000;"&gt;Format&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;=&lt;span style="color:#000000;"&gt;"&lt;/span&gt;1.0&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Header&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;Shortcut&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;span style="color:#000000;"&gt;cend&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Shortcut&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Title&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;span style="color:#000000;"&gt;End console&lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Title&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Description&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;Code snippet for ending a console application&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Description&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Header&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Snippet&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Declarations&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Literal&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;ID&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;EndMessage&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;ID&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Default&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;Press any key to continue ... &lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Default&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Literal&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Declarations&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;Code&lt;/span&gt; &lt;span style="color:#cc0000;"&gt;Language&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;=&lt;span style="color:#000000;"&gt;"&lt;/span&gt;CSharp&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;![CDATA[&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#999999;"&gt;Console.WriteLine("$EndMessage$");&lt;br /&gt;Console.ReadLine();&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;]]&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Code&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;Snippet&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#990000;"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;Save the file and open a C# application. In one of the .cs files, type cend which will popup the intellisense menu.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://1.bp.blogspot.com/_DMJte_aP-lA/RhVGnKn9nHI/AAAAAAAAAFA/24xKKcN_TRo/s1600-h/Screen+3.bmp"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5050020195846691954" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_DMJte_aP-lA/RhVGnKn9nHI/AAAAAAAAAFA/24xKKcN_TRo/s400/Screen+3.bmp" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;When you press the "TAB" key twice, the following code will be generated:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/RhVG1qn9nII/AAAAAAAAAFI/lyQ0xBKHmgs/s1600-h/Screen+4.bmp"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5050020444954795138" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_DMJte_aP-lA/RhVG1qn9nII/AAAAAAAAAFI/lyQ0xBKHmgs/s400/Screen+4.bmp" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;How does it work:&lt;br /&gt;The second line in the snippet file informs Visual Studio to use an xsd to help you by providing intellisense (the xsd is located in C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\1033\snippetformat.xsd depending on where you installed VS):&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;CodeSnippets&lt;/span&gt; &lt;span style="color:#cc0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;=&lt;/span&gt;"&lt;span style="color:#3333ff;"&gt;&lt;u&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/u&gt;&lt;/span&gt;"&lt;span style="color:#3333ff;"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;The shortcut contains the shortcut that you can use to reference to your code snippet. You can also reference the code snippets via the menu or via the &lt;strong&gt;Ctrl+K, Ctrl+X &lt;/strong&gt;combination.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;A literal is a variable that can be used within your code snippet. When using the code snippet, each literal is a placeholder for user input. You can add a default value as done in the sample.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;Within the code element, comes the real code snippet. It is embedded in a CDATA element to be able to include special elements in the xml document.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;It is possible to create multiple snippets (1 snippet per file).&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-5197066778065663276?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/5197066778065663276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=5197066778065663276' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5197066778065663276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/5197066778065663276'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/04/creating-and-using-code-snippets.html' title='Creating and using code snippets'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DMJte_aP-lA/RhVDZan9nFI/AAAAAAAAAEw/mzbuPA66UHw/s72-c/Screen+1.bmp' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-3933156906817776921</id><published>2007-03-18T20:07:00.000+01:00</published><updated>2007-03-19T08:10:45.369+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><category scheme='http://www.blogger.com/atom/ns#' term='Book'/><title type='text'>Finally passed the 70-300 exam</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;The last weeks it has been very quited on my blog since I've been busy with studying for the 070-300 exam. This is one of the exams that I was planning for a long time but never had the time to do it. So last friday I finally passed it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;I've used the MS PRESS book (Analyzing Requirements and Defining Microsoft .NET Solution Architectures, Exam 70-300) to study for the exam. The book is pretty good but I found that the MOC 2710 was more related to the exam.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-3933156906817776921?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/3933156906817776921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=3933156906817776921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3933156906817776921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3933156906817776921'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/03/finally-passed-70-300-exam.html' title='Finally passed the 70-300 exam'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-3501677682620526931</id><published>2007-03-01T20:05:00.000+01:00</published><updated>2008-01-18T10:04:33.447+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Could not load file or assembly after installing LINQ May 2006 CTP</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;When working with the class designer in Visual Studio 2005 I received the following error:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/Recl5ntjn5I/AAAAAAAAAEI/PrNaJjmrMzU/s1600-h/Error.JPG"&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_DMJte_aP-lA/Recmfntjn6I/AAAAAAAAAEQ/30ty2_atnNA/s1600-h/Error.JPG"&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_DMJte_aP-lA/Recm_3tjn7I/AAAAAAAAAEY/78VbFzVI6ec/s1600-h/Error.JPG"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5037037586965831602" style="" alt="" src="http://4.bp.blogspot.com/_DMJte_aP-lA/Recm_3tjn7I/AAAAAAAAAEY/78VbFzVI6ec/s400/Error.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color: rgb(102, 102, 102);font-size:78%;" &gt;&lt;em&gt;Could not load file or assembly 'Microsoft.VisualStudio.CSharp.Services.Language, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I remembered that I installed the "Microsoft Visual Studio Code Name “Orcas” Language-Integrated Query, May 2006 Community Technology Preview" the day before. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;After uninstalling the Linq CTP, everything worked fine again. I didn't find a real solution yet but since it is a CTP version I don't bother too much.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-3501677682620526931?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/3501677682620526931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=3501677682620526931' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3501677682620526931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3501677682620526931'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/03/after-installing-linq-may-2006-ctp.html' title='Could not load file or assembly after installing LINQ May 2006 CTP'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_DMJte_aP-lA/Recm_3tjn7I/AAAAAAAAAEY/78VbFzVI6ec/s72-c/Error.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5274981767425509778.post-3042079358143993338</id><published>2007-02-22T20:06:00.000+01:00</published><updated>2007-07-09T20:45:07.282+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Get the value of the identity column after inserting a record</title><content type='html'>&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;Aparently there are still a lot of people who are having problems when inserting rows in a table that has an identity field. Sometimes you need to have the id of the record you just inserted to be able to use it afterwards.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;Yesterday I saw someone doing a &lt;span style="font-family:courier new;"&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; &lt;span style="color:#cc33cc;"&gt;MAX&lt;/span&gt;(id) &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; MyTable&lt;/span&gt; to be able to get the maximum id and then raise it by 1. This gives 2 issues:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;what if someone else has added a row after you selected the maximum value?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;what if the identity increment is not 1?&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;In SQL Server there is a function SCOPE_IDENTITY() that returns the last used identity within the scope of the statement. If you add this to the end of your statement, you can return the value of the identity column.&lt;br /&gt;&lt;br /&gt;Here is a sample that shows you how to do it (NOTE the end of the select statement):&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="OVERFLOW-X: scroll; OVERFLOW: auto; WIDTH: 460px"&gt;&lt;pre style="WIDTH: 1000px"&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#3333ff;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:#3333ff;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color:#3333ff;"&gt;int&lt;/span&gt; identity = -1;&lt;br /&gt;   &lt;span style="color:#3333ff;"&gt;string&lt;/span&gt; connectionString = &lt;span style="color:#990000;"&gt;"Data Source=LP51; Initial Catalog=Northwind; User Id=sa; Password=P@ssw0rd;"&lt;/span&gt;;&lt;br /&gt;   &lt;span style="color:#3333ff;"&gt;string&lt;/span&gt; sql = &lt;span style="color:#990000;"&gt;"INSERT INTO Employees (LastName, FirstName) VALUES (@LastName, @FirstName) SELECT SCOPE_IDENTITY()"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#339999;"&gt;   SqlConnection&lt;/span&gt; conn = &lt;span style="color:#3333ff;"&gt;new&lt;/span&gt;&lt;span style="color:#339999;"&gt; SqlConnection&lt;/span&gt;(connectionString);&lt;br /&gt;   &lt;span style="color:#339999;"&gt;SqlCommand&lt;/span&gt; cmd = &lt;span style="color:#3333ff;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;SqlCommand&lt;/span&gt;(sql, conn);&lt;br /&gt;   cmd.Parameters.&lt;span style="color:#000000;"&gt;AddWithValue(&lt;/span&gt;&lt;span style="color:#990000;"&gt;"@LastName"&lt;/span&gt;, &lt;span style="color:#990000;"&gt;"Verhoeven"&lt;/span&gt;);&lt;br /&gt;   cmd.Parameters.AddWithValue(&lt;span style="color:#990000;"&gt;"@FirstName"&lt;/span&gt;, &lt;span style="color:#990000;"&gt;"Geert"&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;&lt;p&gt;&lt;br /&gt;   &lt;span style="color:#3333ff;"&gt;try&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;      conn.Open();&lt;br /&gt;      identity = &lt;span style="color:#3333ff;"&gt;int&lt;/span&gt;.Parse(cmd.ExecuteScalar().ToString());&lt;br /&gt;   }&lt;br /&gt;   &lt;span style="color:#3333ff;"&gt;catch&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;      &lt;span style="color:#009900;"&gt;// implement exception handling here&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;   &lt;span style="color:#3333ff;"&gt;finally&lt;/span&gt;&lt;br /&gt;   {&lt;br /&gt;      conn.Dispose();&lt;br /&gt;      cmd.Dispose();&lt;br /&gt;   }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;   &lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#990000;"&gt;"The identity is {0}"&lt;/span&gt;, identity);&lt;br /&gt;   &lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#990000;"&gt;"Press any key to continue ..."&lt;/span&gt;);&lt;br /&gt;   &lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5274981767425509778-3042079358143993338?l=geertverhoeven.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geertverhoeven.blogspot.com/feeds/3042079358143993338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5274981767425509778&amp;postID=3042079358143993338' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3042079358143993338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5274981767425509778/posts/default/3042079358143993338'/><link rel='alternate' type='text/html' href='http://geertverhoeven.blogspot.com/2007/02/get-value-of-identity-column-after.html' title='Get the value of the identity column after inserting a record'/><author><name>Geert Verhoeven</name><uri>http://www.blogger.com/profile/04897992588367919830</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12224135978182298814'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry></feed>