<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Rajiv Popat</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/rajiv/Atom.aspx" />
    <subtitle type="html">blog</subtitle>
    <id>http://geekswithblogs.net/rajiv/Default.aspx</id>
    <author>
        <name>Rajiv Popat</name>
        <uri>http://geekswithblogs.net/rajiv/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2006-11-05T15:01:00Z</updated>
    <entry>
        <title>Moved to a new blog</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/11/05/96187.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/11/05/96187.aspx</id>
        <published>2006-11-05T15:00:00-06:00:00</published>
        <updated>2006-11-05T15:01:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This blog has moved to &lt;A href="http://www.thousandtyone.com/blog"&gt;http://www.thousandtyone.com/blog&lt;/A&gt;. &lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;GWB has been a great community and I've learnt a lot by reading the Feed! It has been fun blogging here; I'll continue to Agregate with the GWB feed and read&amp;nbsp;posts but &lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;becuase of my inability to maintain multiple blogs:),&amp;nbsp; all my future posts will be posted at my new blog!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Please do visit!&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/96187.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/96187.aspx</wfw:comment>
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/96187.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/96187.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Customizing the Dot Net Nuke Search Input</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/04/13/75088.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/04/13/75088.aspx</id>
        <published>2006-04-13T07:22:00-05:00:00</published>
        <updated>2006-09-22T00:21:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Tahoma&gt;Customizing - DotNetNuke Search Input - The Problem&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;In a Recent Project I had felt the need to customize the DotNetNuke search input. If you've used DotNetNuke Search Inputs before you might have realized that the search Input Module is a little limiting in terms of customization. So, basically the kind of search inputs that you can have in DotNetNuke (based on what I currently know) are:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG height=59 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture1.gif" width=188 border=0&gt;&lt;FONT face=Tahoma size=2&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Of course, you could customize this slightly or you could have another kind with a picture just by changing the module settings:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG height=48 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture2.gif" width=200 border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;And Finally you can have one with a search button (which of course can also be further customized)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/index.1.gif" border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;How Ever there are times where&amp;nbsp;you might want to further customize this Module beyond the out of box customizations that are allowed by DotNetNuke. The Control of course is available under Admin/Search/SearchInput.ascx but then again changing core modules is not such a good idea, is it?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Recently I had small requirement on a project which uses DotNetNuke where I had to customize this input and display something like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&amp;nbsp;&lt;IMG height=142 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture8.gif" width=179 border=0&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Customizing - DotNetNuke Search Input - The Solution&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Apparently, I didn't find anything out of the box in DotNetNuke that will let me reach this level of customization and modifying the core didn't seem like such a good idea anyways - So I started out by taking a copy of the Two Files - SearchInput.ascx and InputSettings.ascx and App_LocalResource Folder (which has the resource files). &lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt;Created a New Folder Under DesktopModules Folder Called CutomizedSearch which now contained a Copy of those two files and the resource files inside a App_LocalResource sub folder. &lt;/FONT&gt;&lt;FONT face=Tahoma size=2&gt;I started out by modifying the Code For SearchInput.ascx by Adding a new TR and moving the buttons in the next Row &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/index.3.jpg" border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Once&amp;nbsp; Done I Added A new Module Definition by replicating the exact settings that were present in the module definition for the default search input module. Once done I dropped the module on my site and executed it:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG height=116 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture6.gif" width=197 border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;So Far So Good, Next I Set out to replacing the image with one I wanted using preferred DotNetNuke method of customization. For this I modified the resource files in my Customized Module's folder to point to the New Image.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG height=74 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture7.gif" width=169 border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Now, I Set out to write a New Container - my ultimate aim was to make the search box look like this -&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG height=142 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture8.gif" width=179 border=0&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;For this I started out with the CSS (provided by highly efficient graphics person) and quickly wrote up quick Container Code which was some fairly simple HTML.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Zipped the container and uploaded it and allowed DNN to do the rest. Now that I was controlling the Title and area around the text box with the container the "Inside" (the actual control was still white) - I made minor modifications to TD's of SearchInput.ascx file that I had copied just to make sure the correct style were being applied to the body of the control as well, aligned&amp;nbsp;the button within the TD&amp;nbsp;and Ran the Code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT face=Tahoma size=2&gt;&lt;IMG height=115 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture9.gif" width=394 border=0&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT face=Tahoma size=2&gt;The Image on the left shows the basic point I had started out with Dot Net Nuke Search box. Image On the Right is where I had arrived. The lines of code that I wrote pertaining to Search - 0! Finally I topped it with a cherry - by setting the default text of search box exactly as needed in the Project and doing some more polishing:&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;IMG height=142 src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/DNNSearchInputPost/picture8.gif" width=179 border=0&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT face=Tahoma size=2&gt;Now that I'm done - I'm thinking - could this have been done in a simpler / better / more elegant way? Anyone out there who would rather do it differently?&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=left&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/75088.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/75088.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/75088.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/75088.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Office 2007, The New Interface - Ahh! So That's what they've Been Hiding!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/06/28/83470.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/06/28/83470.aspx</id>
        <published>2006-06-28T10:59:00-05:00:00</published>
        <updated>2006-09-22T00:16:00Z</updated>
        <content type="html">&lt;FONT face=Calibri&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;&amp;#8220;Huh!?&amp;#8221; &amp;#8211; that&amp;#8217;s how I reacted when I first started a Word 2007 instance early this week. Now, as you can see (from the image below) the reaction was a combination of both surprise and&amp;#8230; more surprise.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/Office2007Post/Word2007interface.gif"&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;Here are some surprises (All Pleasant ones) &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Where did my Menu&amp;#8217;s go? &lt;/I&gt;That's Gone! Yadda! Zip! Choo! Gone! Just Like That! At least in Microsoft Word, PowerPoint and Excel. The Ribbon (which is like a really cool tabbed menu) is a pleasant experience to work with. Outlook (which has&amp;nbsp;tons of new features)&amp;nbsp;still has the old menu type navigation. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Smart Tabs In Ribbon - &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/I&gt;It looked like the ribbon had all picture related menu&amp;#8217;s missing! Then I inserted a picture and a Format Tab just magically showed up! Sweet! Way better than disabling and enabling Menus.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;My Office 2003 Shortcuts still work &lt;/I&gt;&amp;#8211; I discovered this out of my instinct to press ALT + T + O to go into word options. Even though no tool&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;menu existed Word Very Smartly asked me to &amp;#8220;Continue typing the Office 2003 menu key sequence&amp;#8221; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Outlook search is Real Time and Way Cooler &lt;/I&gt;&amp;#8211; outlook comes&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;with a REALLY Cool MSN Search that searches my indexed emails (full header and messages) real time as I type. &lt;I style="mso-bidi-font-style: normal"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Quick Launch bars&lt;/I&gt; &amp;#8211; the items next to the office button &amp;#8211; these is VERY Intelligent use of title bar. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Microsoft Office Button - &lt;/I&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;The Office Button at the top left corresponded to File Menu on Steroids. This thing has tons of new features like the ability to blog using Microsoft word and create shared workspaces. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana size=2&gt;&lt;EM&gt;The Dam thing is skin-able&lt;/EM&gt; &amp;#8211; all I can say is&amp;#8230; &amp;#8220;at last!&amp;#8221;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Verdana size=2&gt;I would type more but my tired fingers won&amp;#8217;t let me&amp;#8230; Let&amp;#8217;s just say I am on 2007 Beta and wouldn&amp;#8217;t mind using it as my Primary Office application. It&amp;#8217;s fairly stable and Worth a try!!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/83470.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/83470.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/83470.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/83470.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Transactions, Identity Columns and Foreign Key Constraint Errors - The Chicken Egg Situation</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/09/08/90668.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/09/08/90668.aspx</id>
        <published>2006-09-08T13:18:00-05:00:00</published>
        <updated>2006-09-22T00:13:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I faced this problem while using &lt;A href="http://community.codesmithtools.com/blogs/tutorials/archive/2006/02/13/nettiers.aspx" target=_blank&gt;NetTires&lt;/A&gt; which I highly recommend for anyone who wants to quickly generate a Data Access Layer using Microsoft Enterprise Library without having to do the grunt work and writing boilerplate Data Access Code. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;In my efforts to not digress from the Topic I am going to keep some other data access mechanisms that I've used in the past out of the scope of this post and just state that &lt;A href="http://community.codesmithtools.com/blogs/tutorials/archive/2006/02/13/nettiers.aspx" target=_blank&gt;NetTires&lt;/A&gt; is a Decent enough Data Access Mechanism I am currently in love with and am using it for a personal open source initiative. So, coming back to the point...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;What's the problem? &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;"If you have two Tables having a Parent Child relationship bound by key which is an Identity Column Directly trying to Save the parent followed by the child in a single Transaction leads to a Foreign Key Violation Exception" - To Elaborate further I explain with an example. Consider the tables Student and Student Marks which are hooked to together into a one-to-many relationship by a StudentID which is an Identify Column.&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://thousandtyone.com/externalsupport/blogimages/gwbrajiv/ForeignKeyViolationPost/BlogPostKeyViolation.gif"&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, if my application has a screen where a person enters student information and his marks at one single shot and I want to ensure that I either save the entire information entered (for both student and his marks) at one shot or nothing at all I would use transactions. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The steps involved would be typically open a transaction in ASP.NET (using &lt;A href="http://community.codesmithtools.com/blogs/tutorials/archive/2006/02/13/nettiers.aspx" target=_blank&gt;NetTires&lt;/A&gt; in my case; or directly ADO.NET in other cases), save changes to Students table followed by saving changes to Student Exams table, followed by Committing the transaction. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, what ever I've said till now "sounds" logical but it's not. The catch here is that I am using Identity Columns To identity a student and identity columns are generated by the database. So, assuming that this is the second student I am adding SQL Server generates Student ID as 2. The catch here is that there's no way to find out that 2 was Generated unless I've committed the transaction since the value 2 doesn't make it to the data base table unless the transaction is committed!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, basically you can't save the child till you commit the parent and a transaction is not considered committed till both parent and child are successfully saved. A chicken-egg situation (somewhat).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;And The Solution?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This is a classic ADO.NET problem (it's not even a problem, since it's been solved so many times before) and&amp;nbsp;a lot of us might have&amp;nbsp;addressed this in the past using &lt;A href="http://groups.google.co.in/group/microsoft.public.dotnet.framework.adonet/browse_thread/thread/19368c709e8d9878/2d258afbf3883aef?lnk=st&amp;amp;q=ADO.NET+Transaction+Identity&amp;amp;rnum=2&amp;amp;hl=en#2d258afbf3883aef" target=_blank&gt;this approach&lt;/A&gt;&amp;nbsp;or some form of it. With &lt;A href="http://community.codesmithtools.com/blogs/tutorials/archive/2006/02/13/nettiers.aspx" target=_blank&gt;NetTires&lt;/A&gt; the situation is a little difficult to track and fix specially when using DeepSave on the Parent (in our example Students) object. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;A little bit of investigation into the nHibernate Generated stored procedures revealed that they were intelligently using &lt;B&gt;SELECT SCOPE_IDENTITY. &lt;/B&gt;This means that a DeepSave on Student Table that was giving Foreign key violation exception can be fixed by:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana size=2&gt;
