<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C#</title>
        <link>http://weblogs.sqlteam.com/joew/category/270.aspx</link>
        <description>C# and .NET programming tips and tricks</description>
        <language>en-US</language>
        <copyright>Joe Webb</copyright>
        <managingEditor>joew@webbtechsolutions.com</managingEditor>
        <generator>Subtext Version 1.9.4.0</generator>
        <item>
            <title>Formatting strings</title>
            <link>http://weblogs.sqlteam.com/joew/archive/2008/03/12/60547.aspx</link>
            <description>I just completed teaching a Microsoft SQL Server Reporting Services class in Charlotte, North Carolina - a wonderful and beautiful place to visit! &lt;br /&gt;
&lt;br /&gt;
In a couple of the demonstrations, we used some predefined formatting strings to customize the way a user can see a value in a report. For example, we used C0 to display a currency value with no numbers to the right of a decimal point. &lt;br /&gt;
&lt;br /&gt;
One question that almost always comes up during the class is: where can I find a list of those predefined formatting strings? &lt;br /&gt;
&lt;br /&gt;
Microsoft has them on the MSDN Library site, but the are buried and rather difficult to find. So, I thought I'd share them with you here. These links are for v2.0 of the .NET Framework, however these pages include links to other versions including v1.1, v3.0, and v3.5 of the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/fbxft59x%28VS.80%29.aspx"&gt;Formatting Types&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/dwhawy9k(VS.80).aspx"&gt;Standard Numeric Format Strings&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/az4se3k1(VS.80).aspx"&gt;Standard DateTime Format Strings&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
Joe&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.sqlteam.com%2fjoew%2farchive%2f2008%2f03%2f12%2f60547.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.sqlteam.com%2fjoew%2farchive%2f2008%2f03%2f12%2f60547.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://weblogs.sqlteam.com/joew/aggbug/60547.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Webb</dc:creator>
            <guid>http://weblogs.sqlteam.com/joew/archive/2008/03/12/60547.aspx</guid>
            <pubDate>Wed, 12 Mar 2008 22:46:38 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/joew/comments/60547.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/joew/archive/2008/03/12/60547.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/joew/comments/commentRss/60547.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Copying and pasting rectangular blocks of code in Visual Studio and Management Studio</title>
            <link>http://weblogs.sqlteam.com/joew/archive/2007/11/06/60393.aspx</link>
            <description>&lt;p&gt;One of the things I really like about teaching technical classes is getting to know and talk with students, learning of the challenges they face and how they've addressed them. Frequently, I can learn from their experiences, too. So, it works out well for both student and instructor. &lt;/p&gt;
&lt;p&gt;In a custom Visual Studio/SQL Server class last week, I made a passing comment about Visual Studio being a very good text editor, but that it lacked one feature that I really like in other editors - block copy and paste. I lamented that the Visual Studio editor doesn't allow you to select a rectangular area of code and then copy and paste it elsewhere in the document. Other editors that I've used over the years - emacs, vim, Notepad++, UltraEdit - can do that. I would have thought that Microsoft would have put that in Visual Studio. &lt;/p&gt;
&lt;p&gt;It turns out that they did. One of my students showed me an old Microsoft Word trick. You can depress the Alt key while using the left mouse button to select rectangular areas of code. Pressing the Alt key tells the editor not to select the entire line, but to follow the mouse pointer wherever it goes. Then you can use normal techniques to copy the text and paste it wherever you'd like. &lt;/p&gt;
&lt;p&gt;&lt;a atomicselection="true" href="http://weblogs.sqlteam.com/images/weblogs_sqlteam_com/joew/WindowsLiveWriter/Copyingandpastingrectangularblocksofcode_60D8/blockcopy20071106.jpg"&gt;&lt;img width="240" height="119" border="0" src="http://weblogs.sqlteam.com/images/weblogs_sqlteam_com/joew/WindowsLiveWriter/Copyingandpastingrectangularblocksofcode_60D8/blockcopy20071106_thumb.jpg" alt="blockcopy20071106" style="border-width: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Why is this useful? Consider declaring a bunch of variables as show above. At a later point in your coding, you need to set the value of all of these variable. By copying the block you can quickly and easily paste only the relevant text (the variable names) into the procedure like so.&lt;/p&gt;
&lt;p&gt;&lt;a atomicselection="true" href="http://weblogs.sqlteam.com/images/weblogs_sqlteam_com/joew/WindowsLiveWriter/Copyingandpastingrectangularblocksofcode_60D8/blockcopyb20071106.jpg"&gt;&lt;img width="240" height="116" border="0" src="http://weblogs.sqlteam.com/images/weblogs_sqlteam_com/joew/WindowsLiveWriter/Copyingandpastingrectangularblocksofcode_60D8/blockcopyb20071106_thumb.jpg" alt="blockcopyb20071106" style="border-width: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Pretty nifty! Thanks, Ellen, for the tip!&lt;/p&gt;
&lt;p&gt;By the way, this technique works in the SQL Server Management Studio editor, too. &lt;/p&gt;
&lt;p&gt;&lt;a atomicselection="true" href="http://weblogs.sqlteam.com/images/weblogs_sqlteam_com/joew/WindowsLiveWriter/Copyingandpastingrectangularblocksofcode_60D8/blockcopyc20071106.jpg"&gt;&lt;img width="240" height="101" border="0" src="http://weblogs.sqlteam.com/images/weblogs_sqlteam_com/joew/WindowsLiveWriter/Copyingandpastingrectangularblocksofcode_60D8/blockcopyc20071106_thumb.jpg" alt="blockcopyc20071106" style="border-width: 0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Cheers! &lt;/p&gt;
&lt;p&gt;Joe&lt;/p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.sqlteam.com%2fjoew%2farchive%2f2007%2f11%2f06%2f60393.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.sqlteam.com%2fjoew%2farchive%2f2007%2f11%2f06%2f60393.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;
&lt;img src="http://weblogs.sqlteam.com/joew/aggbug/60393.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Joe Webb</dc:creator>
            <guid>http://weblogs.sqlteam.com/joew/archive/2007/11/06/60393.aspx</guid>
            <pubDate>Tue, 06 Nov 2007 13:45:36 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/joew/comments/60393.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/joew/archive/2007/11/06/60393.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/joew/comments/commentRss/60393.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>