<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://bloggingabout.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Jan Schreuder on .Net</title><subtitle type="html">.Net code samples, experiences, observations&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linkedin.com/in/janschreuder"&gt;&lt;img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View my professional profile on LinkedIn" /&gt;&lt;/a&gt;</subtitle><id>http://bloggingabout.net/blogs/jschreuder/atom.aspx</id><link rel="alternate" type="text/html" href="http://bloggingabout.net/blogs/jschreuder/default.aspx" /><link rel="self" type="application/atom+xml" href="http://bloggingabout.net/blogs/jschreuder/atom.aspx" /><generator uri="http://communityserver.org" version="4.0.30619.63">Community Server</generator><updated>2008-05-14T22:28:05Z</updated><entry><title>Syntax error? Really?!?!</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/09/25/syntax-error-really.aspx" /><id>/blogs/jschreuder/archive/2008/09/25/syntax-error-really.aspx</id><published>2008-09-25T09:44:00Z</published><updated>2008-09-25T09:44:00Z</updated><content type="html">&lt;p&gt;In my current project, we have adopted &lt;a target="_blank" href="http://blogs.msdn.com/sourceanalysis/"&gt;Microsoft StyleCop&lt;/a&gt; as a tool to make sure everyone sticks to the same style of coding. One of the things we currently incorporate in our daily work is making sure our existing code conforms to the rules we agreed on. Today however, StyleCop refused to check a class because of a syntax error in the following line of code:&lt;/p&gt;
&lt;div style="BORDER-RIGHT:#cccccc 1pt solid;PADDING-RIGHT:1pt;BORDER-TOP:#cccccc 1pt solid;PADDING-LEFT:1pt;FONT-SIZE:9pt;BACKGROUND:#f5f5f5;PADDING-BOTTOM:1pt;OVERFLOW:auto;BORDER-LEFT:#cccccc 1pt solid;WIDTH:100%;COLOR:black;PADDING-TOP:1pt;BORDER-BOTTOM:#cccccc 1pt solid;FONT-FAMILY:Courier New;"&gt;
&lt;pre style="MARGIN:0px;"&gt;&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; fraction = totalStaff &amp;gt; 0 &lt;/pre&gt;
&lt;pre style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ? fraction = (&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)completed / (&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)totalStaff &lt;/pre&gt;
&lt;pre style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; : fraction = 0;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The code you see here is part of a calculation to get the percentage of users that have completed a certain training module. The compiler sees no problem, and the result is as you would expect. But looking at the code, you do see something really weird. The variable &lt;span style="color:#0000ff;font-family:courier new,courier;"&gt;&lt;strong&gt;fraction&lt;/strong&gt;&lt;/span&gt; is always assigned twice. Maybe not a syntax problem, but strange and not necessary. &lt;/p&gt;
&lt;p&gt;The following code does the same and only assigns the value once.&lt;/p&gt;
&lt;div style="font-size:9pt;background:#f5f5f5;overflow:auto;width:100%;color:black;font-family:Courier New;border:#cccccc 1pt solid;padding:1pt;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; fraction = totalStaff &amp;gt; 0 &lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ? (&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)completed / (&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)totalStaff &lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;So why would someone do it twice? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=474818" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /><category term=".Net Do's &amp;amp; Don'ts" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/.Net+Do_2700_s+_2600_amp_3B00_+Don_2700_ts/default.aspx" /></entry><entry><title>Thank you, Lutz Roeder</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/08/26/thank-you-lutz-roeder.aspx" /><id>/blogs/jschreuder/archive/2008/08/26/thank-you-lutz-roeder.aspx</id><published>2008-08-26T21:47:00Z</published><updated>2008-08-26T21:47:00Z</updated><content type="html">&lt;p&gt;I just received an email from Lutz Roeder informing the users of Reflector that he decided to explore new opportunities. He has reached an agreement with RedGate software to continue work on Reflector. From his email:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;I have reached an agreement to have &lt;a target="_blank" href="http://www.red-gate.com/"&gt;Red Gate Software&lt;/a&gt; continue the development of .NET Reflector. Red Gate has a lot of experience creating development tools for both .NET and SQL Server. They have the resources necessary to work on new features, and Reflector fits nicely with other .NET tools the company offers.&lt;br /&gt;&lt;/em&gt;&lt;em&gt;&lt;br /&gt;Red Gate will continue to provide the free community version and is looking for your feedback and ideas for future versions.&lt;br /&gt;&lt;br /&gt;For news and updates on Reflector, sign up for the &lt;a target="_blank" href="http://reflector.red-gate.com/subscribe.aspx"&gt;.NET Developer&amp;rsquo;s Newsletter&lt;/a&gt; from Red Gate. To find out more about the agreement, see the interview on &lt;a target="_blank" href="http://www.simple-talk.com/the_future_of_reflector"&gt;Simple Talk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I really want to thank Lutz for all the great work he&amp;#39;s done with Reflector, allowing us to explore the code inside .Net assemblies. He brought an excellent tool to our community and literally opened up .Net code for all to see&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=473366" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="Articles" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Articles/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /></entry><entry><title>StyleCop - QuickStart tips</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/08/21/stylecop-some-quickstart-pointers.aspx" /><id>/blogs/jschreuder/archive/2008/08/21/stylecop-some-quickstart-pointers.aspx</id><published>2008-08-21T07:15:00Z</published><updated>2008-08-21T07:15:00Z</updated><content type="html">&lt;p&gt;After using StyleCop for some weeks, there are some things I think that might be useful to others when they want to start using the tool. So here are some tips.&lt;/p&gt;
&lt;h3&gt;Tip 1 -&amp;nbsp;Also download the documentation&lt;/h3&gt;
&lt;p&gt;The documentation for StyleCop is available as a separate download. It explains why the rules are introduced and how you can fix violations. Without this documentation, you may think some of the rules are useless or annoying.&lt;/p&gt;
&lt;h3&gt;Tip 2 - Do not run the tool on an entire solution&lt;/h3&gt;
&lt;p&gt;At least, not untill you&amp;#39;re satisfied that your code complies with the rules. You get so many warnings in a project or solution where the tool hasn&amp;#39;t been used before, that you may think to stop using it immediately. &lt;/p&gt;
&lt;h3&gt;Tip 3 - Running the tool on one class file&lt;/h3&gt;
&lt;p&gt;Could have been in tip 2 as well, but I wanted to make a distinction here. When you right-click in the code, you will see the item &lt;strong&gt;Run StyleCop&lt;/strong&gt;. Select this, and the tool will only check that particular class file. The number of warnings is signicantly less than when you run the tool on an entire project or solution, so the results are more obvious and motivate you more to keep using the tool.&lt;/p&gt;
&lt;h3&gt;Tip 4 - Disable rules you really disagree to&lt;/h3&gt;
&lt;p&gt;Rules you really don&amp;#39;t want to check can be disabled using the StyleCopSettingsEditor. How this can be done is explained in &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/2008/07/29/have-your-c-coding-style-analysed-by-microsoft-part-2.aspx"&gt;this blog post&lt;/a&gt;. I disabled a number of them. I also included a number of overrides to the check for hungarian notation. For example, I have boolean variable names&amp;nbsp;like isValid and isCompliant. StyleCop used to warn me about using hungarian notation in these cases, whereas I&amp;#39;m not. You can add the &amp;#39;&lt;strong&gt;is&amp;#39;&lt;/strong&gt; part in the Hungarian tab of the StyleCopSettingsEditor and it will no longer warn you about this.&lt;/p&gt;
&lt;h3&gt;Tip 5 - Re-Align the source before you start&lt;/h3&gt;
&lt;p&gt;Select all the code using Ctrl-A, then press Ctrl-K followed by F. Visual Studio will re-align much of the code. This automatically eliminates a number of errors found by StyleCop.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=472229" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /><category term=".Net Do's &amp;amp; Don'ts" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/.Net+Do_2700_s+_2600_amp_3B00_+Don_2700_ts/default.aspx" /></entry><entry><title>Version 4.3 of Microsoft StyleCop available</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/08/21/new-version-of-microsoft-stylecop-available.aspx" /><id>/blogs/jschreuder/archive/2008/08/21/new-version-of-microsoft-stylecop-available.aspx</id><published>2008-08-21T06:45:00Z</published><updated>2008-08-21T06:45:00Z</updated><content type="html">&lt;p&gt;A new version of &lt;a target="_blank" href="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis&amp;amp;ReleaseId=1425"&gt;StyleCop&lt;/a&gt;&amp;nbsp;was made available only a few days ago, so I downloaded it and installed it. One thing I had to correct after installation was the Settings.SourceAnalysis file. Because of the name change to StyleCop, the extension of the settings file was also changed. But after that, I was back in business. One of the first things you notice is that the results are now shown as warnings in the standard errors and warnings list. And there are more changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A separate help file is available that explains the rules and shows how violations can be solved&lt;/li&gt;
&lt;li&gt;A number of bug have been fixed&lt;/li&gt;
&lt;li&gt;New rules, including a rule to check if Using directives are sorted, in line with the Visual Studio 2008 Organize Usings functionality&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Another announcement on the &lt;a target="_blank" href="http://blogs.msdn.com/sourceanalysis/"&gt;StyleCop Teamblog&lt;/a&gt; suggested that they will be releasing SDK documentation to allow you to add your own rules to the tool. This is of course interesting if you have additional rules on top of the ones already available.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been using the tool for some weeks now and I really like the consistency in code style which is now slowly emerging in my projects. Where I thought I was using a consistent style in my own code, I was pointed out by StyleCop that in fact I wasn&amp;#39;t. But that&amp;#39;s all changing now.&lt;/p&gt;
&lt;p&gt;You can &lt;a target="_blank" href="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis&amp;amp;ReleaseId=1425"&gt;download the new version of StyleCop here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=472227" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /><category term=".Net Do's &amp;amp; Don'ts" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/.Net+Do_2700_s+_2600_amp_3B00_+Don_2700_ts/default.aspx" /></entry><entry><title>Sandcastle now on CodePlex </title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/08/04/sandcastle-now-on-codeplex.aspx" /><id>/blogs/jschreuder/archive/2008/08/04/sandcastle-now-on-codeplex.aspx</id><published>2008-08-04T06:47:00Z</published><updated>2008-08-04T06:47:00Z</updated><content type="html">&lt;p&gt;The &lt;a target="_blank" href="http://blogs.msdn.com/sandcastle"&gt;Sandcastle&lt;/a&gt; project, Microsoft&amp;#39;s tools to generate documentation from your well-documented code, is now available on CodePlex. That was already the case, but until about&amp;nbsp;2 month&amp;#39;s ago, that was without the source code. You can now download Sandcastle including the source code from CodePlex. &lt;/p&gt;
&lt;p&gt;You can find the related information about this decision &lt;a target="_blank" href="http://blogs.msdn.com/sandcastle/archive/2008/07/02/sandcastle-source-code-published-in-codeplex.aspx"&gt;here&lt;/a&gt;. And you can find the project in Codeplex &lt;a target="_blank" href="http://www.codeplex.com/Sandcastle"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=470349" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Sandcastle" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Sandcastle/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /></entry><entry><title>Need help with Crystal Reports? Look here!</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/30/need-help-with-crystal-reports-look-here.aspx" /><id>/blogs/jschreuder/archive/2008/07/30/need-help-with-crystal-reports-look-here.aspx</id><published>2008-07-30T11:36:00Z</published><updated>2008-07-30T11:36:00Z</updated><content type="html">&lt;p&gt;Because I blog about &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/tags/Crystal+Reports/default.aspx"&gt;Crystal Reports&lt;/a&gt; occasionally, and created a &lt;a target="_blank" href="http://www.codeproject.com/KB/cs/CrystalHelper.aspx"&gt;helper class&lt;/a&gt; to assist in integrating it into .Net applications, I get a lot of questions from people that have problems running their reports. Especially in production environments after they deploy the reports. Unfortunately, I&amp;#39;m not a Crystal Expert. I use it in my applications but that&amp;#39;s how far it goes. I don&amp;#39;t have all the answers people might want. &lt;/p&gt;
&lt;p&gt;But I do know where you can find information about Crystal and where you do find answers to any problems you might have. I created a blog post a few weeks ago to sum up a number of resources that can help you find answers to almost all of your Crystal Reports issues. &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/2008/07/09/sap-is-annoying-me.aspx"&gt;Click here to read that post&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=469910" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Articles" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Articles/default.aspx" /><category term="Crystal Reports" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Crystal+Reports/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /><category term=".Net Do's &amp;amp; Don'ts" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/.Net+Do_2700_s+_2600_amp_3B00_+Don_2700_ts/default.aspx" /></entry><entry><title>Have your C# coding style analysed by Microsoft, part 2</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/29/have-your-c-coding-style-analysed-by-microsoft-part-2.aspx" /><id>/blogs/jschreuder/archive/2008/07/29/have-your-c-coding-style-analysed-by-microsoft-part-2.aspx</id><published>2008-07-29T13:21:00Z</published><updated>2008-07-29T13:21:00Z</updated><content type="html">&lt;p&gt;Just as a small update on the use of &lt;a target="_blank" href="http://blogs.msdn.com/sourceanalysis"&gt;&lt;span style="color:#006ff7;"&gt;StyleCop&lt;/span&gt;&lt;/a&gt;. I disagreed with some of the rules, like having to use spaces rather than tabs. It&amp;#39;s not really an annoying rule, the only thing about it is that you have to agree on using spaces or tabs and then stick to it.&lt;/p&gt;
&lt;p&gt;But still, I found out you can tune StyleCop to your needs. When you go the folder where the application is installed (on my machine C:\Program Files\Microsoft StyleCop 4.3) you will see a small application named StyleCopSettingsEditor.exe. Using that tool you can switch the rules supplied by the tool on or off. From a command prompt simply run the following command line:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new,courier;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="font-size:9pt;background:#f5f5f5;overflow:auto;width:100%;color:black;font-family:Courier New;border:#cccccc 1pt solid;padding:1pt;"&gt;
&lt;pre style="margin:0px;"&gt;StyleCopSettingsEditor.exe Settings.StyleCop&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You will then see the following user interface:&lt;/p&gt;
&lt;p&gt;&lt;img width="555" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/jschreuder/StyleCop.jpg" height="575" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Using this interface, you can simply select which rules are appropriate in your projects.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=469818" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /></entry><entry><title>Coding standards, Coding rules, Coding guidelines, etc...</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/25/coding-standards-coding-rules-coding-guidelines-etc.aspx" /><id>/blogs/jschreuder/archive/2008/07/25/coding-standards-coding-rules-coding-guidelines-etc.aspx</id><published>2008-07-25T20:11:00Z</published><updated>2008-07-25T20:11:00Z</updated><content type="html">&lt;p&gt;If there&amp;#39;s one thing that developers usually just cannot (or will not) agree to, then it&amp;#39;s Coding standards/rules/guidelines or whatever name you want to give it. I posted a &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/2008/07/25/have-your-c-coding-style-analysed-by-microsoft.aspx"&gt;short item about a new tool from Microsoft&lt;/a&gt; that checks if your code matches the Microsoft guidelines and sure enough, I&amp;#39;m already getting mails on the subject explaining that Microsoft&amp;#39;s rules suck and that they use one that&amp;#39;s better. I thought it might just be a great subject for a discussion. But let me share my views on the subject first.&lt;/p&gt;
&lt;h3&gt;Coding standards, my view&lt;/h3&gt;
&lt;p&gt;I&amp;#39;ve been working as a developer in various roles and projects now for over 20 years. Yes, I&amp;#39;m that old, but it&amp;#39;s to show that I speak from experience on this subject. Each project I worked on has had one or another form of coding guidelines or standards. In one project, they even called it a coding convention in an attempt to make it more important. My reaction in most occasions was: &amp;quot;What ever...&amp;quot;&lt;/p&gt;
&lt;p&gt;The thing with this subject is, that developers simply cannot agree to one single guideline. Every developer thinks he/she is the best in his/her area and therefor the expert to tell others how to write their code. Well, they&amp;#39;re wrong.&lt;/p&gt;
&lt;p&gt;A coding standard is as good as the method to enforce it. If it&amp;#39;s not enforced, then it&amp;#39;s useless. And in 99% of all projects you will see that coding standards are not enforced. In my view, the only standard that works is the standard that you can enforce using tools. The guidelines checked by Microsoft&amp;#39;s FxCop are a good example. It always uses the same rules for all code and always warns in the same way. There are other tools that do that as well, like DevPartner from Compuware. You can agree to those rules or not, but at least it leaves little room for discussion and I see FxCop being more and more accepted.&lt;/p&gt;
&lt;p&gt;And now there&amp;#39;s StyleCop. It checks your code against the coding rules as used at Microsoft development centers. Again, you can discuss if these rules are correct, but you get a tool that validates the code and tells you were you have strayed from the narrow path. My feeling is that although I don&amp;#39;t entire agree to all rules, at least I can force my team to stick to these rules. Simply by breaking the build if they don&amp;#39;t comply to the coding rules.&lt;/p&gt;
&lt;p&gt;There are tools that allow you to write your own custom rules, like ReSharper and DevPartner. Useful as this can be, what do you do with code generated by Microsoft code generators. Think only of generated code for DataSet objects and WinForms. It&amp;#39;s highly unlikely that this code will adhere to your guidelines. But will the use the Microsoft guidelines? It&amp;#39;s a better bet then with your custom rules.&lt;/p&gt;
&lt;p&gt;Another misconception is that these rules improve the quality. But to be frank, this is mostly bullshit. The rules checked by FxCop (and similar tools) check for code quality with respect to the use of the .Net framework. StyleCop (and similar tools) check for style issues. But that does not improve code quality. That can only be achieved by testing your work and using defense programming techniques. But I digress.&lt;/p&gt;
&lt;p&gt;So whatever suits you, I guess. I&amp;#39;ll stick to using the Microsoft Guidelines and use their tools to check if I&amp;#39;ve done it right. But whatever coding standard you choose, make sure your entire team sticks to those rules, otherwise they&amp;#39;re completely useless. Unless it&amp;#39;s to satisfy management that you thought about code quality.&lt;/p&gt;
&lt;p&gt;But please, feel free to comment. I will approve them as soon as possible, but with the weekend starting in the Netherlands it might take some time. But I&amp;#39;d love to hear how the community feels about coding standards, the new Microsoft tool, and other things regarding this subject.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=469610" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /></entry><entry><title>Have your C# coding style analysed by Microsoft!</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/25/have-your-c-coding-style-analysed-by-microsoft.aspx" /><id>/blogs/jschreuder/archive/2008/07/25/have-your-c-coding-style-analysed-by-microsoft.aspx</id><published>2008-07-25T07:58:00Z</published><updated>2008-07-25T07:58:00Z</updated><content type="html">&lt;p&gt;Or to be more specific, by Microsoft &lt;a target="_blank" href="http://blogs.msdn.com/sourceanalysis"&gt;StyleCop&lt;/a&gt;. Now this may not be new to you, and that&amp;#39;s very likely since StyleCop was announced in May of this year, but it was new to me. &lt;/p&gt;
&lt;p&gt;The tool checks your code for coding style and more specific, the Microsoft coding style. It was developed outside the VSTS team and has absolutely no connections to &lt;a target="_blank" href="http://www.codeproject.com/KB/cs/CrystalHelper.aspx"&gt;FxCop&lt;/a&gt;. FxCop focusses on .Net Framework standards and correct use, StyleCop focuss on the way your code looks. Among others, it checks your code for the following items:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Layout of elements, statements, expressions, and query clauses &lt;/li&gt;
&lt;li&gt;Placement of curly brackets, parenthesis, square brackets, etc &lt;/li&gt;
&lt;li&gt;Spacing around keywords and operator symbols &lt;/li&gt;
&lt;li&gt;Line spacing &lt;/li&gt;
&lt;li&gt;Placement of method parameters within method declarations or method calls &lt;/li&gt;
&lt;li&gt;Standard ordering of elements within a class &lt;/li&gt;
&lt;li&gt;Formatting of documentation within element headers and file headers &lt;/li&gt;
&lt;li&gt;Naming of elements, fields and variables &lt;/li&gt;
&lt;li&gt;Use of the built-in types &lt;/li&gt;
&lt;li&gt;Use of access modifiers &lt;/li&gt;
&lt;li&gt;Allowed contents of files &lt;/li&gt;
&lt;li&gt;Debugging text&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The idea behind StyleCop, as can be read on their teamblog: &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The ultimate goal of StyleCop is to allow you to produce elegant, consistent code that your team members and others who view your code will find highly readable. In order to accomplish this, StyleCop does not allow its rules to be very configurable. StyleCop takes a one-size-fits-all approach to code style, layout, and readability rules. It is highly likely that you will not agree with all of the rules and may even find some of the rules annoying at first!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I downloaded the tool (&lt;a target="_blank" href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis"&gt;click here&lt;/a&gt;) and installed it to test drive it on &lt;a target="_blank" href="http://www.codeproject.com/KB/cs/CrystalHelper.aspx"&gt;my CrystalHelper class&lt;/a&gt;, and boy are they right. Some of those rules are annoying. I previously checked that class with FxCop and got little to comments there. From people that used the code, I always received comments that is was readable, easy to comprehend, etc. Then again, those differences make sense. FxCop looks at usage of the .Net Framework and does so by analyzing the compiled binaries. StyleCop uses the actual code. But let me give you some examples of what StyleCop has to say about my code. &lt;/p&gt;
&lt;h3&gt;Running StyleCop&lt;/h3&gt;
&lt;p&gt;The first thing I noticed when I ran StyleCop (or Source Analysis as it&amp;#39;s called in the menu) is the enormous amount of comments. My first reaction was to remove the tool and forget about it. Actually, I had the same reaction when I first ran FxCop. I was curious enough to continue though, so let&amp;#39;s look at what the tool had to say about the following code segment.&lt;/p&gt;
&lt;div style="border-right:#cccccc 1pt solid;padding-right:1pt;border-top:#cccccc 1pt solid;padding-left:1pt;font-size:9pt;background:#f5f5f5;padding-bottom:1pt;overflow:auto;border-left:#cccccc 1pt solid;width:100%;color:black;padding-top:1pt;border-bottom:#cccccc 1pt solid;font-family:Courier New;"&gt;







&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 489&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#808080;"&gt; &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 490&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#008000;"&gt; Gets or sets the data source.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 491&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#808080;"&gt; &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 492&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#808080;"&gt; &amp;lt;value&amp;gt;&lt;/span&gt;&lt;span style="color:#008000;"&gt;The data source.&lt;/span&gt;&lt;span style="color:#808080;"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 493&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;DataSet&lt;/span&gt; DataSource&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 494&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 495&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 496&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 497&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _reportDataSource;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 498&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 499&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 500&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 501&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_reportDataSource != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) &lt;span style="color:#2b91af;"&gt;&lt;/span&gt;_reportDataSource.Dispose();&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 502&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 503&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _reportDataSource = &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 504&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 505&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/div&gt;
&lt;p&gt;Here we have 16 lines of code which most C# developers will accept as properly styled. StyleCop however gave me remarks about almost every line of code code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tabs are not allowed. Uses spaces instead. On almost every line.&lt;/li&gt;
&lt;li&gt;The call to _reportData must begin with the &amp;#39;this.&amp;#39; prefix to indicate that the item is a member of the class. On lines 497, 501, 502 and 504.&lt;/li&gt;
&lt;li&gt;Statements or elements wrapped in curly brackets must be followed by a blank line. On line 498.&lt;/li&gt;
&lt;li&gt;The body of the if statement must be wrapped in opening and closing curly brackets. On line 501.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to this, it also mentioned that the fieldname should not start with an underscore. This was a remark abou the _dataSource class variable I use in this property code. For this section of code, I received a total of 23 comments!&lt;/p&gt;
&lt;h3&gt;Changing the code to satisfy the tool&lt;/h3&gt;
&lt;p&gt;As I said, most C# developers will not really have a problem with the coding style used in the above segment. But apparently, this is totally unacceptable for Microsoft developers. My next step was to change the above code so that the tool would not complain about this code. And this is what it looks like after those changes: &lt;/p&gt;
&lt;div style="border-right:#cccccc 1pt solid;padding-right:1pt;border-top:#cccccc 1pt solid;padding-left:1pt;font-size:9pt;background:#f5f5f5;padding-bottom:1pt;overflow:auto;border-left:#cccccc 1pt solid;width:100%;color:black;padding-top:1pt;border-bottom:#cccccc 1pt solid;font-family:Courier New;"&gt;







&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 489&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#808080;"&gt; &amp;lt;summary&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 490&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#008000;"&gt; Gets or sets the data source.&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 491&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#808080;"&gt; &amp;lt;/summary&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 492&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#808080;"&gt; &amp;lt;value&amp;gt;&lt;/span&gt;&lt;span style="color:#008000;"&gt;The data source.&lt;/span&gt;&lt;span style="color:#808080;"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 493&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;DataSet&lt;/span&gt; DataSource&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 494&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 495&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 496&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 497&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ReportDataSource;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 498&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 499&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 500&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 501&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 502&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ReportDataSource != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 503&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 504&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:#0000ff;"&gt;this&lt;/span&gt;.ReportDataSource.Dispose();&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 505&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 506&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 507&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ReportDataSource = &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;;&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 508&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 509&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/div&gt;
&lt;p&gt;All tabs are now replaced with spaces. The body if the if statement is now enclosed in brackets. There&amp;#39;s an empty line after the closing brackets for the get body and the if body. All class members are now preceded by &amp;#39;this.&amp;#39;. And yes, I removed the underscore from the class member. Not that much different, but some of the changes make sense, I guess.&lt;/p&gt;
&lt;h3&gt;Other comments found by the tool&lt;/h3&gt;
&lt;p&gt;The tool does find other things as well. Here&amp;#39;s a short list of some other comments the tool made about my CrystalHelper class:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Invalid spacing around the comma. All comma&amp;#39;s should be followed by a single space&lt;/li&gt;
&lt;li&gt;Invalid spacing around the opening parenthesis. There should not be a single space after an opening parenthesis&lt;/li&gt;
&lt;li&gt;Invalid spacing around the closing parenthesis. There should not be a single space before a closing parenthesis&lt;/li&gt;
&lt;li&gt;The spacing around the symbol &amp;#39;=&amp;#39; is invalid. You need to add a single space before and after the &amp;#39;=&amp;#39;symbol&lt;/li&gt;
&lt;li&gt;All using directives must be placed inside of the namespace&lt;/li&gt;
&lt;li&gt;All methods must be placed after all constructors&lt;/li&gt;
&lt;li&gt;All methods must be placed after all properties&lt;/li&gt;
&lt;li&gt;All private methods must be placed after all protected methods&lt;/li&gt;
&lt;li&gt;All private methods must be placed after all public methods&lt;/li&gt;
&lt;li&gt;All protected constructors must be placed after all public constructors&lt;/li&gt;
&lt;li&gt;The method must have a documentation header&lt;/li&gt;
&lt;li&gt;The summary section in the documentation header must not be empty&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Should you use it?&lt;/h3&gt;
&lt;p&gt;A difficult question. My first reaction, as I said before, was to remove the tool and forget about it. But that was the same reaction I had when I first started using FxCop. And yet, that is now a tool I use on a daily basis. &lt;/p&gt;
&lt;p&gt;I also have a problem with non-enforceable coding standards. Put 10 developers in a room to talk about coding standards and you end up with either 10 slightly different versions, or one that none of them will adhere to. My experience over the last 20 years is that, if you can&amp;#39;t enforce coding standards, you can forget about introducing them and hope that it will all go well.&lt;/p&gt;
&lt;p&gt;And that&amp;#39;s exactly where this tool comes in. You can now enforce a number of rules to make code more readable and understandable. You might want to disagree to some of them (I don&amp;#39;t agree to using spaces instead of tabs) but you can run the tool and check if your coding style matches that of the tool. And when all developers in your team use the tool and change their code accordingly, then all your code looks quite similar. Making it easier for your teammembers to work on code by other developers. And that&amp;#39;s the main objective for any development team to create a coding standard. &lt;/p&gt;
&lt;p&gt;The tool can also be included in MS-Build scripts, so you can easily make sure the build is broken when a developer ignores the coding standard. &lt;strong&gt;So yes, use it!&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Some tips when using StyleCop&lt;/h3&gt;
&lt;p&gt;Once you have installed the tool and are ready to check your code using the tool, you might want to consider doing the following first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to the C# section in Tools -&amp;gt; Options -&amp;gt; TextEditor and change the properties for the tabs so that it inserts spaces and click the OK button&lt;/li&gt;
&lt;li&gt;Open the class file and select all code using CTRL-A&lt;/li&gt;
&lt;li&gt;Now hold the CTRL key and press K, followed by F. This automatically re-aligns the entire class and replaces any tabs in your code with spaces. Do this for all class files in your project.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When you do this, the following will happen in your code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tabs are converted into spaces&lt;/li&gt;
&lt;li&gt;Spacing before and after open and closing parenthesis is adjusted&lt;/li&gt;
&lt;li&gt;Spacing around symbols is adjusted&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;StyleCop will not give yo any comments about those items. Which leaves the more interesting items to fix.&lt;/p&gt;
&lt;h3&gt;What&amp;#39;s next for StyleCop?&lt;/h3&gt;
&lt;p&gt;Like all Microsoft tools, this is a work in progress. New features and options will be added and bugs will be fixed. But for the near future, the following has already been announced:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The tool is still called Source Analysis when you look for it in the Tools menu. It will be renamed to StyleCop&lt;/li&gt;
&lt;li&gt;A small SDK will be made available to allow you to extend the tool with your own rules&lt;/li&gt;
&lt;li&gt;Documentation about the currently available rules (which in fact opens up the Microsoft C# coding standards to the community)&lt;/li&gt;
&lt;li&gt;Automatically change your code to enforce some of the rules&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So keep an eye on the &lt;a target="_blank" href="http://blogs.msdn.com/sourceanalysis/"&gt;StyleCop blog&lt;/a&gt; for future releases of this tool. I will be discussing the tool with my team as soon as possible and start using it. Finally a way to have our code look similar!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=469572" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Code inspections" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+inspections/default.aspx" /><category term="Articles" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Articles/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /></entry><entry><title>Another solution to import text files (tab, csv, custom) - FileHelpers</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/22/another-solution-to-import-text-files-tab-csv-custom.aspx" /><id>/blogs/jschreuder/archive/2008/07/22/another-solution-to-import-text-files-tab-csv-custom.aspx</id><published>2008-07-22T09:20:00Z</published><updated>2008-07-22T09:20:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://filehelpers.sourceforge.net/"&gt;&lt;img width="200" src="http://filehelpers.sourceforge.net/filehelpers_box.png" height="239" style="float:right;margin-left:5px;margin-right:5px;" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some of you brought another solution for importing text files to my attention. Thank you for that!&lt;/p&gt;
&lt;p&gt;For my current imports my &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/2008/07/15/how-to-use-OleDb-to-import-comma-or-tab-delimited-files.aspx" title="Previous post"&gt;previous solution&lt;/a&gt; works just fine. But if you are processing more complex files, then FileHelpers is an excellent library to use. (And very likely more flexible and robust then my solution). It&amp;#39;s also an open-source library. You can even download the source code if you like.&amp;nbsp;Some of the main features of this&amp;nbsp;library (source &lt;a href="http://filehelpers.sourceforge.net/"&gt;http://filehelpers.sourceforge.net/&lt;/a&gt;)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Easy to use:&lt;/b&gt; The FileHelpers Lib is straight forward to learn and use&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Auto Converters:&lt;/b&gt; The library has a set of converters for the basic types and can be easy extended to provide custom converters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Master-Detail: &lt;/strong&gt;You can read and write records with a master/detail pattern&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple record format support: &lt;/strong&gt;With the MultirecordEngine you can read files with different record layout, you can also read files with some delimited and some fixed length records&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Event Support: &lt;/strong&gt;The engines of the library contain some events to make you easy to extend the behavior of the library&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ms Excel Storage:&amp;nbsp;&lt;/strong&gt; Are a way to extract / insert records between any source and an excel file&lt;/li&gt;
&lt;li&gt;&lt;b&gt;.NET Compact Framework Support &lt;strong&gt;&lt;/strong&gt;&lt;/b&gt;From the version 1.1 you can use the FileHelpers library for you PocketPC and WindowsCE developments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;.NET 2.0 Generics:&lt;/strong&gt; the cast less and strong typed version of the engines&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;.NET 2.0 Nullable Types&lt;/strong&gt; The library supports Nullable types in his core&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FileDiffEngine&lt;/strong&gt; to allow compare files with the same record layout&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And many more. Using the library is extremely simple, just check the &lt;a target="_blank" href="http://filehelpers.sourceforge.net/example_easy.html" title="Click here for an easy example"&gt;EasyExample&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So if you want to build something yourself, then the solution described in my previous post will get you started. If you just want to import a variety of data files, then FileHelpers is something you should consider using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=468614" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /></entry><entry><title>How to: Use OleDb to import text files (tab, csv, custom)</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/15/how-to-use-OleDb-to-import-comma-or-tab-delimited-files.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="12370" href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.46.62.41/ImportUsingJet.zip" /><id>/blogs/jschreuder/archive/2008/07/15/how-to-use-OleDb-to-import-comma-or-tab-delimited-files.aspx</id><published>2008-07-15T11:52:00Z</published><updated>2008-07-15T11:52:00Z</updated><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I have been browsing the web for a good and simple class to handle delimited file imports. My current assignment has an import option that needs to deal with that. However, the current implementation (using StreamReader) is not good enough. It doesn&amp;#39;t handle all the exceptions you encounter with delimited files. I found a number of examples on the internet, but none of them really suited my needs. What I really missed was a simple example that I could extend so that it would suite my needs. So, being the developer that I am, I created my own class to import delimited files. After this was completed, I though I&amp;#39;d share it as an example to others. &lt;/p&gt;
&lt;h2&gt;Using StreamReader&lt;/h2&gt;
&lt;p&gt;The easiest way to process delimited files is to use a StreamReader object. You then simply open the file, read each line and then use the split method to get the various column values. For example: &lt;/p&gt;

&lt;div style="border-right:#cccccc 1pt solid;padding-right:1pt;border-top:#cccccc 1pt solid;padding-left:1pt;font-size:9pt;background:#f5f5f5;padding-bottom:1pt;overflow:auto;border-left:#cccccc 1pt solid;width:100%;color:black;padding-top:1pt;border-bottom:#cccccc 1pt solid;font-family:Courier New;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ImportDelimitedFile(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; filename, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; delimiter)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;StreamReader&lt;/span&gt; file = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;StreamReader&lt;/span&gt;(filename))&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; line;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;while&lt;/span&gt; ((line = file.ReadLine()) != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;
            if&lt;/span&gt; (line.Trim().Length &amp;gt; 0)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;[] columns = line.Split(delimiter, &lt;span style="color:#2b91af;"&gt;StringSplitOptions&lt;/span&gt;.None);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#008000;"&gt;// Add code to process the columns&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In a lot of cases this works just fine, but there are limitations to this scenario.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It&amp;#39;s difficult to split a line into columns. For example, when you use Comma Separated File (CSV) it is well possible that a comma is in one of the columns. Using a simple string.Split is therefor not an option&lt;/li&gt;
&lt;li&gt;When you only need certain columns or lines, you will need to scan all of them and handle all lines and filter what you need&lt;/li&gt;
&lt;li&gt;It&amp;#39;s not possible to return to a previous line&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Using the Jet Engine&lt;/h2&gt;
&lt;p&gt;The above mentioned problems are eliminated when you use the Jet engine. The following code shows how a CSV file can be processed.&lt;/p&gt;

&lt;div style="border-right:#cccccc 1pt solid;padding-right:1pt;border-top:#cccccc 1pt solid;padding-left:1pt;font-size:9pt;background:#f5f5f5;padding-bottom:1pt;overflow:auto;border-left:#cccccc 1pt solid;width:100%;color:black;padding-top:1pt;border-bottom:#cccccc 1pt solid;font-family:Courier New;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ImportCsvFile(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; filename)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;FileInfo&lt;/span&gt; file = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;FileInfo&lt;/span&gt;(filename);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;OleDbConnection&lt;/span&gt; con = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;OleDbConnection&lt;/span&gt;(&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#a31515;"&gt;&amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;Data
            Source=\&amp;quot;&amp;quot;&lt;/span&gt; + file.DirectoryName + &lt;span style="color:#a31515;"&gt;&amp;quot;\&amp;quot;;Extended Properties=&amp;#39;text;HDR=Yes;FMT=Delimited(,)&amp;#39;;&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;OleDbCommand&lt;/span&gt; cmd = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;OleDbCommand&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515;"&gt;&amp;quot;SELECT * FROM [{0}]&amp;quot;&lt;/span&gt;, file.Name), con))&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; con.Open();&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#008000;"&gt;
            // Using a DataReader to process the data&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;
            using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;OleDbDataReader&lt;/span&gt; reader = cmd.ExecuteReader())&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;while&lt;/span&gt; (reader.Read())&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&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:#008000;"&gt;// Process the current reader entry...&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#008000;"&gt;
            // Using a DataTable to process the data&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;
            using&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;OleDbDataAdapter&lt;/span&gt; adp = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;OleDbDataAdapter&lt;/span&gt;(cmd))&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#2b91af;"&gt;DataTable&lt;/span&gt; tbl = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;DataTable&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;MyTable&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adp.Fill(tbl);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color:#0000ff;"&gt;foreach&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;DataRow&lt;/span&gt; row &lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; tbl.Rows)&lt;/pre&gt;
&lt;pre style="margin:0px;"&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; &amp;nbsp; &lt;span style="color:#008000;"&gt;// Process the current row...&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;As you can see in the example, once you have the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms254953.aspx"&gt;Command object&lt;/a&gt;, you have the option of using anything a command object will allow you to do. You could process the file using a &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms254509.aspx"&gt;DataReader&lt;/a&gt; object, create a &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx"&gt;DataTable&lt;/a&gt; object containing the data or even add a where clause to the CommandText of your Command object to specifiy better which data is to be imported.&lt;/p&gt;
&lt;h2&gt;Helper Class&lt;br /&gt;&lt;/h2&gt;
&lt;p&gt;Using this, and the information provided in this &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms974559.aspx"&gt;Microsoft Article&lt;/a&gt;, I created a small class that allows you to import delimited files. The class is very basic, but can easily be extended to suit your specific needs. This class will solve the most important issues when you&amp;#39;re going to use Jet as your import engine.&lt;/p&gt;
&lt;p&gt;Some things you need to consider when you are importing delimited files, be it with this class or using custom code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Jet engine makes assumptions about the content of the file. This can result in incorrect imports. For example, it might think a column contains date values. But in fact, you&amp;#39;re file should treat the columns as a string. In these cases, you should create a Schema.Ini file that describes the type of value for each column. The class creates a Schema.Ini file before it opens the delimited file, but only to specify what the delimiter is. You may want to change this to use pre-defined ini files that describe your input file. Details on the Schema.Ini file can be found &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms709353(VS.85).aspx"&gt;here&lt;/a&gt; .&lt;/li&gt;
&lt;li&gt;The class uses an &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbcommand.aspx"&gt;OleDbDataReader&lt;/a&gt; to read each line in the import file. But it is easily replaced with the option of adding the data into a DataSet or DataTable object. It&amp;#39;s also possible to use &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx"&gt;SqlBulkCopy&lt;/a&gt; to instantly insert all the data into a SQL server database.&lt;/li&gt;
&lt;li&gt;The above mentioned &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms974559.aspx"&gt;Microsoft Article&lt;/a&gt; is the best starting point for this type of import. You might want to read that before you start building imports for delimited files, even if this class is usefull to you. The article provides interesting background information and links to various Microsoft resources with more details and information.&lt;/li&gt;
&lt;li&gt;The helper class uses an event to allow you to handle the information being read. You can, of course, also provide an overridable method.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Valuable resources&lt;/h2&gt;
&lt;p&gt;The information I used to to build this class was found on the Internet. I used the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms974559.aspx"&gt;Much ADO About Text Files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.codeproject.com/KB/database/ReadTextFile.aspx"&gt;Read text file (txt, csv, log, tab, fixed length)&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Disclaimer&lt;/h2&gt;
&lt;p&gt;The code presented in the helper class is not an all-purpose import solution. It&amp;#39;s just a basic class to help you build your own import class. If you need other import types, or a way to influence the content of the default Schema.ini file, you will need to do that your self. If you find any problems, please feel free to point them out to me.&lt;/p&gt;
&lt;p&gt;You can download the file &lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.46.62.41/ImportUsingJet.zip" title="Click here to download the code"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This article is also &lt;a target="_blank" href="http://www.codeproject.com/KB/cs/UsingJetForImport.aspx" title="See article on CodeProject"&gt;published on CodeProject.com&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=466241" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="Code Samples" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Code+Samples/default.aspx" /><category term="Articles" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Articles/default.aspx" /><category term="C#" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/C_2300_/default.aspx" /><category term=".Net Do's &amp;amp; Don'ts" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/.Net+Do_2700_s+_2600_amp_3B00_+Don_2700_ts/default.aspx" /></entry><entry><title>SAP is annoying me</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/07/09/sap-is-annoying-me.aspx" /><id>/blogs/jschreuder/archive/2008/07/09/sap-is-annoying-me.aspx</id><published>2008-07-09T12:26:00Z</published><updated>2008-07-09T12:26:00Z</updated><content type="html">&lt;p&gt;I never had to do anything with SAP my self, other than interfacing from a .Net application. But since SAP has purchased Business Objects, I find I have to deal with them more and more. Why? Well, since SAP bought Business Objects, who bought Crystal Decisions a while back, they are the owner of Crystal Reports. I&amp;#39;ve posted about crystal on several occasions (see &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/tags/Crystal+Reports/default.aspx" title="My Crystal posts"&gt;link&lt;/a&gt;). I even posted an article on CodeProject.com where you can find my &lt;a target="_blank" href="http://bloggingabout.net/blogs/jschreuder/archive/tags/Crystal+Reports/default.aspx" title="My article on CodeProject.com"&gt;CrystalHelper class&lt;/a&gt;. And because of that, people ask me questions about issues they have with the helper class and Crystal Reports in general. I feel it my duty to help them as much as I can. &lt;/p&gt;
&lt;p&gt;But SAP have thought it would be a good idea to redesign their entire site, making all my links virtually useless. And not just mine of course, but of thousands of others. The new site structure however is a fine example of making things disappear. It took me 15 minutes to find out where I could download the latest version of the merge modules for Visual Studio 2005. So for all you that are lost in the wonderfull world of SAP Crystal Reports, here are some starting points I managed to find:&lt;/p&gt;
&lt;h4&gt;&lt;a target="_blank" href="http://www.sdn.sap.com/irj/sdn/advancedsearch&amp;amp;cat=sdn_ossnotes&amp;amp;query=&amp;amp;adv=true"&gt;Notes&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Search SAP Business Objects Notes for Crystal Reports and Xcelsius products. Notes were known as Knowledge Base search and Knowledge Base Articles on the Business Objects web site. &lt;/p&gt;
&lt;h4&gt;&lt;a target="_self" href="http://www.sdn.sap.com/irj/sdn/businessobjects-articles"&gt;Articles&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Read SAP Business Objects articles, formerly known as Technical Papers on the Business Objects web site. &lt;/p&gt;
&lt;h4&gt;&lt;a target="_blank" href="http://www.sdn.sap.com/irj/sdn/businessobjects-downloads"&gt;Downloads&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Find Crystal Reports and Xcelsius service packs, hot fixes, critical updates, runtime packages, samples and utilities. &lt;/p&gt;
&lt;h4&gt;&lt;a target="_blank" href="http://www.sdn.sap.comhttp//help.sap.com"&gt;Product Guides&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Find SAP Business Objects Product Guides on the SAP Help Portal under &amp;ldquo;Business Objects&amp;rdquo; in the top navigation. &lt;/p&gt;
&lt;h4&gt;&lt;a target="_self" href="http://www.sdn.sap.com/irj/sdn/businessobjects-support?rid=/webcontent/uuid/00f6574f-8723-2b10-c1a6-f13e38194ee8"&gt;Product Lifecycles&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Find out about the Technical Support Lifecycle policy and end of life dates. &lt;/p&gt;
&lt;h4&gt;Forums: Read and post questions to the new forums. &lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.sdn.sap.com/irj/sdn/businessobjects-forums"&gt;Business Objects Forums&lt;/a&gt;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" href="http://www.sdn.sap.com/irj/sdn/businessobjects-sdk-forums"&gt;Business Objects SDK Application Development&lt;/a&gt;&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;UPDATE August 2, 2008&lt;/h3&gt;
&lt;p&gt;I found the download page for service packs, hot fixes, merge modules etc. It&amp;#39;s here: &lt;a href="https://websmp230.sap-ag.de/sap(bD1ubCZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm"&gt;https://websmp230.sap-ag.de/sap(bD1ubCZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=464172" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Crystal Reports" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Crystal+Reports/default.aspx" /></entry><entry><title>Choosing a Sandcastle tool</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/06/25/choosing-a-sandcastle-tool.aspx" /><id>/blogs/jschreuder/archive/2008/06/25/choosing-a-sandcastle-tool.aspx</id><published>2008-06-25T21:09:58Z</published><updated>2008-06-25T21:09:58Z</updated><content type="html">&lt;p&gt;I&amp;#39;ve posted about Sandcastle on several occasions and wrote about some of the tools that make the use of Sandcastle somewhat easier. But recently I&amp;#39;ve been getting emails asking me how one should choose between the various options available.&lt;/p&gt; &lt;p&gt;In this post, I will briefly explain which third-party tool I use, and why I decided to do so. But, first I will need to explain which tools I evaluated to come to that decision.&lt;/p&gt; &lt;h2&gt;Sandcastle Help File Builder&lt;/h2&gt; &lt;p&gt;Sandcastle Help File Builder (or SHFB) is a Windows Forms application developed by Eric Woodruff. Eric built the application a few months after the release of the first CTP released by Microsoft back in July 1996. He saw the need for a NDoc compatible GUI. NDoc no longer supported the new features in the .Net framework at that time and Microsoft had no intentions of delivering a GUI. &lt;/p&gt; &lt;p&gt;SHFB also includes a command-line version, which allows you to include the creation of documentation in an MS-Build script.&lt;/p&gt; &lt;p&gt;SHFB fills the gap for all NDoc users to make the jump to Sandcastle. You can find more information about SHFB and the downloadable installer here: &lt;a title="http://www.codeplex.com/SHFB" href="http://www.codeplex.com/SHFB"&gt;http://www.codeplex.com/SHFB&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;DocProject&lt;/h2&gt; &lt;p&gt;Dave Sexton, the developer of DocProject, followed another strategy. He sought to integrate Sandcastle into Visual Studio. He developed a Visual Studio Add-In which installs new project types into Visual Studio. The project types can be included into existing Visual Studio solutions.&lt;/p&gt; &lt;p&gt;But DocProject also installs a GUI which resembles the familiar interface from NDoc. More information and an installer can be found here: &lt;a title="http://www.codeplex.com/DocProject" href="http://www.codeplex.com/DocProject"&gt;http://www.codeplex.com/DocProject&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;My choice&lt;/h2&gt; &lt;p&gt;You have to make a choice at some point, and I chose to use DocProject. My reasons for doing so were the seamless integration into Visual Studio. It&amp;#39;s just another project type and therefor makes it easy and simple to include building documentation into your daily builds. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=461424" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term=".Net Do's &amp;amp; Don'ts" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/.Net+Do_2700_s+_2600_amp_3B00_+Don_2700_ts/default.aspx" /></entry><entry><title>Looking for icons?</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/05/16/looking-for-icons.aspx" /><id>/blogs/jschreuder/archive/2008/05/16/looking-for-icons.aspx</id><published>2008-05-16T11:09:00Z</published><updated>2008-05-16T11:09:00Z</updated><content type="html">&lt;p&gt;It happens to all of us. You need an icon&amp;nbsp;for a specific subject&amp;nbsp;and you can&amp;#39;t seem to find one. Having&amp;nbsp;a new icon designed might take&amp;nbsp;too long. &lt;/p&gt;
&lt;p&gt;Usually,&amp;nbsp;people simply resort to starting &lt;a target="_blank" href="http://images.google.com/imghp?hl=en&amp;amp;tab=wi" title="Search for images using Google" class="null"&gt;Google&amp;nbsp;Image search&lt;/a&gt;.&amp;nbsp;This morning I bumped into &lt;a target="_blank" href="http://commons.wikimedia.org/wiki/Main_Page" title="Go to Wikimedia Commons" class="null"&gt;Wikimedia Commons&lt;/a&gt;. They have a large image base which is categorized into logical subjects. I found a number of very good icons for my current project here at &lt;a target="_blank" href="http://commons.wikimedia.org/wiki/Category:Icons_by_subject" title="Icons by subject" class="null"&gt;this link&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Here are some sample icons:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_1downarrow.png" title="Crystal Clear action 1downarrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Crystal_Clear_action_1downarrow.png/32px-Crystal_Clear_action_1downarrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_1leftarrow.png" title="Crystal Clear action 1leftarrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Crystal_Clear_action_1leftarrow.png/32px-Crystal_Clear_action_1leftarrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_1uparrow.png" title="Crystal Clear action 1uparrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Crystal_Clear_action_1uparrow.png/32px-Crystal_Clear_action_1uparrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_2downarrow.png" title="Crystal Clear action 2downarrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Crystal_Clear_action_2downarrow.png/32px-Crystal_Clear_action_2downarrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_2leftarrow.png" title="Crystal Clear action 2leftarrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Crystal_Clear_action_2leftarrow.png/32px-Crystal_Clear_action_2leftarrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_2rightarrow.png" title="Crystal Clear action 2rightarrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Crystal_Clear_action_2rightarrow.png/32px-Crystal_Clear_action_2rightarrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_2uparrow.png" title="Crystal Clear action 2uparrow.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Crystal_Clear_action_2uparrow.png/32px-Crystal_Clear_action_2uparrow.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_apply.png" title="Crystal Clear action apply.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Crystal_Clear_action_apply.png/32px-Crystal_Clear_action_apply.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_back.png" title="Crystal Clear action back.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Crystal_Clear_action_back.png/32px-Crystal_Clear_action_back.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_bookmark.png" title="Crystal Clear action bookmark.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/03/Crystal_Clear_action_bookmark.png/32px-Crystal_Clear_action_bookmark.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_bookmark_Silver.png" title="Crystal Clear action bookmark Silver.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Crystal_Clear_action_bookmark_Silver.png/32px-Crystal_Clear_action_bookmark_Silver.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_build.png" title="Crystal Clear action build.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Crystal_Clear_action_build.png/32px-Crystal_Clear_action_build.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_button_cancel.png" title="Crystal Clear action button cancel.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Crystal_Clear_action_button_cancel.png/32px-Crystal_Clear_action_button_cancel.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_configure.png" title="Crystal Clear action configure.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Crystal_Clear_action_configure.png/32px-Crystal_Clear_action_configure.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_db_add.png" title="Crystal Clear action db add.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Crystal_Clear_action_db_add.png/32px-Crystal_Clear_action_db_add.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_db_comit.png" title="Crystal Clear action db comit.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Crystal_Clear_action_db_comit.png/32px-Crystal_Clear_action_db_comit.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_db_remove.png" title="Crystal Clear action db remove.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Crystal_Clear_action_db_remove.png/32px-Crystal_Clear_action_db_remove.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_db_status.png" title="Crystal Clear action db status.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Crystal_Clear_action_db_status.png/32px-Crystal_Clear_action_db_status.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_db_update.png" title="Crystal Clear action db update.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Crystal_Clear_action_db_update.png/32px-Crystal_Clear_action_db_update.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_decrypted.png" title="Crystal Clear action decrypted.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Crystal_Clear_action_decrypted.png/32px-Crystal_Clear_action_decrypted.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_demo.png" title="Crystal Clear action demo.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f0/Crystal_Clear_action_demo.png/32px-Crystal_Clear_action_demo.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_down.png" title="Crystal Clear action down.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Crystal_Clear_action_down.png/32px-Crystal_Clear_action_down.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_edit_add.png" title="Crystal Clear action edit add.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Crystal_Clear_action_edit_add.png/32px-Crystal_Clear_action_edit_add.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_edit_remove.png" title="Crystal Clear action edit remove.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Crystal_Clear_action_edit_remove.png/32px-Crystal_Clear_action_edit_remove.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_edit.png" title="Crystal Clear action edit.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Crystal_Clear_action_edit.png/32px-Crystal_Clear_action_edit.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_editcopy.png" title="Crystal Clear action editcopy.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Crystal_Clear_action_editcopy.png/32px-Crystal_Clear_action_editcopy.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_editcut.png" title="Crystal Clear action editcut.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Crystal_Clear_action_editcut.png/32px-Crystal_Clear_action_editcut.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_editdelete.png" title="Crystal Clear action editdelete.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Crystal_Clear_action_editdelete.png/32px-Crystal_Clear_action_editdelete.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_editpaste.png" title="Crystal Clear action editpaste.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/69/Crystal_Clear_action_editpaste.png/32px-Crystal_Clear_action_editpaste.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_encrypted.png" title="Crystal Clear action encrypted.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Crystal_Clear_action_encrypted.png/32px-Crystal_Clear_action_encrypted.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_exit.png" title="Crystal Clear action exit.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Crystal_Clear_action_exit.png/32px-Crystal_Clear_action_exit.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_filefind.png" title="Crystal Clear action filefind.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Crystal_Clear_action_filefind.png/32px-Crystal_Clear_action_filefind.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_filenew.png" title="Crystal Clear action filenew.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Crystal_Clear_action_filenew.png/32px-Crystal_Clear_action_filenew.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_fileprint.png" title="Crystal Clear action fileprint.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Crystal_Clear_action_fileprint.png/32px-Crystal_Clear_action_fileprint.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_filequickprint.png" title="Crystal Clear action filequickprint.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Crystal_Clear_action_filequickprint.png/32px-Crystal_Clear_action_filequickprint.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_find.png" title="Crystal Clear action find.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Crystal_Clear_action_find.png/32px-Crystal_Clear_action_find.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_flag.png" title="Crystal Clear action flag.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Crystal_Clear_action_flag.png/32px-Crystal_Clear_action_flag.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_fonts.png" title="Crystal Clear action fonts.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Crystal_Clear_action_fonts.png/32px-Crystal_Clear_action_fonts.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_forward.png" title="Crystal Clear action forward.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Crystal_Clear_action_forward.png/32px-Crystal_Clear_action_forward.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_frameprint.png" title="Crystal Clear action frameprint.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Crystal_Clear_action_frameprint.png/32px-Crystal_Clear_action_frameprint.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_gohome.png" title="Crystal Clear action gohome.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Crystal_Clear_action_gohome.png/32px-Crystal_Clear_action_gohome.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_history.png" title="Crystal Clear action history.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Crystal_Clear_action_history.png/32px-Crystal_Clear_action_history.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_info.png" title="Crystal Clear action info.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Crystal_Clear_action_info.png/32px-Crystal_Clear_action_info.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_lock.png" title="Crystal Clear action lock.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Crystal_Clear_action_lock.png/32px-Crystal_Clear_action_lock.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_lock_-_pink.png" title="Crystal Clear action lock - pink.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Crystal_Clear_action_lock_-_pink.png/32px-Crystal_Clear_action_lock_-_pink.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_lock-silver.png" title="Crystal Clear action lock-silver.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Crystal_Clear_action_lock-silver.png/32px-Crystal_Clear_action_lock-silver.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_loopnone.png" title="Crystal Clear action loopnone.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Crystal_Clear_action_loopnone.png/32px-Crystal_Clear_action_loopnone.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_news_subscribe.png" title="Crystal Clear action news subscribe.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Crystal_Clear_action_news_subscribe.png/32px-Crystal_Clear_action_news_subscribe.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_player_end.png" title="Crystal Clear action player end.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Crystal_Clear_action_player_end.png/32px-Crystal_Clear_action_player_end.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_player_play.png" title="Crystal Clear action player play.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Crystal_Clear_action_player_play.png/32px-Crystal_Clear_action_player_play.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_playlist.png" title="Crystal Clear action playlist.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Crystal_Clear_action_playlist.png/32px-Crystal_Clear_action_playlist.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_reload.png" title="Crystal Clear action reload.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Crystal_Clear_action_reload.png/32px-Crystal_Clear_action_reload.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_run.png" title="Crystal Clear action run.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Crystal_Clear_action_run.png/32px-Crystal_Clear_action_run.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_seyon.png" title="Crystal Clear action seyon.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Crystal_Clear_action_seyon.png/32px-Crystal_Clear_action_seyon.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_share.png" title="Crystal Clear action share.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Crystal_Clear_action_share.png/32px-Crystal_Clear_action_share.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_spellcheck.png" title="Crystal Clear action spellcheck.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Crystal_Clear_action_spellcheck.png/32px-Crystal_Clear_action_spellcheck.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_stop.png" title="Crystal Clear action stop.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Crystal_Clear_action_stop.png/32px-Crystal_Clear_action_stop.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_tab_new.png" title="Crystal Clear action tab new.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Crystal_Clear_action_tab_new.png/32px-Crystal_Clear_action_tab_new.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_tab_remove.png" title="Crystal Clear action tab remove.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Crystal_Clear_action_tab_remove.png/32px-Crystal_Clear_action_tab_remove.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_tab.png" title="Crystal Clear action tab.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Crystal_Clear_action_tab.png/32px-Crystal_Clear_action_tab.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_up.png" title="Crystal Clear action up.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Crystal_Clear_action_up.png/32px-Crystal_Clear_action_up.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_bottom.png" title="Crystal Clear action view bottom.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Crystal_Clear_action_view_bottom.png/32px-Crystal_Clear_action_view_bottom.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_choose.png" title="Crystal Clear action view choose.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Crystal_Clear_action_view_choose.png/32px-Crystal_Clear_action_view_choose.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_detailed.png" title="Crystal Clear action view detailed.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/97/Crystal_Clear_action_view_detailed.png/32px-Crystal_Clear_action_view_detailed.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_icon.png" title="Crystal Clear action view icon.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Crystal_Clear_action_view_icon.png/32px-Crystal_Clear_action_view_icon.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_left_right.png" title="Crystal Clear action view left right.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Crystal_Clear_action_view_left_right.png/32px-Crystal_Clear_action_view_left_right.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_multicolumn.png" title="Crystal Clear action view multicolumn.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Crystal_Clear_action_view_multicolumn.png/32px-Crystal_Clear_action_view_multicolumn.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_remove.png" title="Crystal Clear action view remove.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Crystal_Clear_action_view_remove.png/32px-Crystal_Clear_action_view_remove.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_right.png" title="Crystal Clear action view right.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Crystal_Clear_action_view_right.png/32px-Crystal_Clear_action_view_right.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_text.png" title="Crystal Clear action view text.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Crystal_Clear_action_view_text.png/32px-Crystal_Clear_action_view_text.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_top_bottom.png" title="Crystal Clear action view top bottom.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8c/Crystal_Clear_action_view_top_bottom.png/32px-Crystal_Clear_action_view_top_bottom.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_view_tree.png" title="Crystal Clear action view tree.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Crystal_Clear_action_view_tree.png/32px-Crystal_Clear_action_view_tree.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_viewmag-.png" title="Crystal Clear action viewmag-.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Crystal_Clear_action_viewmag-.png/32px-Crystal_Clear_action_viewmag-.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_viewmag.png" title="Crystal Clear action viewmag.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Crystal_Clear_action_viewmag.png/32px-Crystal_Clear_action_viewmag.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_viewmag%2B.png" title="Crystal Clear action viewmag+.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Crystal_Clear_action_viewmag%2B.png/32px-Crystal_Clear_action_viewmag%2B.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_viewmag1.png" title="Crystal Clear action viewmag1.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/24/Crystal_Clear_action_viewmag1.png/32px-Crystal_Clear_action_viewmag1.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_viewmagfit.png" title="Crystal Clear action viewmagfit.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Crystal_Clear_action_viewmagfit.png/32px-Crystal_Clear_action_viewmagfit.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_window_fullscreen.png" title="Crystal Clear action window fullscreen.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Crystal_Clear_action_window_fullscreen.png/32px-Crystal_Clear_action_window_fullscreen.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_window_new.png" title="Crystal Clear action window new.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crystal_Clear_action_window_new.png/32px-Crystal_Clear_action_window_new.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Crystal_Clear_action_window_nofullscreen.png" title="Crystal Clear action window nofullscreen.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Crystal_Clear_action_window_nofullscreen.png/32px-Crystal_Clear_action_window_nofullscreen.png" height="32" alt="" /&gt;&lt;/a&gt; &lt;a href="http://bloggingabout.net/wiki/Image:Quick_restart.png" title="Quick restart.png" class="image"&gt;&lt;img border="0" width="32" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Quick_restart.png/32px-Quick_restart.png" height="32" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=459022" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /></entry><entry><title>Deploying applications that use Crystal Reports for .Net</title><link rel="alternate" type="text/html" href="/blogs/jschreuder/archive/2008/05/14/deploying-applications-that-use-crystal-reports-for-net.aspx" /><id>/blogs/jschreuder/archive/2008/05/14/deploying-applications-that-use-crystal-reports-for-net.aspx</id><published>2008-05-14T20:28:05Z</published><updated>2008-05-14T20:28:05Z</updated><content type="html">&lt;p&gt;I know, for a lot of Microsoft developers Crystal Reports (CR) is a no-go area. But I know that a lot of developers are using it, whether they like it or not. Because of my posts about CR, and more specifically my CrystalHelper class, I&amp;#39;m asked how to deploy applications that use the free version of CR that is shipped with various versions of Visual Studio. &lt;/p&gt; &lt;p&gt;This information is already available at support site for CR. In this post I will post links to that documentation as a reminder to myself, but also to help others that need help when deploying CR to client or server machines.&lt;/p&gt; &lt;h2&gt;Register your version of CR&lt;/h2&gt; &lt;p&gt;Although you are allowed to freely distribute the CR engine that is supplied with Microsoft Visual Studio, you still need to register that version. To do so, simply add a report to your application. CR will check if registration has already taken place. When this is not the case, CR will ask if you wish to register. Just follow the steps and registration will take place. Registration is free!&lt;/p&gt; &lt;h2&gt;Register yourself as a CR developer at Business Objects&lt;/h2&gt;An important source of information for everyone using CR, as a developer or a report designer, is the &lt;a href="https://boc.sdn.sap.com/" target="_blank"&gt;Diamond Technical Community web site&lt;/a&gt;. When you register here, you get access to all the documentation available on CR. Most of the information I will link to in this post can be found here, the downloads for Merge Modules and Service packs.  &lt;h2&gt;CR as part of a VS 2002/2003/2005 project &lt;/h2&gt; &lt;p&gt;For Visual Studio 2002/2003/2005, you are required to use merge modules. The current version of these modules can be found here:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Download merge modules for &lt;a href="http://support.businessobjects.com/downloads/runtime.asp#03" target="_blank"&gt;Visual Studio 2002&lt;/a&gt;  &lt;li&gt;Download merge modules for &lt;a href="http://support.businessobjects.com/downloads/runtime.asp#04" target="_blank"&gt;Visual Studio 2003&lt;/a&gt;  &lt;li&gt;Download merge modules for &lt;a href="http://support.businessobjects.com/downloads/runtime.asp#07" target="_blank"&gt;Visual Studio 2005&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;These downloads contain a number of merge modules. Which module is required for your setup depends on the reports you are deploying. A very comprehensive document that explains which modules to add and how to do so when you use Visual Studio 2002/2003 can be found &lt;a href="http://resources.businessobjects.com/support/communitycs/TechnicalPapers/crnet_deployment.pdf?recDnlReq=Record&amp;amp;dnlPath=crnet_deployment.pdf" target="_blank"&gt;here&lt;/a&gt;. Documentation on how to use the merge modules in Visual Studio 2005 is enclosed in the download of those merge modules.&lt;/p&gt; &lt;h2&gt;CR as part of a VS 2008 project&lt;/h2&gt; &lt;p&gt;The version of CR distributed with Visual Studio 2008 is actually the same as the one distributed with Visual Studio 2005. So for that version, simply follow the instructions for that version.&lt;/p&gt; &lt;h2&gt;Building a redistributable package for VS 2005&lt;/h2&gt; &lt;p&gt;For applications built with Visual Studio 2005, it might also be a good idea to have a Runtime Package as a custom action or a pre-requisite in your setup. There are some reasons for this:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;In a network environment, these packages can be pushed by the network administrator  &lt;li&gt;The embedded merge modules force you to rebuild the setup for your applications if you want to take advantage of fixes or service packs  &lt;li&gt;The runtime package is not part of your setup and can be deployed once, rather than each time your application is installed.  &lt;li&gt;Since the setup it is significantly smaller when the merge modules are omitted, the download of your setup takes less time.  &lt;li&gt;Setup of your application is faster as it doesn&amp;#39;t have to install the merge modules.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;CR however does not provide redistributable packages for this version (or for Visual Studio 2002/2003) so I created one myself for use in my current project. For those interested, I followed this easy steps:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Once you have downloaded the merge modules for Visual Studio 2005, extract the file CrystalReports2005_x86 to the folder C:\Program Files\Common Files\Merge Modules  &lt;li&gt;Create a new Setup project and name it RedistCrystalReports2005_x86  &lt;li&gt;Right-click the project name in the solution explorer and select Add -&amp;gt; Merge Module...  &lt;li&gt;Select the merge module CrystalReports2005_x86.msm file from the dialog box  &lt;li&gt;Build the project&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;And you&amp;#39;re ready. A redistributable for CR reports to support the applications you build using Visual Studio 2005 and Visual Studio 2008.&lt;/p&gt; &lt;p&gt;I&amp;#39;m sure this can also be done for Visual Studio 2002/2003 but I have not been able to test that. But the steps would be similar, with the exception of license information which is required for these versions of Visual Studio.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=459001" width="1" height="1"&gt;</content><author><name>Jan Schreuder</name><uri>http://bloggingabout.net/members/Jan-Schreuder/default.aspx</uri></author><category term="Tools" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Tools/default.aspx" /><category term="General" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/General/default.aspx" /><category term="Crystal Reports" scheme="http://bloggingabout.net/blogs/jschreuder/archive/tags/Crystal+Reports/default.aspx" /></entry></feed>