&lt;OL&gt;
&lt;LI&gt;Not Using Transactions with Deep Save. This ensures that student is saved to DB and then StudentExam save is attempted. (Not really a solution, but a Band-aid - if you're looking for one :)) &lt;B&gt;&lt;BR&gt;&lt;BR&gt;OR&lt;BR&gt;&amp;nbsp;&lt;/B&gt; 
&lt;LI&gt;Using the Following Algorithm: 
&lt;OL&gt;
&lt;LI&gt;Open A Transaction using a TransactionManager object; 
&lt;LI&gt;Call the Save Method of Student Entity by passing the same TransactionManager object (Don't Deep Save!); 
&lt;LI&gt;Once you do this the &lt;B&gt;SELECT SCOPE_IDENTITY &lt;/B&gt;at the end of each generated stored procedure ensures that StudentID now has the new generated ID value even though the transaction hasn't committed! 
&lt;LI&gt;This Means that now it's possible to iterate through the collection of StudentExamsCollection available in the student object and do something like:&lt;BR&gt;objStudent.StudentExamCollection[i].StudentID = objStudent.ID (inside the for loop that's iterating through these objects). 
&lt;LI&gt;Once this is done all your data is consistent. Call the Save Method of StudentExams table by passing the same TransactionManager object; 
&lt;LI&gt;Commit the transaction.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The whole Identity Column Vs. GUID's is a religious argument and this problem doesn't exist in the GUID world; but the GUID Vs. Identity Column argument&amp;nbsp;for another post :) - &lt;/P&gt;
&lt;P&gt;So, this post&amp;nbsp;is my two cents, if you're using Identity Columns with connected tables and transactions, and are running into Foreign Key Constraints.&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/90668.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/90668.aspx</wfw:comment>
        <slash:comments>5</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/90668.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/90668.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Back To The Basics And Beyond! Generic Methods and Multiple Constraints.</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/09/09/90745.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/09/09/90745.aspx</id>
        <published>2006-09-09T13:14:00-05:00:00</published>
        <updated>2006-09-11T10:55:00Z</updated>
        <content type="html">&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;A couple of days ago I was asked if there was any way by which I could overload a method to "return" more than one type. If I was in a class room, or I was teaching a programming class (I've done that for some part of my life :)) my instant answer would have been "No." And then I would have proceeded to explain why the whole idea was not valid in the Object Orientation world.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;However, this question was not coming from a high school student. In all probabilities it was coming based on a practical requirement and business problem.&amp;nbsp; My reaction to this question was: "why do you want to do something like that?" - At the first sound of it the question sounds like a fundamental High school Object Orientation question. But it isn't.&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;C# 2.0 and Generics is changing the fundamental way in which DotNet Programmers (me included; If&amp;nbsp;I can can call myself a real programmer :)) are thinking. Any programmer worth his salt is asking himself some very basic and fundamental questions: How can I write better and lesser code? How can I write Generic Code? How can I write Code which I can reuse and leverage in situations which are "somewhat similar", even if they are not exactly the same. Anyway, I Digress...&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;So, this Post is about trying to answer that question. But before I attempt to answer it I would like to rephrase the question a little bit: The question (if you really think about it) that I heard was:&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;B&gt;&lt;FONT face=Verdana size=2&gt;"If I need to write the exactly same functions which have the exact same 'business logic' but need to return 5 different types do I really HAVE TO Write 5 different functions with completely different Names?"&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;My answer to that is: Not Really. I Fumble a bit with syntaxes and memory every now and then so I'm going to Google for syntaxes and give some basic code examples to explain my point as I type, but long story short I think the answer to this question is &lt;B&gt;"Generic Methods with Constraints". &lt;/B&gt;If you know what these are and have already seen where I am going with this the rest of the post is not for you. If you don't know what these are Read on. &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;&lt;B&gt;If You Goggled to this page to find the syntax of how you can have a different Constraint for each Generic Parameter and Return Type skip the rant and go to the "Yet Another Long Example" section.&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;With Generic Methods I Keep the method Generic (wow! that was easy to explain :)). In other words, While writing the method I don't specific what is the type of Parameters it expects or the Type of object it returns. The following code snippet illustrates:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 public\cf8  \cf7 static\cf8  T WhatsGreater&lt;T&gt;(T x, T y) \par ??        \{\par ??                \cf3 // Implementation\par ??\cf8         \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; T WhatsGreater&lt;T&gt;(T x, T y) &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// Implementation&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Worth noticing that in the above code all I am telling the compiler is: &lt;B&gt;"Function WhatsGreater is going to Expect two Parameter of Type T and return an object of Type T where the calling code is going to tell you what T is"&lt;/B&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Now, we do have a problem here. Since we've told the compiler nothing about T it means that the calling code can specify T to be any class or type. And Since I know nothing about T when I am writing this function it makes it really difficult for me to implement this function. In other words, while writing the implementation I have to "assume" that T is could be anything. It could even be an object of the "object" type. &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;This is where Constraints come into play. By Using Constraints I narrow down the possibilities of what T can be. For Example, I could tell he compiler.&amp;nbsp; &lt;B&gt;"Function WhatsGreater is going to Expect two Parameter of Type T and return an object of Type T where the calling code is going to tell you what T is, BUT T HAS TO Implement the IComparable Interface!"&lt;/B&gt; The following Code Illustrates:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 public\cf8  \cf7 static\cf8  T WhatsGreater&lt;T&gt;(T x, T y) \cf7 where\cf8  T : \cf10 IComparable\par ??\cf8         \{\par ??                \cf3 // Implementation\par ??\cf8         \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; T WhatsGreater&lt;T&gt;(T x, T y) &lt;SPAN style="COLOR: yellow"&gt;where&lt;/SPAN&gt; T : &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// Implementation&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Now that I can be sure that both x and y are going to implement the IComparable Interface (because they're objects of T), I can actually "compare" them by assuming that they will implement the methods IComparable Expects them to implement (methods like CompareTo). Following Code Snippet Illustrates:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 public\cf8  \cf7 static\cf8  T WhatsGreater&lt;T&gt;(T x, T y) \cf7 where\cf8  T : \cf10 IComparable\par ??\cf8         \{\par ??\par ??            \cf7 if\cf8  (x.CompareTo(y) &gt; 0) \cf3 // if x is greater than y\par ??\cf8                 \cf7 return\cf8  x;\par ??            \cf7 else\cf8  \cf7 return\cf8  y;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; T WhatsGreater&lt;T&gt;(T x, T y) &lt;SPAN style="COLOR: yellow"&gt;where&lt;/SPAN&gt; T : &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;if&lt;/SPAN&gt; (x.CompareTo(y) &amp;gt; 0) &lt;SPAN style="COLOR: aqua"&gt;// if x is greater than y&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; x;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; y;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;So, what we now have is a generic function that I can use with Any object that uses the IComparable Interface! Let's try calling this was two integers:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??            \cf7 int\cf8  GreaterInteger = WhatsGreater&lt;\cf7 int\cf8 &gt;(40,15);\par ??            \cf7 Console\cf8 .WriteLine(\cf4 "Greater Integer is : "\cf8  + GreaterInteger.ToString());\par ??            \cf7 Console\cf8 .Read(); \cf3 // Wait Till I See the Output\par ??\cf8         \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; GreaterInteger = WhatsGreater&amp;lt;&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;&amp;gt;(40,15);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: lime"&gt;"Greater Integer is : "&lt;/SPAN&gt; + GreaterInteger.ToString());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.Read(); &lt;SPAN style="COLOR: aqua"&gt;// Wait Till I See the Output&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;In the above code snippet, notice that I specify that T is an integer (in the calling code)&amp;nbsp;and that I am Passing two integers to WhatsGreater method when I say &lt;B&gt;"WhatsGreater&lt;INT&gt;(40,15)" &lt;/B&gt;- Alternately I could have also specified that T is a double. The following Code snippet illustrates:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??            \cf7 double\cf8  GreaterFloat = WhatsGreater&lt;\cf7 double\cf8 &gt;(40.0,15.0);\par ??            \cf7 Console\cf8 .WriteLine(\cf4 "Greater Integer is : "\cf8  + GreaterFloat.ToString());\par ??            \cf7 Console\cf8 .Read(); \cf3 // Wait Till I See the Output\par ??\cf8         \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;double&lt;/SPAN&gt; GreaterDouble = WhatsGreater&amp;lt;&lt;SPAN style="COLOR: yellow"&gt;double&lt;/SPAN&gt;&amp;gt;(40.0,15.0);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: lime"&gt;"Greater Double is : "&lt;/SPAN&gt; + GreaterDouble .ToString());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.Read(); &lt;SPAN style="COLOR: aqua"&gt;// Wait Till I See the Output&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;So, Apparently &lt;B&gt;I can use the same "WhatsGreater" function in a Type Safe Manner and Make it return different Data Types without resorting to any boxing / un-boxing.&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Now, I spend a couple of minutes on a Rattle which explains why this code is better than the convectional way of doing it. If you're already convinced that it is better, feel free to skip the next few code snippets and go to the &lt;B&gt;"Another Long Example"&lt;/B&gt; section. &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;To any object oriented programmer this doesn't sound like a big deal. Does it? You could do this same thing with fundamentals of inheritance. The below code snippet would achieve the exactly same thing without generics:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 public\cf8  \cf7 static\cf8  \cf10 IComparable\cf8  WhatsGreaterWithoutGenerics(\cf10 IComparable\cf8  x, \cf10 IComparable\cf8  y)\par ??        \{\par ??            \cf7 if\cf8  (x.CompareTo(y) &gt; 0) \cf3 // if x is greater than y\par ??\cf8                 \cf7 return\cf8  x;\par ??            \cf7 else\cf8  \cf7 return\cf8  y;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt; WhatsGreaterWithoutGenerics(&lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt; x, &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt; y)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;if&lt;/SPAN&gt; (x.CompareTo(y) &amp;gt; 0) &lt;SPAN style="COLOR: aqua"&gt;// if x is greater than y&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; x;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; y;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;And the calling Code:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??           \cf7 int\cf8  t  = (\cf7 int\cf8 ) WhatsGreat(5, 4);\par ??           \cf7 Console\cf8 .WriteLine(t.ToString());\par ??           \cf7 Console\cf8 .Read();\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; t&amp;nbsp; = (&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;) WhatsGreat(5, 4);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.WriteLine(t.ToString());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.Read();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;This old technique works too, much like the generic method implementation &lt;B&gt;BUT It's not type safe&lt;/B&gt;. In other words if I changed the implementation of WhatsGreaterWithoutGenerics method to return a double instead of an int (which the calling code is "expecting") it would result in a &lt;B&gt;runtime exception. &lt;/B&gt;The following code snippet illustrates:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??           \cf7 int\cf8  t = (\cf7 int\cf8 )WhatsGreaterWithoutGenerics(5, 4);\par ??            \cf3 // The above line results in a Runtime Exception! \par ??\cf8            \cf7 Console\cf8 .WriteLine(t.ToString());\par ??           \cf7 Console\cf8 .Read();\par ??        \}\par ??\par ??        \cf7 public\cf8  \cf7 static\cf8  \cf10 IComparable\cf8  WhatsGreaterWithoutGenerics(\cf10 IComparable\cf8  x, \cf10 IComparable\cf8  y)\par ??        \{\par ??         \cf3 // just return a double\par ??\cf8             \cf7 double\cf8  returnValue = 4.3;\par ??            \cf7 return\cf8  returnValue;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; t = (&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;)WhatsGreaterWithoutGenerics(5, 4);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// The above line results in a Runtime Exception! &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.WriteLine(t.ToString());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.Read();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt; WhatsGreaterWithoutGenerics(&lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt; x, &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt; y)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// just return a double&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;double&lt;/SPAN&gt; returnValue = 4.3;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; returnValue;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Now, let's do the same thing on the Generic Method:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??           \cf7 int\cf8  i = WhatsGreater&lt;\cf7 int\cf8 &gt;(5, 4);\par ??           \cf7 Console\cf8 .WriteLine(i.ToString());\par ??           \cf7 Console\cf8 .Read();\par ??        \}\par ??\par ??        \cf7 public\cf8  \cf7 static\cf8  T WhatsGreater&lt;T&gt;(T x, T y) \cf7 where\cf8  T : \cf10 IComparable\par ??\cf8         \{\par ??            \cf3 // Let's try returning a double\par ??\cf8             \cf7 int\cf8  g = 5;\par ??            \cf7 return\cf8  g;\par ??            \cf3 // This Results in a Compilation Error Becuase this method is type safe!\par ??\cf8         \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; i = WhatsGreater&amp;lt;&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;&amp;gt;(5, 4);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.WriteLine(i.ToString());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.Read();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; T WhatsGreater&lt;T&gt;(T x, T y) &lt;SPAN style="COLOR: yellow"&gt;where&lt;/SPAN&gt; T : &lt;SPAN style="COLOR: teal"&gt;IComparable&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// Let's try returning a double&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;double&lt;/SPAN&gt; g = 5;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; g;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// This Results in a Compilation Error Because this method is type safe!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Obviously this doesn't even compile. Because the method is Type Safe and it has to return an object of T i.e. x or y. The point that I'm trying to make from this long story is that A Generic method could return more than one type of object (depending on how you call it) in a Type Safe manner. &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;&lt;B&gt;Yet Another Long Example&lt;/B&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;When talking about fundamental concepts I prefer not to use too much code. It just confuses things badly. But now that I've explained the basic concept I'm trying to write another example to show how the same concepts explained above could be utilized to address something very different.&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Below code snippet contains three basic interfaces, A Guy and A Girl (who are going to get married, and when they do the last name of the girl will change to that of the guy's):&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1     \cf7 public\cf8  \cf7 interface\cf8  \cf10 IGuy\cf8  \par ??    \{\par ??        \cf3 // The FirstName of the Guy Followed by A Space Followed By the Last Name\par ??\cf8          \cf7 string\cf8  GuysName \{ \cf7 get\cf8 ; \cf7 set\cf8 ; \} \par ??    \}\par ??\par ??    \cf7 public\cf8  \cf7 interface\cf8  \cf10 IGirl\par ??\cf8     \{\par ??        \cf3 // The FirstName of the Guy Followed by A Space Followed By the Last Name\par ??\cf8         \cf7 string\cf8  GirlsName \{ \cf7 get\cf8 ; \cf7 set\cf8 ; \} \par ??    \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;interface&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;IGuy&lt;/SPAN&gt; &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// The FirstName of the Guy Followed by A Space Followed By the Last Name&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; GuysName { &lt;SPAN style="COLOR: yellow"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: yellow"&gt;set&lt;/SPAN&gt;; } &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;interface&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;IGirl&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// The FirstName of the Guy Followed by A Space Followed By the Last Name&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; GirlsName { &lt;SPAN style="COLOR: yellow"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: yellow"&gt;set&lt;/SPAN&gt;; } &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;And their Implementation: &lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1     \cf7 public\cf8  \cf7 class\cf8  \cf7 Guy\cf8  : \cf10 IGuy\par ??\cf8     \{\par ??        \cf7 private\cf8  \cf7 string\cf8  _GuysName = \cf4 ""\cf8 ;\par ??        \cf7 public\cf8  \cf7 string\cf8  GuysName\par ??        \{\par ??            \cf7 get\cf8  \{ \cf7 return\cf8  _GuysName;  \}\par ??            \cf7 set\cf8  \{ _GuysName = \cf7 value\cf8 ; \}\par ??        \}\par ??    \}\par ??    \cf7 public\cf8  \cf7 class\cf8  \cf7 Girl\cf8  : \cf10 IGirl\par ??\cf8     \{\par ??        \cf7 private\cf8  \cf7 string\cf8  _GirlsName = \cf4 ""\cf8 ;\par ??        \cf7 public\cf8  \cf7 string\cf8  GirlsName\par ??        \{\par ??            \cf7 get\cf8  \{ \cf7 return\cf8  _GirlsName; \}\par ??            \cf7 set\cf8  \{ _GirlsName = \cf7 value\cf8 ; \}\par ??        \}\par ??    \}\par ??    \cf7 public\cf8  \cf7 class\cf8  \cf7 Wife\cf8  : \cf10 IWife\par ??\cf8     \{\par ??        \cf7 private\cf8  \cf7 string\cf8  _WifesName = \cf4 ""\cf8 ;\par ??        \cf7 public\cf8  \cf7 string\cf8  WifesName\par ??        \{\par ??            \cf7 get\cf8  \{ \cf7 return\cf8  _WifesName; \}\par ??            \cf7 set\cf8  \{ _WifesName = \cf7 value\cf8 ; \}\par ??        \}\par ??    \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;Guy&lt;/SPAN&gt; : &lt;SPAN style="COLOR: teal"&gt;IGuy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; _GuysName = &lt;SPAN style="COLOR: lime"&gt;""&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; GuysName&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; _GuysName;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;set&lt;/SPAN&gt; { _GuysName = &lt;SPAN style="COLOR: yellow"&gt;value&lt;/SPAN&gt;; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;Girl&lt;/SPAN&gt; : &lt;SPAN style="COLOR: teal"&gt;IGirl&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; _GirlsName = &lt;SPAN style="COLOR: lime"&gt;""&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; GirlsName&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; _GirlsName; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;set&lt;/SPAN&gt; { _GirlsName = &lt;SPAN style="COLOR: yellow"&gt;value&lt;/SPAN&gt;; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Now, we write a Generic function which could take any classes derived from the Interfaces and would return the Girls Name After she marries the guy:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 public\cf8  \cf7 static\cf8  TypeGirl GetWifeNameOnMarriage&lt;TypeGuy, TypeGirl&gt;\par ??            (TypeGuy guy, TypeGirl girl) \cf7 where\cf8  TypeGirl : \cf10 IGirl\cf8  \cf7 where\cf8  TypeGuy : \cf10 IGuy\par ??\cf8         \{\par ??            \cf7 string\cf8  GirlsFirstName = (girl.GirlsName.Split(\cf4 ' '\cf8 ))[0];\par ??            \cf7 string\cf8  GuysLastName = (guy.GuysName.Split(\cf4 ' '\cf8 )[1]);\par ??            girl.GirlsName = GirlsFirstName + \cf4 " "\cf8  + GuysLastName;\par ??            \cf7 return\cf8  girl;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; TypeGirl GetWifeNameAfterMarriage&lt;TYPEGUY, TypeGirl&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (TypeGuy guy, TypeGirl girl) &lt;B&gt;&lt;SPAN style="COLOR: yellow"&gt;where&lt;/SPAN&gt; TypeGirl : &lt;SPAN style="COLOR: teal"&gt;IGirl&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;where&lt;/SPAN&gt; TypeGuy : &lt;SPAN style="COLOR: teal"&gt;IGuy&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; GirlsFirstName = (girl.GirlsName.Split(&lt;SPAN style="COLOR: lime"&gt;' '&lt;/SPAN&gt;))[0];&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; GuysLastName = (guy.GuysName.Split(&lt;SPAN style="COLOR: lime"&gt;' '&lt;/SPAN&gt;)[1]);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; girl.GirlsName = GirlsFirstName + &lt;SPAN style="COLOR: lime"&gt;" "&lt;/SPAN&gt; + GuysLastName;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; girl;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;&lt;B&gt;Notice how each parameter has been limited using a separate constraint&lt;/B&gt;. What this function basically does is, allows the calling code to specify any class that derives out of IGuy class and any class that derives out of IGirl class and then pass their objects to this this function. Once the objects are passed this generic function takes the first name of the girl and the last name of the guy and returns the girls full name After their marriage. &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=justify&gt;&lt;FONT face=Verdana size=2&gt;Finally we write the calling function:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??            \cf7 Guy\cf8  guy = \cf7 new\cf8  \cf7 Guy\cf8 ();\par ??            guy.GuysName = \cf4 "Joe Smith"\cf8 ;\par ??            \cf7 Girl\cf8  girl = \cf7 new\cf8  \cf7 Girl\cf8 ();\par ??            girl.GirlsName = \cf4 "Anna Williams"\cf8 ;\par ??            girl = GetWifeNameOnMarriage&lt;\cf7 Guy\cf8 , \cf7 Girl\cf8 &gt;(guy, girl);\par ??            \cf7 Console\cf8 .WriteLine(girl.GirlsName);\par ??            \cf7 Console\cf8 .ReadLine(); \cf3 // Output is Anna Smith\par ??\cf8         \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Guy&lt;/SPAN&gt; guy = &lt;SPAN style="COLOR: yellow"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;Guy&lt;/SPAN&gt;();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; guy.GuysName = &lt;SPAN style="COLOR: lime"&gt;"Joe Smith"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Girl&lt;/SPAN&gt; girl = &lt;SPAN style="COLOR: yellow"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;Girl&lt;/SPAN&gt;();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; girl.GirlsName = &lt;SPAN style="COLOR: lime"&gt;"Anna Williams"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; girl = GetWifeNameAfterMarriage&amp;lt;&lt;SPAN style="COLOR: yellow"&gt;Guy&lt;/SPAN&gt;, &lt;SPAN style="COLOR: yellow"&gt;Girl&lt;/SPAN&gt;&amp;gt;(guy, girl);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.WriteLine(girl.GirlsName);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;Console&lt;/SPAN&gt;.ReadLine(); &lt;SPAN style="COLOR: aqua"&gt;// Output is Anna Smith&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Besides the first example the intent of this example was to show that you can actually set make a generic function expect more &lt;B&gt;than one generic types and then set constraint on each of those generic types individually&lt;/B&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I've seen a lot of people focus on Generic classes and use them for custom collections but Generic Methods have many other potential uses than just custom collections. In fact, they're the first step of moving of your code to generic classes, if you think about it. I hope this long explanation helps clear out a few basic concepts. There are many other crazy things that can can be done with Generic functions but a sleepy brain and tired fingers won't let me type more (at least not on this post). &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;These are just my two cent and I don't claim to be a Generic Guru :) but all comments / suggestions / feedback and questions (if any) are always welcome from anyone who reads this.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/90745.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/90745.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/90745.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/90745.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Nullable Types, What does int followed by Question-mark (int?) Mean? What's with the Double Question Marks and Other Syntaxes?</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/09/09/90724.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/09/09/90724.aspx</id>
        <published>2006-09-09T06:43:00-05:00:00</published>
        <updated>2006-09-11T10:54:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I first read about Nullable Types around 6 months or so ago. Since I last heard about / used Nullable types, I had completely forgotten about the syntaxes and was completely stumped when I was asked what "int? x" meant by a couple of guys at work.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I'll not Blog about the basic concepts of Nullable Types here. I think &lt;A href="http://msdn2.microsoft.com/en-us/library/1t3y8s4s.aspx" target=_blank&gt;this MSDN Article&lt;/A&gt; does a particularly good job at it. What I'll Blog how ever is the basic syntax which is so darn confusing at times that I've read about it once, seen it getting used twice and forgotten all about it.&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf15\cb1\highlight1 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Simple Format \par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 string\cf8  Foo(\cf10 Nullable\cf8 &lt;\cf7 int\cf8 &gt; x)\par ??        \{\par ??            \cf7 if\cf8  (x.HasValue)\par ??                \cf7 return\cf8  \cf4 "You Passed A Valid Integer. Value Passed is : "\cf8  + x.Value.ToString();\par ??            \cf7 else\par ??\cf8                 \cf7 return\cf8  \cf4 "You Passed A Null"\cf8 ;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Simple Format &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: teal"&gt;Nullable&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;&amp;gt; x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;if&lt;/SPAN&gt; (x.HasValue)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: lime"&gt;"You Passed A Valid Integer. Value Passed is : "&lt;/SPAN&gt; + x.Value.ToString();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;else&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: lime"&gt;"You Passed A Null"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, Function Foo can now accept both nulls and Integers (but no other type). Using HasValue I can determine if null was passed to the function or not and then using Value I can actually get the Integer value if null wasn't passed. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;(Needless to mention that doing a x.Value without checking is x Has a Value (x.HasValue) will result in a runtime Exception). &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The same code could be written slightly differently:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1        \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Question Mark Syntax \par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 string\cf8  Foo(\cf7 int\cf8 ? x)\par ??        \{\par ??            \cf7 if\cf8  (x.HasValue)\par ??                \cf7 return\cf8  \cf4 "You Passed A Valid Integer. Value Passed is : "\cf8  + x.Value.ToString();\par ??            \cf7 else\par ??\cf8                 \cf7 return\cf8  \cf4 "You Passed A Null"\cf8 ;\par ??        \}}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Question Mark Syntax &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;if&lt;/SPAN&gt; (x.HasValue)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: lime"&gt;"You Passed A Valid Integer. Value Passed is : "&lt;/SPAN&gt; + x.Value.ToString();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;else&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: lime"&gt;"You Passed A Null"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;BR&gt;Notice the use of the ? character here. Saying "int? x" is the same as saying "Nullable&lt;INT&gt; x".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Now let's come to another scenario where I want to return 0 if the value of x is null or the actual value if x has any other valid value. &lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Question Mark Syntax. Return the correct Value if X\par ??\cf8         \cf15 ///\cf11  contains a value. 0 if X contains a Null.\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 int\cf8  Foo(\cf7 int\cf8 ? x)\par ??        \{\par ??            \cf7 int\cf8  i; \par ??            \cf7 if\cf8  (x.HasValue)\par ??                i = x.Value ;\par ??            \cf7 else\par ??\cf8                  i = 0;\par ??             \par ??            \cf7 return\cf8  i;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Question Mark Syntax. Return the correct Value if X&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; contains a value. 0 if X contains a Null.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; i; &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;if&lt;/SPAN&gt; (x.HasValue)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; i = x.Value ;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;else&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; i = 0;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; i;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The whole if... else can be avoided using a slightly different syntax:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Question Mark Syntax. Return the correct Value if X\par ??\cf8         \cf15 ///\cf11  contains a value. 0 if X contains a Null.\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 int\cf8  Foo(\cf7 int\cf8 ? x)\par ??        \{\par ??            \cf3 // same as saying, if x has a value i = x; if x is null i = 0.\par ??\cf8             \cf7 int\cf8  i = x ?? 0; \par ??            \cf7 return\cf8  i;\par ??        \}\par ??}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Question Mark Syntax. Return the correct Value if X&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; contains a value. 0 if X contains a Null.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// same as saying, if x has a value i = x; if x is null i = 0.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; i = x ?? 0; &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; i;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, I could return the actual value of x if x contains a value or return any other hard-coded value of my choice if x contains null. In 99.99% &lt;B&gt;(we talk about the other 0.01% of the cases later)&lt;/B&gt; of the cases however, I would want this "hard-coded value of my choice" to be 0 since that's the default value of integers when they are not assigned any value. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, in the above function what I am basically saying is - if x contains a value return the value. If it doesn't, return 0 (which is the default value for value type int). I could also write this code as:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1  \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Question Mark Syntax. Return the correct Value if X\par ??\cf8         \cf15 ///\cf11  contains a value. 0 if X contains a Null.\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 int\cf8  Foo(\cf7 int\cf8 ? x)\par ??        \{\par ??            \cf7 return\cf8  x.GetValueOrDefault();\par ??        \}}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Question Mark Syntax. Return the correct Value if X&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; contains a value. 0 if X contains a Null.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; x.GetValueOrDefault();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Since I am using Nullable types there's a 0.01% possibility that I want the Nullable type to have a different default value than what it's supposed to have. So, let's say that if X contains null I want to interpret that null as 7. I could say:&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1    \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Question Mark Syntax. Return the correct Value if X\par ??\cf8         \cf15 ///\cf11  contains a value. 7 if X contains a Null.\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 int\cf8  Foo(\cf7 int\cf8 ? x)\par ??        \{\par ??            \cf7 int\cf8  i;\par ??            i = x ?? 7;\par ??            \cf7 return\cf8  i;\par ??        \}}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Question Mark Syntax. Return the correct Value if X&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; contains a value. 7 if X contains a Null.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; i;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; i = x ?? 7;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; i;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Or I could write it as:&lt;BR&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1  \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  Nullable Types The Question Mark Syntax. Return the correct Value if X\par ??\cf8         \cf15 ///\cf11  contains a value. 7 if X contains a Null.\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf7 public\cf8  \cf7 static\cf8  \cf7 int\cf8  Foo(\cf7 int\cf8 ? x)\par ??        \{\par ??            \cf7 return\cf8  x.GetValueOrDefault(7);\par ??        \}}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Nullable Types The Question Mark Syntax. Return the correct Value if X&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; contains a value. 7 if X contains a Null.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&lt;/SUMMARY&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; Foo(&lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;return&lt;/SPAN&gt; x.GetValueOrDefault(7);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So, with Nullable Types you have multiple ways of writing the same thing. This post just attempts to answer all questions I've been asked regarding Nullable Types. Final question was - how would I Convert a Nullable type to it's corresponding value type. e.g. How would I convert int? x to an integer and assign it to another integer. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As the above code snippets illustrate I would assume that the best way would be:&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Monaco;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20 \cf8\cb1\highlight1         \cf15 ///\cf11  \cf15 &lt;summary&gt;\par ??\cf8         \cf15 ///\cf11  How Would I "Convert" an int? to an int.\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;/summary&gt;\par ??\cf8         \cf15 ///\cf11  \cf15 &lt;param name=\cf8 "args"\cf15 &gt;&lt;/param&gt;\par ??\cf8         \cf7 static\cf8  \cf7 void\cf8  Main(\cf7 string\cf8 [] args)\par ??        \{\par ??            \cf7 int\cf8 ? x = \cf7 null\cf8 ;\par ??            \cf7 int\cf8  y = x.GetValueOrDefault(); \par ??            \cf3 // or int y = x.GetValueOrDefault(foo);\par ??\cf8             \cf3 // where foo is the value I want to assign to y if x is null. \par ??\cf8         \}}
