<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Paul's MCS Developer Blog</title><link>http://blogs.msdn.com/b/paulwhit/</link><description>Sharing and blabbing on my findings as a Microsoft consultant</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>PDF View Components for Windows Store apps (WinRT) (XAML/C#)</title><link>http://blogs.msdn.com/b/paulwhit/archive/2013/02/15/pdf-view-components-for-windows-store-apps-winrt-xaml-c.aspx</link><pubDate>Fri, 15 Feb 2013 18:04:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10394078</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10394078</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2013/02/15/pdf-view-components-for-windows-store-apps-winrt-xaml-c.aspx#comments</comments><description>&lt;p&gt;There is no native C#/XAML PDF viewing component for Windows Store applications, but there are a growing number of options, and various apps have demonstrated success in different areas of PDF rasterization (converting PDF pages to images) and viewing. Here is a breakdown of all the components that I have seen. These are all expensive, so they might not work well for a hobbyist scenario. But if you have a need in your commercial or LOB application, you may find one of these to be useful.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.leadtools.com/sdk/winrt/default.htm"&gt;LEADTOOLS WinRT SDK&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.pdftron.com/pdfnet/mobile/windows8_winrt_pdf_library.html"&gt;PDFTron Mobile PDF SDK&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.foxitsoftware.com/products/sdk/embedded/winrt/"&gt;Foxit Embedded PDF SDK for Windows RT&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.componentone.com/SuperProducts/PdfViewerWinRT/"&gt;ComponentOne PdfViewer&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.tallcomponents.com/2012/10/rasterizing-pdf-on-winrt.html"&gt;TallComponents PDFRasterizer.NET 4.0 Beta&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;If you learn of others, please post a reply or send me a tweet &lt;a href="http://twitter.com/paulwhit"&gt;@paulwhit&lt;/a&gt;. I’m actively monitoring this topic.&lt;/p&gt;  &lt;p&gt;Also some developers appear to have ported &lt;a href="https://github.com/MishaUliutin/MuPDF.WinRT"&gt;MuPDF for use in Windows Store applications&lt;/a&gt;. I believe this is GPL licensed so you would either need to open source your project or buy a license, so use caution there.&lt;/p&gt;  &lt;p&gt;If you have the possibility to rasterize the images using a tool external to your Windows Store application, you can create a decent reader experience from a directory of images. Your users will take a bandwidth hit because downloading the rasterized contents can inflate the download size a lot, but at least you can provide the functionality. That is what I did with &lt;a href="http://apps.microsoft.com/windows/en-us/app/army-field-manuals/070c2943-c321-4cea-89d6-c70c3f5d7278/m/ROW"&gt;Army Field Manuals&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;In fact, I used GhostScript with a high resolution raster and then used ImageMagick to do an adaptive resize and convert to grayscale. This gave decent quality although some of the scanned pages are still too large due to scanner ghosting in the page background. I think I need to do something to increase the contrast on those particular documents. Anyway, here’s a rundown of the command line arguments I used with those tools in case you want to do something similar. &lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;gswin64c.exe -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r288 -o fm1_0/out_%d.png {pdffilename}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;convert {filename} -adaptive-resize 1224x1584 sm_{filename}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;mogrify -type grayscale {filename}&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10394078" width="1" height="1"&gt;</description></item><item><title>Unzipping files with a progress bar in Windows Store applications (XAML/C#)</title><link>http://blogs.msdn.com/b/paulwhit/archive/2013/01/24/unzipping-files-with-a-progress-bar-in-windows-store-applications-xaml-c.aspx</link><pubDate>Fri, 25 Jan 2013 00:30:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10388153</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10388153</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2013/01/24/unzipping-files-with-a-progress-bar-in-windows-store-applications-xaml-c.aspx#comments</comments><description>&lt;p&gt;Here’s a method for unzipping a Zip file in a Windows Store application. ZipArchive is part of System.IO.Compression.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; async Task UnzipWithProgress(StorageFolder outFolder, Stream zipFileStream, ProgressBar pb)
{
    &lt;span class="kwrd"&gt;bool&lt;/span&gt; bDelete = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

    &lt;span class="kwrd"&gt;using&lt;/span&gt; (var archive = &lt;span class="kwrd"&gt;new&lt;/span&gt; ZipArchive(zipFileStream))
    {
        &lt;span class="kwrd"&gt;try&lt;/span&gt;
        {
            &lt;span class="rem"&gt;// Ensure the UI update part runs in the UI thread&lt;/span&gt;
            var ignore = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =&amp;gt;
            {
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.tbDownloadStatus.Text = &lt;span class="str"&gt;&amp;quot;Unzipping&amp;quot;&lt;/span&gt;;
                pb.Value = 0;
                pb.Maximum = archive.Entries.Count;
            });

            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (ZipArchiveEntry entry &lt;span class="kwrd"&gt;in&lt;/span&gt; archive.Entries)
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (entry.Name != &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;)
                {
                    &lt;span class="kwrd"&gt;string&lt;/span&gt; fileName = entry.FullName.Replace(&lt;span class="str"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;, @&amp;quot;\&amp;quot;);
                    StorageFile newFile = await CreateFile(outFolder, fileName);
                    Stream newFileStream = await newFile.OpenStreamForWriteAsync();
                    Stream fileData = entry.Open();
                    &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] data = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[entry.Length];
                    &lt;span class="kwrd"&gt;int&lt;/span&gt; len = await fileData.ReadAsync(data, 0, data.Length);
                    &lt;span class="kwrd"&gt;while&lt;/span&gt; (len &amp;gt; 0)
                    {
                        await newFileStream.WriteAsync(data, 0, len);
                        len = await fileData.ReadAsync(data, 0, data.Length);
                    }
                    await newFileStream.FlushAsync();

                    var ignore2 = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =&amp;gt;
                    {
                        pb.Value++;
                    });
                }
            }

            var itemId = OriginalUriString;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.Frame.Navigate(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(ItemDetailPage), itemId);
        }
        &lt;span class="kwrd"&gt;catch&lt;/span&gt; (Exception ex)
        {
            bDelete = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        }
        &lt;span class="kwrd"&gt;finally&lt;/span&gt;
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (bDelete)
                outFolder.DeleteAsync();
        }
    }
}&lt;/pre&gt;


&lt;p&gt;To use it, call it this way. In my case I called it from the LoadState method.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;StorageFile file;
&lt;span class="kwrd"&gt;try&lt;/span&gt;
{
    file = await ApplicationData.Current.LocalFolder.GetFileAsync(OriginalUriString);
}
&lt;span class="kwrd"&gt;catch&lt;/span&gt; (FileNotFoundException)
{
    file = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
}