--&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: black; COLOR: white; FONT-FAMILY: verdana"&gt;&lt;SPAN style="COLOR: gray"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: yellow"&gt;void&lt;/SPAN&gt; Main(&lt;SPAN style="COLOR: yellow"&gt;string&lt;/SPAN&gt;[] args)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt;? x = &lt;SPAN style="COLOR: yellow"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: yellow"&gt;int&lt;/SPAN&gt; y = x.GetValueOrDefault(); &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// or int y = x.GetValueOrDefault(foo2);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: aqua"&gt;// where foo2 is the value I want to assign to y if x is null. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: silver"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;BR&gt;&lt;FONT face=Verdana size=2&gt;(For all those who didn't like the black background and color of the code snippets; Sorry, but I'm now a part of a group of&amp;nbsp;freaks who like to use non-white color schemes in Visual Studio :))&lt;/FONT&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/90724.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/90724.aspx</wfw:comment>
        <slash:comments>3</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/90724.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/90724.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Free Tools To Magnify Your Screen / Parts of it in Real Time (For Creative Guys / Designers and Guys who want to Magnify stuff during presentations).</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/09/11/90841.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/09/11/90841.aspx</id>
        <published>2006-09-11T00:19:00-05:00:00</published>
        <updated>2006-09-11T00:28:00Z</updated>
        <content type="html">&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;A Few days ago I had a discussion with a person from our creative team who informed me about (and liked) the fact that in MAC you could just zoom in and magnify any part of your screen in real-time. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This was one feature I could use during technical presentations as well. So I decided to go searching&amp;nbsp; for some free tools that let me do this same thing in windows and met a whole throng of free tools that let me do this. Here are the best two that I came across:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;A href="http://www.sysinternals.com/Utilities/ZoomIt.html" target=_blank&gt;http://www.sysinternals.com/Utilities/ZoomIt.html&lt;/A&gt; - (Everyone loves SysInternals :)) &lt;B&gt;[Highly Recommended]&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Pros: I Like the ability to scroll to Zoom deeper and Right click to come out. Typical Sys-Internal "No need to install" single Exe is particularly cool if you want to carry this thing around on a USB drive. Love the Pen Feature which lets me draw on and highlight parts of the zoomed area.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Cons: Pretty much zooms the entire screen. Doesn't let me choose the height and width of the magnifier or the particular areas on screen that I want to zoom.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;A href="http://magnifier.sourceforge.net/" target=_blank&gt;http://magnifier.sourceforge.net/&lt;/A&gt; - Free, open source Magnification for Windows, Linux and Free BSD. &lt;B&gt;[Highly Recommended]&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Pros: I like the fact that I can choose the Magnification level, the size and the graphic tool feature is particularly interesting. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Cons: I can't zoom in and keep increasing the magnification level, on real time. Need to reach out for my system tray icon and set the Zoom Parameter which can make my presentations slow :)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Here's A &lt;A href="http://www.magnifiers.org/links/Download_Software/Screen_Magnifiers/Windows_Freeware_and_shareware/" target=_blank&gt;Big List&lt;/A&gt; of other free (and some paid) tools to achieve the same thing. Enjoy!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/90841.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/90841.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/90841.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/90841.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Auto-complete in Dos (Hitting Tab to Complete Directory / File Names in CMD.EXE), Does Not Work!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/09/09/90716.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/09/09/90716.aspx</id>
        <published>2006-09-09T04:41:00-05:00:00</published>
        <updated>2006-09-09T04:43:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Besides being a DotNet developer I've spent some part of my life (3 odd months) in the past, being a Linux Administrator. Every guy in the Linux world loves the bash Auto-complete feature. The part where you type the partial name of file or directory and hit the tab button and the console completes the typing of the entire file / directory name for you.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;I just think it's Natural (and super cool) for an OS to be able to reduce the number of clicks (or keystrokes, for that matter) and help you get to where you want to get faster. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The Windows CMD.EXE had started supporting this feature; since, I don't when. I don't recall when I hit the tab key while I was working in the Dos Console. The Auto complete worked (just like Linux bash). In fact it worked so smoothly that I didn't even realize or think about the fact that it wasn't supposed to work! I was in DOS (CMD.EXE of windows 2003 server edition), not Linux! &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Anyway, so basically, what I am trying to say is that I've been using the Auto Complete on tab feature of MS-DOS without even knowing / realizing / remembering since how long I've been using it.&amp;nbsp; Recently I showed this to another Linux IT guy who was working in MS-DOS and his reaction was - "Wow! I didn't know Dos Supports This!"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;So, basically looks like this feature has been a part of MS-DOS for a VERY long time and most IT guys I've worked with or talked to don't even know / remember when this feature became a part of MS-DOS. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Recently I reinstalled Windows 2003 Server on my laptop (I was having problems with a direct install coz my Dell 700m would just hang - so I had to install windows 2000 and then upgrade to 2003) after a format and a "fresh start" and discovered that the Auto Complete on Tab feature wouldn't work any more! &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Tahoma size=2&gt;As it turns out, this is a feature that may / may not be enabled on your machine by default. If you've upgraded from Windows 2000 or a previous OS to Windows 2003 Server this feature may be disabled by default. Enabling it is simple though.&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Tahoma size=2&gt;Use the registry editor and change the value of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar from 0x40 to 0x9&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;I had a difficult time Goggling an answer for this problem so I thought I'd post it here. Here's the &lt;A href="http://www.flipcode.com/cgi-bin/fcarticles.cgi?show=63845" target=_blank&gt;URL&lt;/A&gt; where this Information originally comes from. (Just so that I give Due credit to the guy for posting the solution :) )&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/90716.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/90716.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/90716.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/90716.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Hack your Tungsten-E to improve it's Battery life!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/07/29/86612.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/07/29/86612.aspx</id>
        <published>2006-07-29T11:58:00-05:00:00</published>
        <updated>2006-09-08T13:45:00Z</updated>
        <content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;I&amp;#8217;ve been reading a LOT lately, mostly during my commute. I&amp;#8217;ve been a MP3 Audio Book guy for the past few months but nothing beats reading. So, lately I&amp;#8217;ve been accompanied by my 1.5 year old Tungsten E reading on my way home and to office. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;The T/E has shown some battery drain issues last week. I had nothing to do this Saturday, (practically half of my family is out holidaying) so, I decided to waste some time trying to investigate what I can do about the battery drain issue the gadget has been showing. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Here are some basic guidelines which are quite easy to figure out:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Keep the Auto Beam feature off. That&amp;#8217;s the major power eater. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Keep the Backlight display brightness to a minimum (more on this follows).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;At times even External Launchers eat battery (I learnt this on some posts) &amp;#8211; so I&amp;#8217;m going to try disabling ZLauncher for some time on my Tungsten and see what happens. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;This one was hard to believe and I read it in an unofficial blog, so don&amp;#8217;t quote me on this one &amp;#8211; the T/E ACTUALLY consumes more batter if you have more applications loaded! Phew! I&amp;#8217;m going to uninstall the ones I don&amp;#8217;t need and find out if this is true. &lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;SD cards in slots eat battery! I couldn&amp;#8217;t Google any information on this but this IS a personal experience. I&amp;#8217;ve actually seen the battery consumption increase considerably when the card is plugged into the PDA. So, I&amp;#8217;ve been pondering with the idea of removing the card when I&amp;#8217;m not using it.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Cool Tools to Hack your PDA and give you more Battery Life:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;A href="http://silkdimmer.sourceforge.net/" target=_blank&gt;&lt;SPAN style="COLOR: purple"&gt;SilkDimmer&lt;/SPAN&gt;&lt;/A&gt; &amp;#8211; This thing gives you &amp;#8220;COMPLETE&amp;#8221; control over your backlight brightness. (Notice the word complete in caps. It was intended.) The control this thing offers&amp;nbsp;is more than what the&amp;nbsp;Palm OS gives you. You can practically switch your backlight display off and still run the PDA&amp;nbsp;(wouldn&amp;#8217;t recommend that, but you technically could) if you wanted to or set it to ANY value you like &amp;#8211; even below the lowest value the Palm OS allows you. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; tab-stops: list .5in; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;A href="http://www.clievideo.com/default.asp?item=3&amp;amp;intProductID=3" target=_blank&gt;&lt;SPAN style="COLOR: purple"&gt;LightSpeed&lt;/SPAN&gt;&lt;/A&gt; &amp;#8211; This allows you to under-clock our PDA processor and is practically the only over-clock / under-clock utility out there. It also solves the problem with the noisey screens some guys have complained about. (I've never faced this problem). No doubt the makers are expecting to make some money out of it and it&amp;#8217;s NOT Open source or free like SilkDimmer. &lt;BR&gt;For now they are giving a Beta free which once in a while, pops up a Message every now and then when I am starting applications. I under-clocked my Acrobat Reader to 48 and it seems to be working fine.&amp;nbsp;Under-clocking a 3&lt;SUP&gt;rd&lt;/SUP&gt; party chess to a very low speed however, produced BAD results and I had to wait for 5 minutes (literally) before it would render the screen, drawing parts of the screen at a time. The good thing here however, is that you can control clock speed on a per application basis! &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;So, with all this set I&amp;#8217;m hoping the T/E gives a better battery life and I don&amp;#8217;t see an unexpected drain anytime soon!&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;If you&amp;#8217;ve goggled to this page&amp;nbsp;I can&amp;#8217;t tell you for now, if all / some of the above tips work &amp;#8211; but I&amp;#8217;ll update this post as soon as the T/E stands the test of life this Monday during a &amp;#8220;normal&amp;#8221; business day. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Upate: Looks like some (or most) of the above tips worked. My Battery &amp;#8220;seems&amp;#8221; to be giving a MUCH longer hold.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/86612.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/86612.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/86612.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/86612.aspx</trackback:ping>
    </entry>
    <entry>
        <title>DRM! Moving you DRM Protected eBooks to Mobile Devices</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/07/29/86599.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/07/29/86599.aspx</id>
        <published>2006-07-29T08:14:00-05:00:00</published>
        <updated>2006-07-29T08:14:00Z</updated>
        <content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;If you&amp;#8217;ve tried moving an eBook you bought on Amazon that was protected with DRM to your palm device and have been successful skip this post. However, if you&amp;#8217;ve tried your hands at if and failed (becuase you were as&amp;nbsp;confused as me)&amp;nbsp;read on. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Trying to the use the Acrobat Reader for Palm OS (that works for all of my other PDFs) kept throwing the following error - "This document has not been encrypted using stand security handler and therefore could not be opened" &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;A Few minutes on Google brought me to &lt;A href="http://www.diesel-ebooks.com/support/index.php?pf=kb&amp;amp;page=index_v2&amp;amp;id=15&amp;amp;c=" target=_blank&gt;&lt;SPAN style="COLOR: purple"&gt;This Thread&lt;/SPAN&gt;&lt;/A&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Just for the Sake of Redundancy, I Quote &amp;#8211; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&amp;#8220;To send your DRM protected e-Books on your Palm device you need to use your desktop Adobe Reader (version 7.0 or later). For which you need to: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Activate your Palm device from your desktop reader's File --&amp;gt; Digital Editions --&amp;gt; Authorize devices. Go to File --&amp;gt;Digital Editions --&amp;gt; My Digital Editions &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Click on the book you need to send to your Palm device (add it if it doesn't show there by the "Add File" button), and click 'Send to Mobile Device'. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Then your eBook is prepared and sent to your List of files to be transferred in Hotsync manager.&amp;#8221;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;I just wished Amazon / ADOBE had provided clear instructions for this. When a person buys an eBook in all probabilities he wants to read it on his PDA! It is frustrating go to Google and waste an hour after spending money on the book and then not being able to carry it around!&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/86599.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/86599.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/86599.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/86599.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Internet Explorer Beta 3 For Windows 2003 Server. Finally!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/07/15/85316.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/07/15/85316.aspx</id>
        <published>2006-07-15T14:11:00-05:00:00</published>
        <updated>2006-07-15T14:21:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Verdana size=2&gt;In an earlier post I described how Internet Explorer 7.0 Beta 2 can be made to work on Windows 2003 Server even though it&amp;#8217;s intended to run on Windows XP only. Tricks like that one are not required any more. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Microsoft finally has a Internet Explorer 7.0 Beta 3 Version for Windows 2003 Server SP1 users. Don&amp;#8217;t walk, Run! Download it from &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/windows/ie/downloads/default.mspx" target="_blank"&gt;&lt;FONT face=Verdana size=2&gt;http://www.microsoft.com/windows/ie/downloads/default.mspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;If you&amp;#8217;re using the 64 Bit Itanium the same URL offers you a download too.&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/85316.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/85316.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/85316.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/85316.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Static Variables In ASP.NET - "I Didn't know this" Moment Number 42</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/07/05/84104.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/07/05/84104.aspx</id>
        <published>2006-07-05T00:32:00-05:00:00</published>
        <updated>2006-07-05T00:32:00Z</updated>
        <content type="html">&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Yet another "I didn't know this" moment - Turns out, static variables in a class in ASP.NET are pretty similar to application objects but I am going to keep my long-winded posts really short this time.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Long story short: &lt;B&gt;"A key reason that the Application object exists in ASP.NET is for compatibility with classic ASP code&amp;#8212;to allow easier migration of existing applications to ASP.NET. If you are creating an ASP.NET application from scratch, you will want to consider storing data in static members of the application class rather than in the Application object"&lt;/B&gt; (MSDN)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;As always there are Pro's and Con's of using both Application Object and Static Variables. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraskdr/html/askgui09172002.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraskdr/html/askgui09172002.asp&lt;/A&gt; , &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312607"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312607&lt;/A&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;That's the 42nd "I didn't know this moment" ever since I got into the habit of counting :)&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/84104.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/84104.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/84104.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/84104.aspx</trackback:ping>
    </entry>
    <entry>
        <title>How Do I Get the Atlas Control Toolkit to Show Up On My Visual Studio.NET 2005 Toolbox?</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/06/29/83571.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/06/29/83571.aspx</id>
        <published>2006-06-29T09:47:00-05:00:00</published>
        <updated>2006-06-29T09:47:00Z</updated>
        <content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;One of the Questions I was asked on my Article on Atlas @ Code Project at &lt;A href="http://www.codeproject.com/Ajax/HelloAtlas.asp"&gt;http://www.codeproject.com/Ajax/HelloAtlas.asp&lt;/A&gt; was How do you make the Atlas Controls Appear on your Visual Studio toolbox once you download them. The official documentation from Microsoft states these steps:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Create a new web site from the "Atlas" web site template by opening the "File" menu, clicking "New", "Web Site...", and picking ""Atlas" Web Site" under "My Templates" &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Right-click on the Toolbox and select "Add Tab", and add a tab called "Atlas Control Toolkit" &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Inside that tab, right-click on the Toolbox and select "Choose Items..." &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;When the "Choose Toolbox Items" dialog appears, click the "Browse..." button. Navigate to the folder where you installed the "Atlas" Control Toolkit package. You will find a folder called "SampleWebSite", and under that another folder called "bin". Inside that folder, select "AtlasControlToolkit.dll" and click OK. Click OK again to close the Choose Items Dialog. &lt;B style="mso-bidi-font-weight: normal"&gt;(This is the step that&amp;#8217;s confusing most of the time. See Note Below)&lt;/B&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;You can now use the included sample controls in your websites.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"&gt;Yes, so, step number 4 is a little confusing. Not because of what it says but the way the Atlas control installer works. Actually, the installer explodes everything under your &lt;B style="mso-bidi-font-weight: normal"&gt;Temporary Folder&lt;/B&gt; i.e. if you&amp;#8217;re the Administrator it explodes everything to C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp!! So, basically you need to either specify a different path where you want to expand this or copy this &amp;#8220;SampleWebSite&amp;#8221; folder step 4 talks about from your temp folder to any folder you want. Once you&amp;#8217;ve done that follow step 4, point to DLL in the Bin folder inside this folder and you should be all set!&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/83571.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/83571.aspx</wfw:comment>
        <slash:comments>4</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/83571.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/83571.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Internet Explorer 7.0 Beta on Windows 2003 Server!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/06/26/83236.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/06/26/83236.aspx</id>
        <published>2006-06-26T21:44:00-05:00:00</published>
        <updated>2006-06-27T07:31:00Z</updated>
        <content type="html">&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;As much as I would like to take the credit for this post, it was actually the author of &lt;A href="http://blogbybob.com/archive/2005/09/20/2117.aspx" target=_blank&gt;this post &lt;/A&gt;that figured it out!&amp;nbsp;If you've been&amp;nbsp;trying&amp;nbsp;desperately to get your hands on IE 7.0 Beta but couldn't because you were on Windows 2003 - here's how you can make the Beta work on Windows 2003 even though it's not supposed to, by design.&amp;nbsp;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The Procedure is pretty&amp;nbsp;simple and direct.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL type=1&gt;