&lt;span class="kwrd"&gt;if&lt;/span&gt; (file != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
{
    &lt;span class="kwrd"&gt;using&lt;/span&gt; (var ws = await file.OpenReadAsync())
    &lt;span class="kwrd"&gt;using&lt;/span&gt; (var forReadRandomStream = ws.AsStreamForRead(0))
    {
        &lt;span class="kwrd"&gt;string&lt;/span&gt; path = ApplicationData.Current.LocalFolder.Path + &lt;span class="str"&gt;@&amp;quot;\&amp;quot; + Path.GetFileNameWithoutExtension(file.Name) + @&amp;quot;&lt;/span&gt;\&amp;quot;;
        await UnzipWithProgress(await StorageFolder.GetFolderFromPathAsync(path), forReadRandomStream, progressBar1);
    }
}&lt;/pre&gt;

&lt;p&gt;Apologize that this is not a File-&amp;gt;New demo, but I thought it might be useful and &lt;a href="http://www.hanselman.com/blog/YouAreNotYourCode.aspx"&gt;Scott Hanselman made me do it&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10388153" width="1" height="1"&gt;</description></item><item><title>Office 2013 release day questions</title><link>http://blogs.msdn.com/b/paulwhit/archive/2012/07/16/office-2013-release-day-questions.aspx</link><pubDate>Tue, 17 Jul 2012 02:13:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10330414</guid><dc:creator>paulwhit</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10330414</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2012/07/16/office-2013-release-day-questions.aspx#comments</comments><description>&lt;p&gt;So, being the good &lt;a href="http://en.wikipedia.org/wiki/Eat_one's_own_dog_food"&gt;dogfooder&lt;/a&gt; that I am, I'm posting this using Word 2013 on release day.
&lt;/p&gt;&lt;p&gt;Looks like this may be the future of Windows Live Writer (according to &lt;a href="http://www.liveside.net/2012/07/16/more-on-windows-live-writer-office-2013-and-reading-the-tea-leaves/"&gt;the tea leaves&lt;/a&gt;). It feels a lot like Writer initially. It can do a lot out of the box but I'll spare you the needless includes from Flickr and other locations. Although I don't see Insert-&amp;gt;Code, maybe cut and paste from Visual Studio is formatted well enough.
&lt;/p&gt;&lt;p&gt;Even though I'm a Microsoft employee, I haven't been privy to anything with this release—in fact, I don't think I was able to glean anything other than what's been posted online. I'm looking forward to learning more in the next few weeks and months. I'm particularly intrigued by the sync story with Skydrive and the investment in web versions of the apps. Also fascinating to think about is 3&lt;sup&gt;rd&lt;/sup&gt; party apps integrated with Office 365, Skydrive, and Office Web Apps. Looks like there's an Office store where folks can acquire these add-ons. 
&lt;/p&gt;&lt;p&gt;Here are a few questions that I have after an hour working with some of the release. There seems to be a cohesive connected-device picture coming together.
&lt;/p&gt;&lt;h3&gt;&lt;br/&gt;Word 2013 Questions
&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Will the sharing features (such as blog posting) be available in the web app?
&lt;/li&gt;&lt;li&gt;Will there be an RSS reader online to compete with Google Reader?
&lt;/li&gt;&lt;li&gt;Will real-time collaboration be backward compatible with Office 2010?
&lt;/li&gt;&lt;li&gt;How well does the PDF editor work?
&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;br/&gt;Outlook 2013 Questions
&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;I imported my Google Reader RSS feeds OPML file. Now, when I click on RSS Feeds, it goes to my Google Reader. Is this a fluke?
&lt;/li&gt;&lt;li&gt;Anything new in people merging? Will my merged contacts sync with the Metro Mail App and Windows Phone? It's a lot of work to redo these associations.
&lt;/li&gt;&lt;li&gt;I see you can add Facebook and LinkedIn social connectors. Where's Twitter?
&lt;/li&gt;&lt;li&gt;Are live tiles coming?
&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;br/&gt;OneNote 2013 Questions
&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Can OneNote edit PDFs like Word can?
&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;br/&gt;Other/Random
&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Why aren't we seeing the Metro style versions in this beta release?
&lt;/li&gt;&lt;li&gt;Any new authentication mechanisms planned for Skydrive (Facebook?)
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br/&gt;I'll probably figure some of this out, but if anyone has some of this information already, feel free to include it in the comments.
&lt;/p&gt;&lt;p&gt;Thanks!
&lt;/p&gt;&lt;p&gt;p.s. Man this thing posts a LOT faster than Writer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10330414" width="1" height="1"&gt;</description></item><item><title>Vietnam Wall for Windows Phone</title><link>http://blogs.msdn.com/b/paulwhit/archive/2012/06/12/vietnam-wall-for-windows-phone.aspx</link><pubDate>Wed, 13 Jun 2012 02:23:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10319147</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10319147</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2012/06/12/vietnam-wall-for-windows-phone.aspx#comments</comments><description>&lt;h3&gt;Choosing the Platform&lt;/h3&gt;  &lt;p&gt;I’d been looking into developing an app for Windows Phone since I picked up the Samsung Focus 18 months ago – to learn the technology and showcase what the platform can do. As a Microsoft employee, I feel tied to the platform, but also felt like it could be approachable since I am familiar with the language and some of the tools already. I also liked what I had heard about the &lt;a href="http://en.wikipedia.org/wiki/Mango_(WP7)#Windows_Phone_7.5"&gt;Windows Phone 7.5 update&lt;/a&gt; and wanted to try out some of the features. I recently finished a work project using WPF in which I picked up some XAML experience, so I felt energized about wrapping my head around the Silverlight-based development stack, and becoming a published app author.&lt;/p&gt;  &lt;h3&gt;Behind the Idea&lt;/h3&gt;  &lt;p&gt;So I set out to brainstorm ideas. I figured that good mobile app either has an interesting data set or an interesting algorithm, and is something that is useful away from your computer. I thought about places where you might go and need an app, and somehow remembered about a trip that my dad and I took to the &lt;a href="http://virtualwall.org/aboutwal.htm"&gt;Vietnam Veterans Memorial Wall&lt;/a&gt; in Washington, DC. While at the Wall, my dad tried to remember some of the folks he knew about who died in the war. We thumbed through some arcane books where the names were listed alphabetically and by hometown, and found one of the fallen GIs. But we had trouble finding others. Given that most of the soldiers, sailors, airmen, marines and coast guardsmen perished or were declared M.I.A. over 40 years ago, it seems like recall could be a problem worth trying to solve.&lt;/p&gt;  &lt;h3&gt;The Tiny Wall&lt;/h3&gt;  &lt;p&gt;So grew the idea of having a portable version of the Vietnam Wall database. I contacted multiple organizations that maintain the database of names behind the wall (there are a few parallel copies maintained by different organizations). There was a lot of interest. Even though the number of potential users is relatively small compared to iPhone or Android, the consensus was that the additional interest and exposure for the wall, and the memory of those listed on it, would justify the efforts. I chose to partner with the good folks at &lt;a href="http://virtualwall.org/"&gt;the Virtual Wall&lt;/a&gt;®, who tirelessly maintain a virtual memorial for each war casualty and M.I.A., and provide updates to their copy of the data. With their agreement to provide a regularly-updated dump of the wall names (surprisingly, even after 40 years, the data is updated monthly with dozens of changes), I agreed to develop the app free of charge and not include ads or solicit donations. The focus would be on providing a new way to search the database, and providing additional information about the wall to visitors including a link to The Virtual Wall®’s memorials.&lt;/p&gt;  &lt;p&gt;We decided on an initial set of features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Support searching the wall by First and Last Name&lt;/li&gt;    &lt;li&gt;Support searching by Home of Record (City/State/Country)&lt;/li&gt;    &lt;li&gt;Enable “sounds like” searching for names&lt;/li&gt;    &lt;li&gt;When searching by Home of Record, include nearby locations&lt;/li&gt;    &lt;li&gt;Indicate where on the wall the name is located&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;I chose some technical requirements in order to make the platform shine:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Use the Windows Phone embedded database included with Windows Phone 7.5&lt;/li&gt;    &lt;li&gt;Adhere to Metro design language principles as best as possible, and take design cues from others (related, make it look good)&lt;/li&gt;    &lt;li&gt;Learn and use the standard tools: Visual Studio, Windows Phone Tools, Expression Blend, various CodePlex projects&lt;/li&gt;    &lt;li&gt;Avoid common mistakes: slow scrolling list boxes, inconsistent fonts, ignoring user color choices     &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;The Published App&lt;/h3&gt;  &lt;p&gt;After about 200 hours of work, Vietnam Wall was published just after Memorial Day 2012. I was shooting for a release for that holiday, but it didn’t quite get approved in time. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/2502.MainPage_5F00_Black_5F00_280B8D3E.png"&gt;&lt;img title="MainPage_Black" style="border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="MainPage_Black" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/8358.MainPage_5F00_Black_5F00_thumb_5F00_20EEE177.png" width="148" height="241" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/2677.FindBy_5F00_55230ABD.png"&gt;&lt;img title="FindBy" style="display: inline; background-image: none;" border="0" alt="FindBy" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/6708.FindBy_5F00_thumb_5F00_7E2DA9B9.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/5635.ProfilePage_5F00_20190C3E.png"&gt;&lt;img title="ProfilePage" style="display: inline; background-image: none;" border="0" alt="ProfilePage" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/0435.ProfilePage_5F00_thumb_5F00_6FF1C17A.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/5710.SearchResults_5F00_4F6A81C8.png"&gt;&lt;img title="SearchResults" style="display: inline; background-image: none;" border="0" alt="SearchResults" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-07-metablogapi/6862.SearchResults_5F00_thumb_5F00_662C5A02.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.windowsphone.com/en-US/apps/0b758fa2-6414-4381-923e-557172cb3edc?wa=wsignin1.0" href="http://www.windowsphone.com/en-US/apps/0b758fa2-6414-4381-923e-557172cb3edc?wa=wsignin1.0"&gt;http://www.windowsphone.com/en-US/apps/0b758fa2-6414-4381-923e-557172cb3edc?wa=wsignin1.0&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Tools and Resources&lt;/h3&gt;  &lt;p&gt;Here is a collection of tools and resources I used in the process of creating the Vietnam Wall app. In retrospect, I’d say the tools are robust and capable, if you know where to look. In order to create a clean and compelling app, it’s necessary to be conscious about all your pixels. Vietnam Wall isn’t a perfect design by any means, but I think it looks clean and works well, thanks mostly to Scott Hanselman and Jeff Wilcox, as well as the other links I’ve shared below.&lt;/p&gt;  &lt;h4&gt;Essential Reading&lt;/h4&gt;  &lt;p&gt;These resources are key to getting started and knowing about the tools and processes to develop Windows Phone apps. Scott Hanselman’s volume is quite helpful, although after the 10th or so 6-hour session working on Vietnam Wall, I begin to curse his blog post’s title. Ha!&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.hanselman.com/blog/FromConceptToCodeIn6HoursShippingMyFirstWindowsPhoneApp.aspx"&gt;From Concept to Code in 6 hours: Shipping my first Windows Phone App&lt;/a&gt; by Scott Hanselman&lt;/li&gt;    &lt;li&gt;Charles Petzold’s free e-Book, &lt;a href="http://blogs.msdn.com/b/microsoft_press/archive/2010/10/28/free-ebook-programming-windows-phone-7-by-charles-petzold.aspx"&gt;Programming Windows Phone 7&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://forums.create.msdn.com/forums/t/93178.aspx"&gt;App Hub community forum’s “look here to find the resources that you need” post&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.infragistics.com/blogs/nick-landry/archive/2012/02/14/80-of-windows-phone-developers-not-using-the-free-tools.aspx"&gt;80% of Windows Phone Developers Not Using the Free Tools&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Database&lt;/h4&gt;  &lt;p&gt;I used a Mango Local database. Turns out it’s not quite SQL CE 3.5, and you have to create and populate it in a very specific way, by creating a Windows Phone app and using the emulator to pump the data in using LINQ-to-SQL, then copying it from local storage to your “real” app. It seems like a rather convoluted process, but it works OK. In the end, it’s nice to have full LINQ access to a data store and not have to distribute any libraries (since the SQLCE drivers are included in the Windows Phone 7.5 OS).&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.windowsphonegeek.com/tips/Windows-Phone-Mango-Local-Database(SQL-CE)-Introduction"&gt;Windows Phone Mango Local Database (SQL CE)&lt;/a&gt; by WindowsPhoneGeek (awesome series)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.a2zmenu.com/Blogs/LINQ/LINQ%20to%20SQL%20CompiledQuery.aspx"&gt;LINQ-to-SQL CompiledQuery&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb386913.aspx"&gt;MSDN: Query Examples (LINQ to SQL)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html"&gt;How to Migrate/Downsize a SQL Server database to SQL Server Compact 4.0 (and 3.5)&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Interface Controls&lt;/h4&gt;  &lt;p&gt;I used with Telerik RadControls. As a Microsoft employee, I was able to snag a free (normally $99) license. I was happy with their support and the tile, progress bar and animation helper controls (as part of their custom Root Application Frame) were slick. In particular, I like how transition animations work when paging away from the tile controls (see it in action in Vietnam Wall). I also used their Diagnostics and Picker controls, which I think saved some effort over the CodePlex versions.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://socialebola.wordpress.com/2011/01/29/omni-present-progress-bar-2/"&gt;Omni-present progress bar&lt;/a&gt; (template for Silverlight)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.windowsphonegeek.com/articles/wp7-longlistselector-in-depth--part2-data-binding-scenarios"&gt;WP7 LongListSelector in depth | Part2: Data binding scenarios&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.telerik.com/community/forums/windows-phone.aspx"&gt;Telerik Windows Phone 7 Controls Forums&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.telerik.com/help/windows-phone/wp7common-introduction.html"&gt;Telerik RadControls for Windows Phone documentation&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Design&lt;/h4&gt;  &lt;p&gt;I figure I spent 60% of my time getting this app to look decent. Jeff Wilcox’s design guides for developers were infinitely helpful here, and I set out to apply his guidance as best I could. I also thought the MSDN resources were decent.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/"&gt;Jeff Wilcox’s “Metro” design guide for developers, v1.00&lt;/a&gt; by Jeff Wilcox&lt;/li&gt;    &lt;li&gt;&lt;a title="A quick look at MetroRadio- quick spacing, margin, and icon tips for Windows Phone devs" href="http://www.jeff.wilcox.name/2012/01/metroradio-design/"&gt;A quick look at MetroRadio- quick spacing, margin, and icon tips for Windows Phone devs&lt;/a&gt; by Jeff Wilcox&lt;/li&gt;    &lt;li&gt;&lt;a title="MetroGridHelper- A helpful debugging assistant for designers and developers alike" href="http://www.jeff.wilcox.name/2011/10/metrogridhelper/"&gt;MetroGridHelper- A helpful debugging assistant for designers and developers alike&lt;/a&gt; by Jeff Wilcox&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.dotnetspeaks.com/DisplayArticle.aspx?ID=220"&gt;Windows Phone – Important Design Guidelines&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://fragiledevelopment.wordpress.com/2011/03/11/using-wp7-accent-color-effectively/"&gt;Using WP7 Accent Color Effectively&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hh202884(v=vs.92).aspx"&gt;MSDN: Essential Graphics, Visual Indicators and Notifications for Windows Phone&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hh202915(v=VS.92).aspx"&gt;MSDN: User Experience Design Guidelines for Windows Phone&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://cespage.com/silverlight/appbar.html"&gt;CESPage.com Windows Phone 7 Icons&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Conclusion&lt;/h3&gt;  &lt;p&gt;I had a pretty good experience developing my first app for Windows Phone. I bit off a fairly complex project (using a Local DB and providing some advanced search functionality), and ended up spending considerable time learning and applying the Metro design language and various Windows Phone design guidelines. I’d say the tools are fairly easy and good to work with (especially the Visual Studio/Blend pass-off), and the documentation is abundant and easy to find. Now that Vietnam Wall is out the door, developing additional apps will have a lot smaller learning curve.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10319147" width="1" height="1"&gt;</description></item><item><title>Goal setting at Microsoft</title><link>http://blogs.msdn.com/b/paulwhit/archive/2011/09/14/goal-setting-at-microsoft.aspx</link><pubDate>Wed, 14 Sep 2011 19:56:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10211171</guid><dc:creator>paulwhit</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10211171</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2011/09/14/goal-setting-at-microsoft.aspx#comments</comments><description>&lt;p&gt;When reading about how Microsoft does business, it&amp;rsquo;s quickly evident that we&amp;rsquo;re a metrics-driven organization. Even my wife, who works in strategic planning, mentioned that the instructor at a recent training class cited Steve Ballmer as a core example of someone who leads by scorecard.&lt;/p&gt;
&lt;p&gt;On the surface, one might think this would be frustrating. Feeling micromanaged, like your time revolves around the numbers. If the numbers became out of sync with business reality, or if they were unreasonable, I might feel this way. But Microsoft leadership seems to be responsive to changes and suggestions each year, and the process gets me regularly thinking about creating goals that help grow our business, increase my impact, and help others succeed (among other things).&lt;/p&gt;
&lt;p&gt;I work in a super competitive place. My compensation is partially awarded in the context of others in my pay grade, as well as the one above me. This means some very experienced, passionate, and intelligent people are vying for the same recognition that I am.&lt;/p&gt;
&lt;p&gt;So each year I sit down a few times with my manager to tweak my &amp;ldquo;&lt;a title="SMART" href="http://en.wikipedia.org/wiki/SMART_criteria"&gt;SMART&lt;/a&gt;&amp;rdquo; goals to help me stand out above my peers. In some ways, it&amp;rsquo;s a personal exercise rather than an organizational one. For instance, trying to figure out how to put a personal metric on increasing my exposure and influence is a little tough, and the output seems a little goofy. Statements about number of technical discussions outside my immediate team, for instance, represent my intention rather than a metric tied directly to business accomplishments. I think the point is more to consistently think about accomplishing the intention of goals, rather than the language itself.&lt;/p&gt;
&lt;p&gt;The process isn&amp;rsquo;t flawless, and some of the metrics that get assigned to me may not fit exactly with my work conditions. Also, the goals are not explicitly examined as if they were an exam, so some aggressive goals I set (such as a new MCITP or MCPD certification) get lost in the shuffle if I don&amp;rsquo;t highlight them specifically. But, generally speaking, goal setting at MCS is a motivational process and has helped lead me down an interesting path towards a more visible presence within my team and at my customers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10211171" width="1" height="1"&gt;</description></item><item><title>Career Inspiration at PASS Summit</title><link>http://blogs.msdn.com/b/paulwhit/archive/2010/11/11/career-inspiration-at-pass-summit.aspx</link><pubDate>Thu, 11 Nov 2010 21:29:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10089800</guid><dc:creator>paulwhit</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10089800</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2010/11/11/career-inspiration-at-pass-summit.aspx#comments</comments><description>&lt;p&gt;I’m at the &lt;a title="Professional Association for SQL Server" href="http://www.sqlpass.org/"&gt;Professional Association for SQL Server&lt;/a&gt; (PASS) Summit, an event that brings together a few thousand professionals that work with Microsoft’s SQL Server for technical training, inspiration and networking. &lt;/p&gt;  &lt;p&gt;My justification for attending was mostly technical: to fill some gaps and learn new skills, although I also expected to make new contacts and friends. I’ve done these things, but I also gained some unexpected insight. Namely, I was&lt;strong&gt; inspired to focus and document my career plans&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;This “aha” moment began with a “Birds of a Feather” lunch group. This type of lunch group at PASS involves choosing a lunch table assigned a topic. My choice was “Why you need to distinguish yourself from the rest,” a group facilitated by DBA and professional development guru Edwin Sarmiento (&lt;a href="http://twitter.com/#!/bassplayerdoc"&gt;@bassplayerdoc&lt;/a&gt;). We discussed the motivations to stand out, and the topic quickly shifted to figuring out how to stand out. We had great discussions about how to change perceptions that others have of you, and how to do some personal branding in order to be recognized for your work.&lt;/p&gt;  &lt;p&gt;I attended some great technical presentations, and although all the presenters have impressive backgrounds, two presenters stood out to me as role models for interesting careers and deep focus: Stacia Misner (&lt;a href="http://twitter.com/#!/StaciaMisner"&gt;@staciamisner&lt;/a&gt;) and Joy Mundy. They both have an intense passion and deep focus on the Business Intelligence stack and many years of experience. &lt;/p&gt;  &lt;p&gt;Finally, Andy Warren (&lt;a href="http://twitter.com/#!/sqlandy"&gt;@sqlandy&lt;/a&gt;) presented on developing a Professional Development Plan. In the talk, he outlined the need to discover and document the resources you plan to use to better your career, and described how to create a written plan. This was excellent and is something I have started working on. Importantly, he made points about balance and avoiding burn-out, and I plan to use this to develop insights into my own development plan.&lt;/p&gt;  &lt;p&gt;My head is swimming in new thoughts and ideas, and I’m working to develop a story for my next 5-10 years. I have some role models to keep tabs on and some tools to help me move forward. Thanks PASS!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10089800" width="1" height="1"&gt;</description></item><item><title>Next steps in learning as a professional consultant</title><link>http://blogs.msdn.com/b/paulwhit/archive/2010/06/22/next-steps-in-learning-as-a-professional-consultant.aspx</link><pubDate>Tue, 22 Jun 2010 23:05:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10028760</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=10028760</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2010/06/22/next-steps-in-learning-as-a-professional-consultant.aspx#comments</comments><description>&lt;p&gt;I’ve decided to pursue a &lt;a href="http://ischool.umd.edu/programs/mim.shtml"&gt;Master of Information Management (MIM) program&lt;/a&gt; from University of Maryland. &lt;/p&gt;  &lt;p&gt;As a consultant for Microsoft, I am required to become an expert on technologies as they emerge. Since I work with customers that are sometimes slow to adopt technologies, I need to ramp up on older technologies as well. Continuously learning multiple generations of technology can be a fun challenge, although sometimes daunting!&lt;/p&gt;  &lt;p&gt;Microsoft provides me with amazing tools to stay fresh. MCS allows for 4 weeks of paid training per year, and every 18 months, I attend TechReady, a week-long training in Seattle. I also have free access to everything Microsoft Learning and Microsoft Press creates. I try to take full advantage of these tools and always add certification exams to my yearly commitments in order to keep myself on track.&lt;/p&gt;  &lt;p&gt;With all the need for me to learn technologies, there seems to be little time to cycle back to foundational knowledge that can help me make broader decisions, and help customers make more impactful technology choices that are led by business needs. &lt;/p&gt;  &lt;p&gt;In the next 5 years, my impact will increase. I’ve made my technology skills and aptitude for running with new technology challenges evident on every project I’ve been assigned to, and I plan to continue to do so.&lt;/p&gt;  &lt;p&gt;With the knowledge I gain from MIM program as well as my growing impact on the job, I am hoping to position myself to more fully affect change at a higher level. &lt;/p&gt;  &lt;p&gt;In the next 5 years, I hope to shift from the “tactical” impact of designing and implementing specific systems to the world of “strategic” thinking, and I think this degree program will help me get to that point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10028760" width="1" height="1"&gt;</description></item><item><title>Recent Microsoft certification exams as a differentiator</title><link>http://blogs.msdn.com/b/paulwhit/archive/2009/07/06/recent-microsoft-certification-exams-as-a-differentiator.aspx</link><pubDate>Mon, 06 Jul 2009 23:12:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820900</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=9820900</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2009/07/06/recent-microsoft-certification-exams-as-a-differentiator.aspx#comments</comments><description>&lt;p&gt;I’m coming off of a stint of a few exams in a row to earn my Microsoft Certified Professional Developer (MCPD) credentials for ASP.NET 3.5, which I obtained last week!&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="477"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="70"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="405"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/MicrosoftCertificationexamsasspecializat_10882/MCPD(rgb)_1259_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="MCPD(rgb)_1259" border="0" alt="MCPD(rgb)_1259" src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/MicrosoftCertificationexamsasspecializat_10882/MCPD(rgb)_1259_thumb.png" width="267" height="80" /&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;In the past year, I have also passed a few Microsoft Certified Technical Specialist (MCTS) exams for SharePoint, and today I failed (eep!) the &lt;a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=MB2-634&amp;amp;locale=en-us"&gt;MB2-634 CRM 4.0 Extending Microsoft Dynamics&lt;/a&gt; exam (but plan to re-take it).&lt;/p&gt;  &lt;p&gt;Throughout this experience I’ve been considering the impact having these “titles” might have on my employer’s confidence in me and how I’m presented to customers. I refer to the certifications as titles because they’re often displayed in email signatures, including mine.&lt;/p&gt;  &lt;p&gt;In my limited experience as an interviewer (I’ve interviewed a dozen or so candidates for various positions within and outside of Microsoft), I have found that the old certifications weren’t terribly useful as a distinguisher. Most of the senior-level candidates had a pile of them (MCSD, MCAD, MCDBA, etc), and they were usually old versions of tests that showed they took a bunch of tests at some point in their career. It was nice to be able to fill in the certification check box, but didn’t always indicate relevant exposure or experience.&lt;/p&gt;  &lt;p&gt;Things are slightly different for me now that there are more clearly versioned exams (such as the ASP.NET Developer 3.5 or SQL Server 2008 exams), and I feel that the titles can be helpful to distinguish developers on a few factors:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Active in Microsoft Learning community&lt;/strong&gt;       &lt;br /&gt;      &lt;br /&gt;With the version-specific exams, I think the most obvious and clear conclusion about someone who takes newer exams is that they make a conscious and committed effort to Microsoft training. Everyone committed to a career that touches Microsoft software (or any other vendor for that matter) may want to pay attention to what the company itself feels is important to learn.       &lt;br /&gt;      &lt;br /&gt;While the learning community is a clear marketing tool for Microsoft to push earlier adoption and drive product sales, it also serves the purpose of producing better Microsoft developers.       &lt;br /&gt;      &lt;br /&gt;In interviews, I usually ask what resources candidates use to keep up on the latest happenings. I like to hear things like blogs, newsgroups, and email distribution lists. Being conscientious of what Microsoft itself pushes out for training shows an additional level of commitment.       &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Up-to-speed on the latest technologies, to some extent        &lt;br /&gt;&lt;/strong&gt;      &lt;br /&gt;I feel strongly that Microsoft focuses its exams on showing the power of its technologies, and mentioning common pain points.       &lt;br /&gt;      &lt;br /&gt;Especially with the developer exams, it’s clearly in Microsoft’s best interest to point out gaps and have developers make the best use of its technologies. If ISVs and business application developers can make Microsoft technologies scream, the company will sell more software.       &lt;br /&gt;      &lt;br /&gt;There are limitations to what can be gleaned from a certification list, of course. In my experience it’s helpful to take practice tests to pass exams, but these sometimes seem to promote memorization of question types rather than actual learning. In the end, though, I’ve always learned valuable lessons from the exams and at least have been exposed to much of the power and pain points of the various technologies covered by the tests.       &lt;br /&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Has specialized or broad knowledge        &lt;br /&gt;&lt;/strong&gt;      &lt;br /&gt;It seems like the impetus of changes to the title structure for exams in the past few years is to help people indicate what they’ve focused on.       &lt;br /&gt;      &lt;br /&gt;Although I’ve not yet realized the impact of my own certifications, I consider it a bonus for my marketability as a consultant to list the titles on my email signature and on my internal résumé. I think it will help the partners and customers I work with to see my focus areas, and help my management to allocate me appropriately in the future.       &lt;br /&gt;      &lt;br /&gt;Additionally, I want to indicate that I’m focused on being knowledgeable in a variety of areas, so I will continue to take exams in .NET development, SQL Server, SharePoint, CRM, and any other technology that I feel will help me solve customer problems in a more effective manner. I’m hoping my employer will see this commitment and allow me to grow into a more senior role as a consultant and/or architect. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There’s no doubt that Microsoft benefits monetarily when people become certified. Passing active and recent exams helps developers and allows employers to distinguish ones who stay current. It’s not a foolproof method, since passing an exam doesn’t always indicate practical knowledge or experience, but the titles can effectively communicate commitment to learning and staying current. &lt;/p&gt;   &lt;font color="#808080" size="1"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;Disclosure: I work for Microsoft. I get exams, study materials, and practice tests for Microsoft exams for free. I also have access to free exam prep classes (schedule and budget permitting) at internal training events (such as TechReady, an internal training conference) and instructor-led training. However, I still have the same test standards as everyone else and no insight into exam answers.&lt;/font&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820900" width="1" height="1"&gt;</description></item><item><title>Walkthrough: Quick Start with SharePoint Web Services</title><link>http://blogs.msdn.com/b/paulwhit/archive/2009/04/08/walkthrough-quick-start-with-sharepoint-web-services.aspx</link><pubDate>Wed, 08 Apr 2009 11:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9537715</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=9537715</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2009/04/08/walkthrough-quick-start-with-sharepoint-web-services.aspx#comments</comments><description>
&lt;STYLE&gt;
&lt;!--
abbr { text-decoration:none; border-bottom: 1px dotted #9F7C54; }
//--&gt;&lt;/STYLE&gt;

&lt;P&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Integrating external applications with SharePoint data and functionality is pretty easy, but the documentation is scattered, so I thought it might be helpful to provide a complete solution that covers a few main scenarios.&lt;/P&gt;
&lt;P&gt;I’ve used the SharePoint web services to provide a custom search interface and to populate lookup tables. I’ve also seen it used as a workaround in a few scenarios where the SharePoint Object Model was behaving erratically.&lt;/P&gt;
&lt;P&gt;This post will focus on how to quickly get started with the web services interface in &lt;ABBR title="Windows SharePoint Services"&gt;WSS&lt;/ABBR&gt;, and particularly how to access SharePoint data and search results quickly, in a new project. It’s not very polished, but it gets the job done.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Does this apply to me?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;First, when communicating with &lt;ABBR title="Windows SharePoint Services"&gt;WSS&lt;/ABBR&gt; and &lt;ABBR title="Microsoft Office SharePoint Server"&gt;MOSS&lt;/ABBR&gt;, you have to &lt;STRONG&gt;decide which remote access tool best fits your needs&lt;/STRONG&gt;.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The SharePoint Object Model (i.e. from the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=05E0DD12-8394-402B-8936-A07FE8AFAFFD&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=05E0DD12-8394-402B-8936-A07FE8AFAFFD&amp;amp;displaylang=en"&gt;WSS SDK&lt;/A&gt;) is great when your application is written in .NET and is deployed to a server running MOSS or WSS, &lt;/LI&gt;
&lt;LI&gt;&lt;ABBR title="Remote Procedure Call"&gt;RPC&lt;/ABBR&gt; over &lt;ABBR title="HyperText Transfer Protocol"&gt;HTTP&lt;/ABBR&gt; is apparently good for large file uploads, &lt;/LI&gt;
&lt;LI&gt;WebDAV allows for browsing via Windows Explorer and drive mapping, and &lt;/LI&gt;
&lt;LI&gt;The web services interface is best when you need a connection that doesn’t depend on the WSS/MOSS SDK, when you need to connect from outside .NET code (such as &lt;A href="http://spjslib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22639" mce_href="http://spjslib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22639"&gt;via JavaScript&lt;/A&gt;). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As Alvin Bruney points out in his book &lt;CITE&gt;Programming Excel Services&lt;/CITE&gt; (&lt;A href="http://proquestcombo.safaribooksonline.com/9780735624078" mce_href="http://proquestcombo.safaribooksonline.com/9780735624078"&gt;Safari&lt;/A&gt;), the web services interface is also “a way to access the resources of the server with reduced risk of instability to the server resources.”&lt;/P&gt;
&lt;P&gt;Secondly, &lt;STRONG&gt;figure out if you need to do this from scratch&lt;/STRONG&gt; at all.&lt;/P&gt;
&lt;P align=left&gt;Check into &lt;A href="http://www.codeplex.com/LINQtoSharePoint" mce_href="http://www.codeplex.com/LINQtoSharePoint"&gt;LINQ to SharePoint&lt;/A&gt;, which can use either the SharePoint Object model or the web services interface. It looks like a really slick and robust way to interface with your existing SharePoint data. On the down side, it appears to not have been updated since November 2007 and Bart De Smet, the project’s author (&lt;A href="http://community.bartdesmet.net/blogs/bart/Default.aspx" target=_blank mce_href="http://community.bartdesmet.net/blogs/bart/Default.aspx"&gt;blog&lt;/A&gt;), notes that it is an alpha release and not ready for production. I’ve steered clear of it for that reason and due to client restrictions, but you might save yourself a lot of time if you can use it! &lt;/P&gt;
&lt;P align=left&gt;Check out this video, from the project’s CodePlex page, for a good quick start:&lt;/P&gt;
&lt;P align=center&gt;&amp;nbsp;&lt;A title="LINQ to SharePoint quick start video (5:37, 3.18MB, WMV)" href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022" target=_blank mce_href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=linq2sharepoint-video-thumbnail border=0 alt=linq2sharepoint-video-thumbnail src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/QuickstartwithSharePointWebServices_11870/linq2sharepoint-video-thumbnail_6.jpg" width=302 height=228 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/QuickstartwithSharePointWebServices_11870/linq2sharepoint-video-thumbnail_6.jpg"&gt;&lt;/A&gt; &lt;BR&gt;LINQ to SharePoint quick start &lt;A href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022" mce_href="http://linqtosharepoint.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=11022"&gt;video&lt;/A&gt; (5:37, 3.18MB, WMV)&lt;/P&gt;
&lt;P&gt;If you decide against LINQ to SharePoint, you can still easily add web references and consume the SharePoint web services in your custom code.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Walkthrough: Accessing List data&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;As it turns out, the web host for &lt;A href="http://handsondc.org/" target=_blank mce_href="http://handsondc.org"&gt;Hands on DC&lt;/A&gt; (a volunteer organization with which I work) does some hokey things with NTLM authentication that aren’t supported by &lt;ABBR title="Windows Communication Foundation"&gt;WCF&lt;/ABBR&gt;. Namely, it seems like they’re doing Transport level authentication over plaintext HTTP instead of HTTP over SSL. I can see why this isn’t supported, for security reasons. Despite Dan Rigby’s &lt;A href="http://www.danrigsby.com/blog/index.php/2008/04/17/impersonate-a-clients-identity-in-wcf/#high_1" target=_blank mce_href="http://www.danrigsby.com/blog/index.php/2008/04/17/impersonate-a-clients-identity-in-wcf/#high_1"&gt;excellent post about impersonation in WCF&lt;/A&gt;, I couldn’t get anything to work.&lt;/P&gt;
&lt;P&gt;But alas, with no slight of hand whatsoever, the scenario works in VS2005 and a regular old-school ASMX-based web service proxy (web reference). Here’s a quick (and quite dirty) example, initially based on Ishai Sagi’s (&lt;A href="http://www.sharepoint-tips.com/" target=_blank mce_href="http://www.sharepoint-tips.com/"&gt;blog&lt;/A&gt;) &lt;A href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd/" target=_blank mce_href="http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0d114020-9f87-480d-bead-417b723ab0cd/"&gt;response on MSDN&lt;/A&gt;: &lt;/P&gt;
&lt;P align=center&gt;Video hint: Click the full screen icon (looks like a TV) &lt;BR&gt;&lt;BR&gt;&lt;EMBED height=289 type=application/x-shockwave-flash width=459 src=http://blip.tv/play/AfjwYZXTNQ allowfullscreen="true" allowscriptaccess="always" mce_src="http://blip.tv/play/AfjwYZXTNQ"&gt;&lt;/EMBED&gt; &lt;BR&gt;&lt;A href="http://paulw.us/TestWS_publish.zip" target=_blank mce_href="http://paulw.us/TestWS_publish.zip"&gt;Download source code&lt;/A&gt; (39KB, ZIP file)&lt;/P&gt;
&lt;P&gt;The query that we send to the list service is written in &lt;ABBR title="Collaborative Application Markup Language"&gt;CAML&lt;/ABBR&gt;. When we want to get more complex in our query, such as only pulling back certain columns, check out the &lt;A href="http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx" target=_blank mce_href="http://www.u2u.net/res/Tools/CamlQueryBuilder.aspx"&gt;U2U CAML Query Builder&lt;/A&gt;. It provides an awesome interface into creating your CAML queries.&lt;/P&gt;
&lt;P&gt;In the WCF world, Kirk Evans has an awesome walkthrough, &lt;A href="http://blogs.msdn.com/kaevans/archive/2009/03/10/calling-sharepoint-lists-web-service-using-wcf.aspx" target=_blank mce_href="http://blogs.msdn.com/kaevans/archive/2009/03/10/calling-sharepoint-lists-web-service-using-wcf.aspx"&gt;Calling SharePoint Lists Web Service using WCF&lt;/A&gt;, which includes how to streamline the XML access by using an XPathNavigator, and later using a DataTable that reads from an XmlNodeReader. Better than querying the fields directly for sure!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Walkthrough: Querying WSS Search Results&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Search is a little more challenging. As is the case with every other web service, we send the query service XML, and it returns XML. We can take a shortcut and generate the request XML with a tool such as the &lt;A href="http://www.mosssearch.com/searchwebservice.html" target=_blank&gt;Search Query Web Service Test Tool for MOSS&lt;/A&gt; (or we could also import the schema and generate a C# class from it).&lt;/P&gt;
&lt;P&gt;Since I’m a big fan of &lt;A href="http://quickstart.developerfusion.co.uk/quickstart/howto/doc/xmlserialization/XSDToCls.aspx" target=_blank mce_href="http://quickstart.developerfusion.co.uk/quickstart/howto/doc/xmlserialization/XSDToCls.aspx"&gt;using XSD.EXE to generate a C# class&lt;/A&gt;, I chose to do so with the search result support classes. It was mostly productive, although the Results node is free-form (can take any node type) and the generator doesn’t seem to support that. In the end, we can use the generated classes to get statistics about the data set, and can navigate the Documents using regular XML methods. &lt;/P&gt;
&lt;P&gt;Here is a complete walkthrough of adding very basic search results, including a total result count and the first page of results, to our application:&lt;/P&gt;
&lt;P align=center&gt;Video hint: Click the full screen icon (looks like a TV) &lt;BR&gt;&lt;BR&gt;&lt;EMBED height=289 type=application/x-shockwave-flash width=459 src=http://blip.tv/play/Afj2bpXTNQ allowfullscreen="true" allowscriptaccess="always" mce_src="http://blip.tv/play/Afj2bpXTNQ"&gt;&lt;/EMBED&gt; &lt;BR&gt;&lt;A href="http://paulw.us/TestWS_publish_2.zip" target=_blank mce_href="http://paulw.us/TestWS_publish_2.zip"&gt;Download source code&lt;/A&gt; (56KB, ZIP file)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Use SharePoint web services when you have the need to separate concerns and reduce risk inherent with new code deployments to the SharePoint farm, you want remote access to SharePoint from a non-SharePoint server, or you need to access SharePoint from something other than .NET (such as JavaScript).&lt;/P&gt;
&lt;P&gt;This post and associated videos walked you through creating a Windows Forms application, from scratch, that pulls data in from SharePoint, including List-based data and search results. The process is similar to any other web service, but there are a few gotchas and pain points that I hope have been cleared up in this resource.&lt;/P&gt;
&lt;P&gt;I collected some additional links in the process of putting this post together, and added them on delicious with the tag “&lt;A href="http://delicious.com/paulwhit/sharepoint-webservices" target=_blank mce_href="http://delicious.com/paulwhit/sharepoint-webservices"&gt;sharepoint-webservices&lt;/A&gt;”.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9537715" width="1" height="1"&gt;</description></item><item><title>Walkthrough: full example of using MvcContrib grid with jQuery datatable</title><link>http://blogs.msdn.com/b/paulwhit/archive/2009/03/28/walkthrough-full-example-of-using-mvccontrib-grid-with-jquery-datatable.aspx</link><pubDate>Sun, 29 Mar 2009 06:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9516639</guid><dc:creator>paulwhit</dc:creator><slash:comments>22</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=9516639</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2009/03/28/walkthrough-full-example-of-using-mvccontrib-grid-with-jquery-datatable.aspx#comments</comments><description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Note: This walkthrough is based on the 1.0 release of ASP.NET MVC, MvcContrib version 1.0.0.916 with a &lt;A href="http://mvccontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4134" mce_href="http://mvccontrib.codeplex.com/WorkItem/View.aspx?WorkItemId=4134"&gt;minor code change&lt;/A&gt;, jQuery 1.2.6 (included in the MVC release) and &lt;A href="http://www.sprymedia.co.uk/article/DataTables" mce_href="http://www.sprymedia.co.uk/article/DataTables"&gt;jQuery datatables 1.4&lt;/A&gt;. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For the past few months (and 100+ volunteer hours!) I’ve been creating a web application for &lt;A href="http://handsondc.org/" mce_href="http://handsondc.org"&gt;Hands on DC&lt;/A&gt; that calculates volunteers, gallons of paint, and materials for work projects for their annual &lt;A href="http://handsondc.kintera.org/faf/home/default.asp?ievent=297211" mce_href="http://handsondc.kintera.org/faf/home/default.asp?ievent=297211"&gt;Work-a-Thon event&lt;/A&gt;. After the encouragement of a few coworkers who did some initial work on the project, I committed to using &lt;A href="http://www.asp.net/mvc/" mce_href="http://www.asp.net/mvc/"&gt;ASP.NET MVC&lt;/A&gt;, technology which has been out over a year but just reached a production 1.0 &lt;A href="http://haacked.com/archive/2009/03/18/aspnet-mvc-rtw.aspx" mce_href="http://haacked.com/archive/2009/03/18/aspnet-mvc-rtw.aspx"&gt;release at Mix 09&lt;/A&gt; this year. &lt;/P&gt;
&lt;P&gt;Getting up and running with MVC wasn’t an easy task. The project was also my first foray into LINQ to SQL, and really .NET 3.5 in general, so it was a little intimidating at first! There’s not much documentation and it’s split across the many release versions of MVC. The main site will get you up doing very basic things (but is seriously lacking content), though Phil Haack’s &lt;A href="http://channel9.msdn.com/pdc2008/PC21/" mce_href="http://channel9.msdn.com/pdc2008/PC21/"&gt;webcast&lt;/A&gt; and Scott Hanselman, et. al.’s &lt;A href="http://www.hanselman.com/blog/FreeASPNETMVCEBookNerdDinnercomWalkthrough.aspx" mce_href="http://www.hanselman.com/blog/FreeASPNETMVCEBookNerdDinnercomWalkthrough.aspx"&gt;free e-Book&lt;/A&gt; are helpful.&lt;/P&gt;
&lt;P&gt;In the process, I discovered some important companion pieces in &lt;A href="http://www.codeplex.com/MVCContrib" mce_href="http://www.codeplex.com/MVCContrib"&gt;MvcContrib&lt;/A&gt; and jQuery, including the &lt;A href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" mce_href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/"&gt;validation plugin&lt;/A&gt; and the &lt;A href="http://www.sprymedia.co.uk/article/DataTables" mce_href="http://www.sprymedia.co.uk/article/DataTables"&gt;datatable plugin&lt;/A&gt;. I want to highlight work that I did to combine the MvcContrib data grid with the datatable for sorting, paging and filtering. This was something I struggled with for several hours, so I’m hoping there is some value in posting the full example.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=projects border=0 alt=projects src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/projects_3.png" width=402 height=202 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/projects_3.png"&gt;Figure 1. Example of using MvcContrib with jQuery datatable plugin. &lt;/P&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Walkthrough&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Here is a complete from-scratch example. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a new ASP.NET MVC Web Application. Press F5 to make sure it runs. &lt;/LI&gt;
&lt;LI&gt;Drag and drop the “media” folder from the datatable project directory (where you unzipped the project) into the new Solution, like so: &lt;/LI&gt;&lt;/UL&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=datatable-media border=0 alt=datatable-media src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_thumb.png" width=214 height=329 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/datatable-media_thumb.png"&gt;&lt;/A&gt; Figure 2. Solution after copying the datatable media folder. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Add a reference to the MvcContrib.dll. &lt;/LI&gt;
&lt;LI&gt;Open the Views/Home/Index.aspx file and add the following under the page directive: &lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%@ Import Namespace="MvcContrib.UI.Grid" %&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%@ Import Namespace="MvcContrib.UI.Grid.ActionSyntax" %&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;Open the Views/Shared/Site.Master file and add references to jquery, jquery.dataTables and the demos.css file, like so: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %&amp;gt;&lt;/SPAN&gt; 

&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;html&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"http://www.w3.org/1999/xhtml"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;runat&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"server"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #c71585"&gt;asp&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #800000"&gt;ContentPlaceHolder&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;ID&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"TitleContent"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;runat&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"server"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;link&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../Content/Site.css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;rel&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"stylesheet"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;link&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../media/css/demos.css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;rel&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"stylesheet"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/css"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;src&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../media/js/jquery.js"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/javascript"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;src&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"../../media/js/jquery.dataTables.js"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/javascript"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Now set up some dummy data in the HomeController.cs file like so (add to the body of the class): &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;enum&lt;/SPAN&gt; Medal
{
    Gold,
    Silver,
    Bronze
}

&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; MedalWinner
{
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Location { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Year { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Sport { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; Medal Medal { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Country { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; Name { &lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;; }

    &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; MedalWinner(&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; l, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; y, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; s, Medal m, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; c, &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; n)
    {
        Location = l;
        Year = y;
        Sport = s;
        Medal = m;
        Country = c;
        Name = n;
    }
}

&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; ActionResult Index()
{
    ViewData["&lt;SPAN style="COLOR: #8b0000"&gt;Message&lt;/SPAN&gt;"] = "&lt;SPAN style="COLOR: #8b0000"&gt;Welcome to ASP.NET MVC!&lt;/SPAN&gt;";

    var medalWinners = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; List&amp;lt;MedalWinner&amp;gt;();
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Gold, "&lt;SPAN style="COLOR: #8b0000"&gt;Croatia&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;LOSERT, Veni&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Gold, "&lt;SPAN style="COLOR: #8b0000"&gt;Croatia&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;BALIC, Ivano&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Gold, "&lt;SPAN style="COLOR: #8b0000"&gt;Croatia&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;ZRNIC, Vedran&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Silver, "&lt;SPAN style="COLOR: #8b0000"&gt;Germany&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;JANSEN, Torsten&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Silver, "&lt;SPAN style="COLOR: #8b0000"&gt;Germany&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;KRETZSCHMAR, Stefan&lt;/SPAN&gt;"));
    medalWinners.Add(
        &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MedalWinner("&lt;SPAN style="COLOR: #8b0000"&gt;Athens&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;2004&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;Handball&lt;/SPAN&gt;",
            Medal.Silver, "&lt;SPAN style="COLOR: #8b0000"&gt;Germany&lt;/SPAN&gt;", "&lt;SPAN style="COLOR: #8b0000"&gt;VON BEHREN, Frank &lt;/SPAN&gt;"));

    ViewData["&lt;SPAN style="COLOR: #8b0000"&gt;MedalWinners&lt;/SPAN&gt;"] = medalWinners;

    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; View();
}&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp; Now we have some data to work with. In the view (ViewData[“MedalWinners”]). Test that theory by adding the following code to the “indexContent” content block in Views/Home/Index.aspx: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;ol&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; foreach (HomeController.MedalWinner winner 
       in (List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"] )
{ &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;li&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= winner.Name &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;, &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= winner.Country &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;li&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; } &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;ol&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;You should see output like this: &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners1 border=0 alt=medalwinners1 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_thumb.png" width=402 height=214 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners1_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Assuming that worked, we’re ready to do some grid work! Once you get the basic syntax, the MvcContrib grid makes display a cinch. This is the “action syntax” so make sure your imports are right (shown at the top of the walkthrough. &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; Html.Grid((List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"])
       .Columns(column =&amp;gt;
       {
           column.For(c =&amp;gt; c.Year);
           column.For(c =&amp;gt; c.Location);
           column.For(c =&amp;gt; c.Name);
           column.For(c =&amp;gt; c.Country);
           column.For(c =&amp;gt; c.Medal.ToString());
           column.For(c =&amp;gt; c.Sport);
       }).Render();
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Run the application; you should see output like so: &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners2 border=0 alt=medalwinners2 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_thumb.png" width=402 height=262 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners2_thumb.png"&gt;&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;That’s pretty easy, but not terribly useful yet. For fun, let’s add a Live search on the name field so we can see who these athletes are. The “Action Syntax” makes it simple to do powerful clean custom code for each cell. Pretty slick! Note that you need to specify the table cell tags or you’ll get messed up output. &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; Html.Grid((List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"])
       .Columns(column =&amp;gt;
       {
           column.For(c =&amp;gt; c.Year);
           column.For(c =&amp;gt; c.Location);
           column.For(c =&amp;gt; c.Name).Named("Athlete Name").Action(a =&amp;gt; {&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=
               &lt;SPAN style="COLOR: #0000ff"&gt;"http://search.live.com/results.aspx?q=&amp;lt;%= HttpUtility.UrlEncode(a.Name) %&amp;gt;&amp;amp;form=QBLH"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= HttpUtility.HtmlEncode(a.Name) &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
           &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;
           });
           column.For(c =&amp;gt; c.Country);
           column.For(c =&amp;gt; c.Medal.ToString());
           column.For(c =&amp;gt; c.Sport);
       }).Render();
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;So now our output name is linked to a Live Search. &lt;/LI&gt;
&lt;LI&gt;Now we’re ready to incorporate the jquery datatable stuff. If you see in the directory that you unzipped the datatable project to, there is an “eaxmple_zero_config.html” file. Let’s steal the code from the top of that. &lt;BR&gt;&lt;BR&gt;In order to get this to work, we need to add an id attribute to the grid, as is shown below. &lt;BR&gt;&lt;BR&gt;Let’s also style it a little by putting it in a container. Otherwise the search box doesn’t align with the table and looks a little wonky: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"text/javascript"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;charset&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"utf-8"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    $(document).ready(function() {
        $('#example').dataTable();
    });
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
#example { width: 100%; }
#container { width: 600px; }
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
    
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;div&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;id&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #0000ff"&gt;"container"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt; Html.Grid((List&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;HomeController.MedalWinner&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;)ViewData["MedalWinners"])
       .Columns(column =&amp;gt;
       {
           column.For(c =&amp;gt; c.Year);
           column.For(c =&amp;gt; c.Location);
           column.For(c =&amp;gt; c.Name).Named("Athlete Name").Action(a =&amp;gt; {&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt; &lt;SPAN style="COLOR: #ff0000"&gt;href&lt;/SPAN&gt;=
               &lt;SPAN style="COLOR: #0000ff"&gt;"http://search.live.com/results.aspx?q=&amp;lt;%= HttpUtility.UrlEncode(a.Name) %&amp;gt;&amp;amp;form=QBLH"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
               &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;= HttpUtility.HtmlEncode(a.Name) &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;
           &lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;&amp;lt;%&lt;/SPAN&gt;
           });
           column.For(c =&amp;gt; c.Country);
           column.For(c =&amp;gt; c.Medal.ToString());
           column.For(c =&amp;gt; c.Sport);
       }).Attributes(id =&amp;gt; "example").Render();
&lt;SPAN style="BACKGROUND-COLOR: #ffff00; COLOR: black"&gt;%&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;div&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Now we can do sorting by clicking the column names, filtering by entering text in the search box, and pagination by selecting the drop-down for “show X entries”. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_4.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_4.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners3 border=0 alt=medalwinners3 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_thumb_1.png" width=402 height=290 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners3_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;That’s pretty much it! Before we part, let’s make a quick foray into the syntax of making changes to the datatable initialization code. We can disable columns so they can’t be sorted, create a custom sort order, and change the default length by setting some properties. Let’s disable sorting by the first and sixth columns, sort by name by default, and set the default paging to 25. Just change the javascript block to this: &lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-BOTTOM: #cccccc 1px solid; POSITION: relative; MARGIN: 10px; WIDTH: 95%; FONT-SIZE: 12px"&gt;&lt;SPAN style="BORDER-BOTTOM: #cccccc 1px solid; TEXT-ALIGN: right; WIDTH: 100%; DISPLAY: block"&gt;&lt;A style="COLOR: #3366cc" onclick="if(this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display==''){this.innerHTML = 'Show Code [+]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = 'none';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = '';}else{this.innerHTML = 'Hide Code [-]';this.parentNode.parentNode.getElementsByTagName('pre')[0].style.display = '';this.parentNode.parentNode.getElementsByTagName('div')[0].style.display = 'none';}return false;" href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=9807&amp;amp;postid=9516639#"&gt;Hide Code [-]&lt;/A&gt;&lt;/SPAN&gt; &lt;PRE style="PADDING-BOTTOM: 30px; OVERFLOW-X: auto; OVERFLOW-Y: hidden"&gt;$(&lt;SPAN style="COLOR: #0000ff"&gt;document&lt;/SPAN&gt;).ready(&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;() {
    $('#example').dataTable({
        "&lt;SPAN style="COLOR: #8b0000"&gt;iDisplayLength&lt;/SPAN&gt;": 25,
        "&lt;SPAN style="COLOR: #8b0000"&gt;aaSorting&lt;/SPAN&gt;": [[2, "&lt;SPAN style="COLOR: #8b0000"&gt;asc&lt;/SPAN&gt;"]],
        "&lt;SPAN style="COLOR: #8b0000"&gt;aoColumns&lt;/SPAN&gt;": [{ "&lt;SPAN style="COLOR: #8b0000"&gt;bSortable&lt;/SPAN&gt;": &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt; }, &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;,
            &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;, { "&lt;SPAN style="COLOR: #8b0000"&gt;bSortable&lt;/SPAN&gt;": &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt;}]
    });
});&lt;/PRE&gt;
&lt;DIV style="BACKGROUND-COLOR: #3366cc; DISPLAY: none; COLOR: #ffffff; FONT-WEIGHT: bold"&gt;{..} Click Show Code&lt;/DIV&gt;&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;And voilá! &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_2.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=medalwinners4 border=0 alt=medalwinners4 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_thumb.png" width=402 height=292 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/WalkthroughfullexampleofusingMvcContribg_13C88/medalwinners4_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://paulw.us/grid-example.zip" mce_href="http://paulw.us/grid-example.zip"&gt;[Download complete source code]&lt;/A&gt; (394KB, ZIP file)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9516639" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/c_2300_/">c#</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/mvccontrib/">mvccontrib</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/datatable/">datatable</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/mvc/">mvc</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/asp-net/">asp.net</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/jquery/">jquery</category></item><item><title>Get common dates in T-SQL</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/06/25/get-common-dates-in-t-sql.aspx</link><pubDate>Wed, 25 Jun 2008 21:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8652703</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8652703</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/06/25/get-common-dates-in-t-sql.aspx#comments</comments><description>&lt;P&gt;A few years ago I created &lt;A class="" title="My developer.com article on dynamic date parameters in T-SQL and Reporting Services" href="http://www.developer.com/db/article.php/10920_3513996_2" mce_href="http://www.developer.com/db/article.php/10920_3513996_2"&gt;an article&lt;/A&gt; around Reporting Services and dates. It could have been written more generically, because I&amp;nbsp;reference this quite a bit to get common dates like "the beginning of this week", "midnight last night", etc, in my SQL queries. It's a fairly comprehensive list of relative dates that one might want to get in T-SQL for reporting, scheduling, etc.&lt;/P&gt;
&lt;P&gt;It can get pretty complex, such as this function for getting the end of the current week&lt;/P&gt;
&lt;P&gt;CREATE FUNCTION get_week_end (@date datetime)&lt;BR&gt;RETURNS datetime AS&lt;BR&gt;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp; return dateadd(yyyy, datepart(yyyy,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateadd(weekday,7-datepart(weekday, @date),@date))-1900, 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + dateadd(ms, -3,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateadd(dy, datepart(dy,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateadd(weekday,7-datepart(weekday, @date),@date)),0) )&lt;BR&gt;END&lt;/P&gt;
&lt;P&gt;If you don't find what you need, you can typically use the dateadd function to tweak one of these. Here is the complete list outlined in the article:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Start of this week&lt;/LI&gt;
&lt;LI&gt;End of this week&lt;/LI&gt;
&lt;LI&gt;Start of last week&lt;/LI&gt;
&lt;LI&gt;End of last week&lt;/LI&gt;
&lt;LI&gt;Start of this month&lt;/LI&gt;
&lt;LI&gt;End of this month&lt;/LI&gt;
&lt;LI&gt;Start of last month&lt;/LI&gt;
&lt;LI&gt;End of last month&lt;/LI&gt;
&lt;LI&gt;Start of the day yesterday&lt;/LI&gt;
&lt;LI&gt;End of the day yesterday&lt;/LI&gt;
&lt;LI&gt;Start of the day today&lt;/LI&gt;
&lt;LI&gt;End of the day today&lt;/LI&gt;
&lt;LI&gt;Start of the day this Monday&lt;/LI&gt;
&lt;LI&gt;End of the day this Monday&lt;/LI&gt;
&lt;LI&gt;Start of the year&lt;/LI&gt;
&lt;LI&gt;Tomorrow at noon&lt;/LI&gt;
&lt;LI&gt;Today at noon&lt;/LI&gt;&lt;/UL&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8652703" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/dynamic+date/">dynamic date</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/sql/">sql</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/query/">query</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/t_2D00_sql/">t-sql</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/dates/">dates</category></item><item><title>New SharePoint Developer Resource</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/06/14/new-sharepoint-developer-resource.aspx</link><pubDate>Sat, 14 Jun 2008 19:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8597797</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8597797</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/06/14/new-sharepoint-developer-resource.aspx#comments</comments><description>As part of the &lt;A class="" href="http://caparea.net/" mce_href="http://caparea.net"&gt;Capital Area .NET&lt;/A&gt;'s new SharePoint SIG, I led a discussion group last week which worked together to create a WSS/MOSS Developer Productivity Wiki Page. Check it out on &lt;A class="" href="http://wsswiki.com/Developer_productivity_tips_and_tools" mce_href="http://wsswiki.com/Developer_productivity_tips_and_tools"&gt;WSSWiki.com&lt;/A&gt;, and please feel free to add to it!&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8597797" width="1" height="1"&gt;</description></item><item><title>Personal Twitter Client Counter</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/04/29/personal-twitter-client-counter.aspx</link><pubDate>Wed, 30 Apr 2008 06:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8440933</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8440933</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/04/29/personal-twitter-client-counter.aspx#comments</comments><description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Get a count and percentage of how many updates you've had with each twitter tool.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://paulw.us/blog/uploads/TwitterClientCounterWPF.zip" mce_href="http://paulw.us/blog/uploads/TwitterClientCounterWPF.zip"&gt;Download C# 3.5 WPF Source Code&lt;/A&gt; &lt;BR&gt;Note: This source code is mostly a quick hack to get the data I wanted. Also, if you run this on your own data, note that you may need to wait a few minutes for results to come back.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In testing out various &lt;A href="http://www.readwriteweb.com/archives/top_twitter_clients_definitive_list.php" mce_href="http://www.readwriteweb.com/archives/top_twitter_clients_definitive_list.php"&gt;twitter clients&lt;/A&gt;, I wanted to get a feel for my personal usage (how much I've used each client), so I decided I'd write some code around it. To begin, here are the results:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;web, 1770, 41.549%&amp;nbsp; &lt;A href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_4.png" mce_href="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 15px; BORDER-RIGHT-WIDTH: 0px" height=244 alt=Clipboard02 src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_thumb_1.png" width=219 align=right border=0 mce_src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/PersonalTwitterClientCounter_13E04/Clipboard02_thumb_1.png"&gt;&lt;/A&gt; &lt;BR&gt;im, 1214, 28.498% &lt;BR&gt;txt, 713, 16.737% &lt;BR&gt;SnapFoo, 153, 3.592% &lt;BR&gt;twigadge, 146, 3.427% &lt;BR&gt;Twadget, 128, 3.005% &lt;BR&gt;TwitterFox, 61, 1.432% &lt;BR&gt;Snitter, 21, 0.493%&amp;nbsp; &lt;BR&gt;Jott, 17, 0.399% &lt;BR&gt;TwitBin, 16, 0.376% &lt;BR&gt;twitterfeed, 7, 0.164% &lt;BR&gt;Spaz, 6, 0.141% &lt;BR&gt;Twitter Opera widget, 3, 0.070% &lt;BR&gt;twhirl, 3, 0.070% &lt;BR&gt;Twittearth, 2, 0.047%&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I snagged an &lt;A href="http://chakkaradeep.wordpress.com/2008/04/05/a-simple-twitter-client-to-demonstrate-backgroundworker/" mce_href="http://chakkaradeep.wordpress.com/2008/04/05/a-simple-twitter-client-to-demonstrate-backgroundworker/"&gt;API code sample&lt;/A&gt; and fired up my trusty Visual Studio 2005. Thankfully (so I could step out of my box a bit), the code sample was in C# 3.5! So... I popped open my laptop and set out coding (finally, for the first time outside of dragging some controls around) in Visual Studio 2008.&lt;/P&gt;
&lt;P&gt;As part of this, I wrote my first LINQ-to-XML query!&lt;/P&gt;
&lt;P&gt;This code makes a request to twitter (you have to be authenticated first) and gets an &lt;A href="http://en.wikipedia.org/wiki/Anonymous_type" mce_href="http://en.wikipedia.org/wiki/Anonymous_type"&gt;anonymous type&lt;/A&gt; list called sc that has the key (the name of the source, as shown above) and the count from that page. After that I work some magic to aggregate them across all pages, though I'm investigating how to do the aggregation by first combining the XElement-s from each page (though that would take up a lot of memory).&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;url = &lt;SPAN style="COLOR: #006080"&gt;"http://twitter.com/account/archive.xml?page="&lt;/SPAN&gt; + x.ToString();

WebRequest Request = HttpWebRequest.Create(url);
Request.Credentials = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; NetworkCredential(userName, password);
WebResponse Response = Request.GetResponse();
Stream stream = Response.GetResponseStream();
TextReader reader = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; StringReader(&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; StreamReader(stream).ReadToEnd());
XElement statuses = XElement.Load(reader);

&lt;SPAN style="COLOR: #008000"&gt;// My first LINQ query!&lt;/SPAN&gt;
var sourceNames = from source &lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt; statuses.Descendants(&lt;SPAN style="COLOR: #006080"&gt;"source"&lt;/SPAN&gt;)
                  group source by source.Value into sc
                  orderby sc.Count() descending
                  select &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; { sc.Key, MyCount = sc.Count() };&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;I also got to play around in WPF just a little. Nothing fancy at all, but it was nice to see the new IDE in action. It feels much more powerful.&lt;/P&gt;
&lt;P&gt;I may play around with this some more, add graphing, toy around with it as a Silverlight 2 app. Or it might just sit there and do nothing ;-)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you'd like a more full-featured statistics tool for your twitter status updates, check out &lt;A class="" title=TweetStats href="http://www.tweetstats.com/" mce_href="http://www.tweetstats.com"&gt;TweetStats&lt;/A&gt; (&lt;A class="" title="TweetStats for @paulwhit" href="http://tweetstats.com/graphs/paulwhit" mce_href="http://tweetstats.com/graphs/paulwhit"&gt;my stats&lt;/A&gt;).&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8440933" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/tool/">tool</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/c_2300_/">c#</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/winforms/">winforms</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/wpf/">wpf</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/client/">client</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/twitter/">twitter</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/counter/">counter</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/usage/">usage</category></item><item><title>Latest tool: XPath query field extractor for InfoPath</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/04/16/latest-tool-xpath-query-field-extractor-for-infopath.aspx</link><pubDate>Wed, 16 Apr 2008 10:55:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8398490</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8398490</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/04/16/latest-tool-xpath-query-field-extractor-for-infopath.aspx#comments</comments><description>&lt;blockquote&gt; &lt;p&gt;Update: This tool seems to be only relevant with InfoPath 2003. A co-worker pointed out that due the customer pains around a lack of a feature like this, in InfoPath 2007 you can right-click a node in the data source and choose "Copy XPath". Cool! Thanks to Scott Heim for pointing this out.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So, I love making tools. One-off things that process something. Batch files that lessen monotony. Sexy little WinForm apps for displaying data. XSL transformations that regurgitate and pre-process XML. &lt;/p&gt; &lt;p&gt;My latest tool is a small WinForms app that pulls out a list of fields form an InfoPath document so they can be referenced as XPath. This is pretty neat because my client needed a documentation artifact, and this saved quite a bit of tedium. Getting this data also proved difficult because the Namespace URI for the "my" namespace is always changing because it includes a timestamp (see solution below).&lt;/p&gt; &lt;p&gt;Here's a sample of the output. You can use each of these lines as XPath queries against the document:&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;p&gt;my:MyFields/my:secMain
my:MyFields/my:secMain/my:secPhysicalDescriptionHeader
my:MyFields/my:secMain/my:secDualCitizenshipMain
my:MyFields/my:secMain/my:secDualCitizenshipMain/my:secDualCitizenshipName
my:MyFields/my:secMain/my:secDualCitizenshipMain/my:secDualCitizenship&lt;br&gt;.&lt;br&gt;.&lt;br&gt;.&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The tool uses the &lt;a href="http://support.microsoft.com/kb/310618"&gt;CAB SDK&lt;/a&gt;'s extract.exe via a command shell to pull out the template.xml file from the InfoPath XSN file.&lt;/p&gt;
&lt;p&gt;The code for using the SDK was pretty straightforward. In this case (since we want the XML template in the InfoPath, the variable ExtractionFileName is defined as:&lt;/p&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ExtractionFileName = &lt;span style="color: #006080"&gt;"template.xml"&lt;/span&gt;;&lt;/pre&gt;
&lt;p&gt;And fileName is the location of the XSN file. The code for the extraction is:&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;// Use the CAB SDK to grab the template file from the InfoPath XSN package&lt;/span&gt;
Process proc = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Process();
proc.StartInfo.FileName = &lt;span style="color: #006080"&gt;".\\EXTRACT.EXE"&lt;/span&gt;;
proc.StartInfo.Arguments = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;"\"{0}\" {1}"&lt;/span&gt;, fileName, ExtractionFileName);
proc.StartInfo.UseShellExecute = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
proc.WaitForExit();&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Dealing with the ever-changing "my" namespace&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One particular challenge arose. Since the "my" namespace in InfoPath is defined with a timestamp, every time you change the schema the namespace URI changes. So, I had to do a little preprocessing before I could read the fields (since they're all in the "my" namespace). Thankfully the timestamp is of fixed length.&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;XmlDocument doc = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlDocument();
doc.Load(extractionFilePath);

&lt;span style="color: #008000"&gt;// Use a low-tech way to get the "my:" namespace URI, since it &lt;/span&gt;
&lt;span style="color: #008000"&gt;// differs by form and when changes are made&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fileContents = File.ReadAllText(extractionFilePath);
&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; myIndex = fileContents.IndexOf(&lt;span style="color: #006080"&gt;"xmlns:my="&lt;/span&gt;) + 10;
&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; myNamespace = fileContents.Substring(myIndex, 75);

XmlNamespaceManager mgr = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; XmlNamespaceManager(doc.NameTable);
mgr.AddNamespace(&lt;span style="color: #006080"&gt;"my"&lt;/span&gt;, myNamespace);

XmlNode myFieldsNode = doc.SelectSingleNode(&lt;span style="color: #006080"&gt;"//my:myFields"&lt;/span&gt;, mgr);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After you get the "myFieldsNode" you can recursively iterate through the nodes and output the fields.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8398490" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/infopath/">infopath</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/namespace/">namespace</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/tool/">tool</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/c_2300_/">c#</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/2-0/">2.0</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/2003/">2003</category></item><item><title>Synchronize XSD from an InfoPath document with a SharePoint project for server-side XSD validation</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/04/15/synchronize-xsd-from-an-infopath-document-with-a-sharepoint-project-for-server-side-xsd-validation.aspx</link><pubDate>Tue, 15 Apr 2008 10:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8395928</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8395928</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/04/15/synchronize-xsd-from-an-infopath-document-with-a-sharepoint-project-for-server-side-xsd-validation.aspx#comments</comments><description>&lt;p&gt;In order to implement server-side XSD validation against an InfoPath form submission, I had to pull the XSD from the InfoPath document archive (XSN file) and use that to update an embedded resource in a SharePoint solution project (including automated checkout/checkin in TFS). I was able to do it using a batch file. &lt;/p&gt; &lt;p&gt;Pretty specialized need, but maybe somebody could make use of it someday ;).&lt;/p&gt; &lt;p&gt;Note: If you want to use this code, you'll have to combine some of the lines that were too long to display.&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;@echo off 

&lt;span style="color: #008000"&gt;rem ***********************************************************&lt;/span&gt;
&lt;span style="color: #008000"&gt;rem This batch file is used to extract the XSD files from each &lt;/span&gt;
&lt;span style="color: #008000"&gt;rem of the InfoPath forms, and copy them into the source tree&lt;/span&gt;
&lt;span style="color: #008000"&gt;rem Download and install the Microsoft CAB SDK from &lt;/span&gt;
&lt;span style="color: #008000"&gt;rem http://support.microsoft.com/kb/310618 to c:\cabsdk&lt;/span&gt;
&lt;span style="color: #008000"&gt;rem *********************************************************** &lt;/span&gt;

&lt;span style="color: #008000"&gt;rem IMPORTANT: Set these values to your system. Do not include &lt;/span&gt;
&lt;span style="color: #008000"&gt;rem trailing slashes, and include values in quotes if necessary &lt;/span&gt;

&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; CABSDK_PATH=c:\cabsdk\bin
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; ROOT=C:\projects\projectname
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; TFS_USERNAME=&lt;span style="color: #006080"&gt;"domain\user.name"&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; TFS_PASSWORD=password 

&lt;span style="color: #008000"&gt;rem These should be relatively fixed&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; FORMS_ROOT=%ROOT%\Project.&lt;span style="color: #0000ff"&gt;Namespace&lt;/span&gt;\12\TEMPLATE\Layouts\infopathForms
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; XSD_ROOT=%ROOT%\Project.&lt;span style="color: #0000ff"&gt;Namespace&lt;/span&gt;\12\Resources
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; TF_PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE 

echo.
echo ********* InfoPath Form 1 *********
echo.
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; FORM_PATH=%FORMS_ROOT%\Form 1\Form1.xsn
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; XSD_PATH=%XSD_ROOT%\Form1.xsd
&lt;span style="color: #0000ff"&gt;set&lt;/span&gt; &lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt;=FINISH
&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; UPDATE_SCHEMA 

:FINISH
&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; FINISH_BATCH

:UPDATE_SCHEMA
echo Checking file out...
&lt;span style="color: #006080"&gt;"%TF_PATH%\tf.exe"&lt;/span&gt; edit &lt;span style="color: #006080"&gt;"%XSD_PATH%"&lt;/span&gt; 
    /login:%TFS_USERNAME%,%TFS_PASSWORD% /noprompt &amp;gt;/nil 

echo Extracting file...
del myschema.xsd
&lt;span style="color: #006080"&gt;"%CABSDK_PATH%\extract.exe"&lt;/span&gt; &lt;span style="color: #006080"&gt;"%FORM_PATH%"&lt;/span&gt; myschema.xsd &amp;gt;/nil 

echo Replacing file...
copy myschema.xsd &lt;span style="color: #006080"&gt;"%XSD_PATH%"&lt;/span&gt; &amp;gt;/nil 

echo Checking file &lt;span style="color: #0000ff"&gt;in&lt;/span&gt;...
&lt;span style="color: #006080"&gt;"%TF_PATH%\tf.exe"&lt;/span&gt; checkin &lt;span style="color: #006080"&gt;"%XSD_PATH%"&lt;/span&gt; 
    /login:%TFS_USERNAME%,%TFS_PASSWORD% /noprompt 
    /comment:&lt;span style="color: #006080"&gt;"Automated checkin from XsdExtractor script"&lt;/span&gt; &amp;gt;/nil 

&lt;span style="color: #0000ff"&gt;goto&lt;/span&gt; %&lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt;% 

:FINISH_BATCH 
&lt;/pre&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8395928" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/infopath/">infopath</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/xsd/">xsd</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/batch/">batch</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/tfs/">tfs</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/sharepoint/">sharepoint</category></item><item><title>Live Writer: Word+Social media, for bloggers</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/04/15/live-writer-word-social-media-for-bloggers.aspx</link><pubDate>Tue, 15 Apr 2008 05:28:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8396099</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8396099</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/04/15/live-writer-word-social-media-for-bloggers.aspx#comments</comments><description>&lt;p&gt;I just started using &lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; to update my blogs*. I'm thoroughly impressed with what I see, both from the practical sense and just how much cool seems to surround this thing.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:139f9610-f244-4810-af46-774d25b85a3c" style="padding-right: 10px; display: inline; padding-left: 10px; float: right; padding-bottom: 10px; margin: 0px; padding-top: 10px"&gt;&lt;a href="http://maps.live.com/default.aspx?v=2&amp;amp;cp=qgkm0c8kdq18&amp;amp;lvl=1&amp;amp;style=o&amp;amp;scene=24019353&amp;amp;mkt=en-US&amp;amp;FORM=LLWR" id="map-e5f64010-9869-4f21-b6e8-b569b29f9841" alt="Click to view this map on Live.com" title="Click to view this map on Live.com"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/paulwhit/WindowsLiveWriter/LiveWriterWordSocialmediaforbloggers_1367A/map-f75db1b8f557.jpg" width="320" height="240" alt="1) My Apartment Building, Washington, DC"&gt;&lt;/a&gt;&lt;br&gt;&lt;label for="map-e5f64010-9869-4f21-b6e8-b569b29f9841" style="font-size:.8em;"&gt;1) My Apartment Building, Washington, DC&lt;/label&gt;&lt;/div&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;Software+Services is Microsoft's answer to the debate about where the future of computing is going in the near future. My take on what this means is a badass WinForms interface with a sexy back-end built around some Web 2.0-ish stuff. That's the technical explanation.&lt;/p&gt; &lt;p&gt;Live Writer epitomizes all of this. It's a lightweight, feature- and graphics-rich editing environment, and it's very closely integrated with a bunch of "Web 2.0" sites, including a pile of blog packages and social media sites.&lt;/p&gt; &lt;p&gt;There are some neat plug-ins "out of the box", including one that took me exactly 12 seconds to show you an image of my apartment building (see image 1).&lt;/p&gt; &lt;p&gt;Plus, there seems to be an active plug-in community developing things to better pretty up source code, integrate with Flickr, Facebook and other sites. Some of em are crap, but the architecture seems like it must be easy enough to be accessible. One cool one is the Amazon Book Lookup plugin (see example below)&lt;/p&gt; &lt;p&gt;Some of the interface features I'm falling in love with include the ability to match the style to the blog's style (so I can switch between the three blogs and see how it'll look in each one), and the ability to pull up old posts from the "Open" menu.&lt;/p&gt; &lt;table align="right" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;a href="http://www.amazon.com/gp/redirect.html%3FASIN=1569245134%26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/1569245134%253FSubscriptionId=0525E2PQ81DD7ZTWTK82"&gt;&lt;img src="http://ecx.images-amazon.com/images/I/41VWH81G2KL._SL75_.jpg" border="1"&gt;&lt;/a&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;b&gt;Party of One: The Loners' Manifesto&lt;/b&gt; &lt;br&gt;by Anneli Rufus &lt;br&gt;&lt;br&gt;&lt;a href="http://www.amazon.com/gp/redirect.html%3FASIN=1569245134%26tag=ws%26lcode=sp1%26cID=2025%26ccmID=165953%26location=/o/ASIN/1569245134%253FSubscriptionId=0525E2PQ81DD7ZTWTK82"&gt;Read more about this book...&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;* My blogs:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://geekswithblogs.net/paulwhitblog"&gt;My GeeksWithBlogs Blog&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/paulwhit"&gt;My MSDN Blog&lt;/a&gt;  &lt;li&gt;&lt;a href="http://paulw.us/blog"&gt;My Personal Blog&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8396099" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/tool/">tool</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/livewriter/">livewriter</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/blogging/">blogging</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/socialnetwork/">socialnetwork</category></item><item><title>Use the DescriptionAttribute with an Enum to display status messages.</title><link>http://blogs.msdn.com/b/paulwhit/archive/2008/03/31/use-the-descriptionattribute-with-an-enum-to-display-status-messages.aspx</link><pubDate>Tue, 01 Apr 2008 04:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346252</guid><dc:creator>paulwhit</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/paulwhit/rsscomments.aspx?WeblogPostID=8346252</wfw:commentRss><comments>http://blogs.msdn.com/b/paulwhit/archive/2008/03/31/use-the-descriptionattribute-with-an-enum-to-display-status-messages.aspx#comments</comments><description>&lt;div class="post"&gt; &lt;p&gt;&lt;font face="Arial"&gt;I've been working on various forms of displaying status messages from enums, and here's the latest preferred iteration of how to do this. Regurgitated and tweaked from &lt;a href="http://blog.waynehartman.com/articles/84.aspx"&gt;WayneHartman.com&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;enum&lt;/span&gt; XmlValidationResult
{
    [Description(&lt;span style="color: #006080"&gt;"Success."&lt;/span&gt;)]
    Success,
    [Description(&lt;span style="color: #006080"&gt;"Could not load file."&lt;/span&gt;)]
    FileLoadError,
    [Description(&lt;span style="color: #006080"&gt;"Could not load schema."&lt;/span&gt;)]
    SchemaLoadError,
    [Description(&lt;span style="color: #006080"&gt;"Form XML did not pass schema validation."&lt;/span&gt;)]
    SchemaError
}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetEnumDescription(Enum &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)
{
    &lt;span style="color: #008000"&gt;// Get the Description attribute value for the enum value&lt;/span&gt;
    FieldInfo fi = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.GetType().GetField(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.ToString());
    DescriptionAttribute[] attributes = 
        (DescriptionAttribute[])fi.GetCustomAttributes(
            &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(DescriptionAttribute), &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);

    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (attributes.Length &amp;gt; 0)
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; attributes[0].Description;
    }
    &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.ToString();
    }
}
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It's possible to do something even cooler like &lt;a href="http://biasecurities.com/blog/2006/text-description-for-enum-values/"&gt;&lt;font color="#800080"&gt;cache the values&lt;/font&gt;&lt;/a&gt; or &lt;a href="http://blogs.msdn.com/abhinaba/archive/2005/10/21/483337.aspx"&gt;add a ToDescription() method&lt;/a&gt; (in C#3.0), but I just wanted an simple, repeatable way to do this.&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8346252" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/code/">code</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/c_2300_/">c#</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/enum/">enum</category><category domain="http://blogs.msdn.com/b/paulwhit/archive/tags/-net/">.net</category></item></channel></rss>