&lt;OL type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Get the beta Download Executable. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Unzip the Executable using WinRAR.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Navigate&amp;nbsp;to the Update Folder. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Backup the Update\Update.inf file. Keep it, where you can reach it quickly (e.g. desktop)&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Open the Update.inf and Change The following Lines&lt;BR&gt;&lt;BR&gt;[Version]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CatalogFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %SP_SHORT_TITLE%.cat&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LanguageType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %LangTypeValue%&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxNtBuildToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 9999&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxNtMajorVersionToUpdate = 5&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;MaxNtMinorVersionToUpdate = 1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/B&gt;MaxNtServicePackVersion&amp;nbsp;&amp;nbsp; = 512&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;MinNtServicePackVersion&amp;nbsp;&amp;nbsp; = 512&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/B&gt;NtBuildToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2600&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NtMajorVersionToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp; = 5&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NtMinorVersionToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RebootRequired&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Signature&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "$Windows NT$"&lt;BR&gt;to:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CatalogFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %SP_SHORT_TITLE%.cat&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LanguageType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %LangTypeValue%&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxNtBuildToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 9999&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxNtMajorVersionToUpdate = 5&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;MaxNtMinorVersionToUpdate =&amp;nbsp;3&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/B&gt;MaxNtServicePackVersion&amp;nbsp;&amp;nbsp; = 512&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;MinNtServicePackVersion&amp;nbsp;&amp;nbsp; = 0&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/B&gt;NtBuildToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2600&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NtMajorVersionToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp; = 5&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NtMinorVersionToUpdate&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RebootRequired&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Signature&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "$Windows NT$"&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Start the installation by clicking \update\iesetup.exe. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;As soon as the install starts &lt;STRIKE&gt;and&lt;/STRIKE&gt; &lt;STRONG&gt;before&lt;/STRONG&gt;&amp;nbsp;the first screen is Visible, replace the update.inf from your backup location to update\update.inf and overwrite the update.inf we modified. The modification was just necessary to start the setup in Windows 2003. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The installation starts and completes smoothly. &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/83236.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/83236.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/83236.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/83236.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Dynamically Calling a Web Service Without Setting Web Reference</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/rajiv/archive/2006/06/27/83289.aspx" />
        <id>http://geekswithblogs.net/rajiv/archive/2006/06/27/83289.aspx</id>
        <published>2006-06-27T07:30:00-05:00:00</published>
        <updated>2006-06-27T07:30:00Z</updated>
        <content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;This Approach is particularly helpful when one needs to implement loosely coupled integration using Web Services from a Multi Tangent (Application Service Provider Model) type of front end. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;If each client needs to invoke a different web service and the application needs to pick the Web Service URL dynamically during runtime (depending on the client), it may not be possible to set Visual Studio.NET 2005 Web References to each and every client URL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Just finished writing an article on this @ Code Project.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Read it here:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;A href="http://www.codeproject.com/cs/webservices/CallWebServicesDynamic.asp"&gt;&lt;FONT color=#800080&gt;http://www.codeproject.com/cs/webservices/CallWebServicesDynamic.asp&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://geekswithblogs.net/rajiv/aggbug/83289.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/rajiv/comments/83289.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/rajiv/comments/commentRss/83289.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/rajiv/services/trackbacks/83289.aspx</trackback:ping>
    </entry>
</feed>
