<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetmafia.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Kyle Kelin on .Net</title><subtitle type="html" /><id>http://dotnetmafia.com/blogs/kylekelin/atom.aspx</id><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/default.aspx" /><link rel="self" type="application/atom+xml" href="http://dotnetmafia.com/blogs/kylekelin/atom.aspx" /><generator uri="http://communityserver.org" version="3.1.20917.1142">Community Server</generator><updated>2009-03-31T11:41:00Z</updated><entry><title>Why Not Make Your SharePoint 2010 Menus Sortable?</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/22/why-not-make-your-sharepoint-2010-menus-sortable.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/22/why-not-make-your-sharepoint-2010-menus-sortable.aspx</id><published>2010-02-22T22:12:43Z</published><updated>2010-02-22T22:12:43Z</updated><content type="html">&lt;p&gt;One big improvement in SP2010 is in the rendered markup. You will see fewer tables and more lists and div elements.When I saw this I immediately thought of what this would allow with jQuery. The Ribbon control and menus in SP2010 are rendered as unordered lists. This allows us to apply interactions to them from the jQuery UI framework. In this post I am going to walk you through an example. In the example we are going to apply the sortable interaction to the SharePoint menu. After deploying our Web Part , the user can then reorder the menu items. In the screen shots below I am moving the Browse menu item to the right of the Page menu item. Now in this example I don’t save the result so the page refresh would reset the users sorting but you could easily write some JavaScript code that saved the order to a SharePoint list.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_5A0AA115.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_196854A6.png" width="244" height="122" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_78E114F3.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_7874E1FE.png" width="244" height="120" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_37D2958F.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_4C57E50D.png" width="244" height="133" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; – Create a new Visual Web Part project in VS2010. There are already many articles on this subject so I will allow you to just go ahead and Google this if you need to.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; – Download and reference &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; and &lt;a href="http://jqueryui.com/home"&gt;JQuery UI&lt;/a&gt;.     &lt;br /&gt;&amp;#160; There are a number of ways to do this. I chose to simply download the files and drop them in the layouts folder of the 14 hive. You can also directly link to them on Google. Here are my references:&lt;/p&gt;  &lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;_layouts/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;_layouts/ui.core.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;     &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;_layouts/ui.sortable.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt; – The rest of the code in the Visual WebPart &lt;/p&gt;  &lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $(document).ready(function () {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $(&amp;quot;.ms-cui-tts&amp;quot;).sortable(); ; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; });   &lt;br /&gt;&amp;lt;/script&amp;gt; &lt;/p&gt;  &lt;p&gt;This is all the code that is required! The class of the UL element that wraps the menu we are trying to make sortable is ms-cui-tts. To keep this example simple I used a Visual Web Part but it would be better to add the above JavaScript block to the master page so that all pages had the same functionality.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=2799" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Add Dragging Functionality to SharePoint 2010 in Five Minutes</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/22/add-dragging-functionality-to-sharepoint-2010-in-five-minutes.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/22/add-dragging-functionality-to-sharepoint-2010-in-five-minutes.aspx</id><published>2010-02-22T21:26:57Z</published><updated>2010-02-22T21:26:57Z</updated><content type="html">&lt;p&gt;In this post I am going to outline a quick example of using the jQuery UI framework to enable elements on your SharePoint page to be dragged around. This would probably work in SP 2007 too but I have some plans to apply this to the Ribbon control in the near future.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What we are building:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_377F422C.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_7A7B1099.png" width="244" height="137" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A Visual Web Part (Web Part + User control) that will contain a div element with a blue border and “Drag me around” text. The blue box can be dragged around the page by the user. Simple enough.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; – Create a new Visual Web Part project in VS2010. There are already many articles on this subject so I will allow you to just go ahead and Google this if you need to.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; – Download and reference &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; and &lt;a href="http://jqueryui.com/home"&gt;JQuery UI&lt;/a&gt;.    &lt;br /&gt;&amp;#160; There are a number of ways to do this. I chose to simply download the files and drop them in the layouts folder of the 14 hive. You can also directly link to them on Google. Here are my references:&lt;/p&gt;  &lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;_layouts/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;    &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;_layouts/ui.core.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;     &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;_layouts/ui.draggable.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt; – The rest of the code in the Visual WebPart    &lt;br /&gt;&amp;#160; To finish off the Visual WebPart (remember that is just a user control) add this code:&lt;/p&gt;  &lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; $(document).ready(function () {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $(&amp;quot;#draggable&amp;quot;).draggable(); &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; });   &lt;br /&gt;&amp;lt;/script&amp;gt; &lt;/p&gt;  &lt;p&gt;&amp;lt;div class=&amp;quot;demo&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;div id=&amp;quot;draggable&amp;quot; style=&amp;quot;width: 150px; height: 150px; padding: 0.5em; border:1px solid blue&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;p&amp;gt;Drag me around&amp;lt;/p&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/div&amp;gt;    &lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The JavaScript function just attaches the draggable function to any elements with an id equal to “draggable” when the HTML document finishes loading. The html code is the element that we are going to allow the user to drag plus some styling.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt; – Deploy    &lt;br /&gt;&amp;#160; Just right click on the solution and select Deploy. Then create a page and add your new Web Part to the page.&lt;/p&gt;  &lt;p&gt;A few final comments about this. The way I deployed the js files is bad. And you would never want to do that in a real-world scenario. Instead you would want to add those as part of the feature and wsp. And you can also create a specific jQuery UI JavaScript file that contains all the features you want in one file. Here I just copied the draggable JavaScript file to the layouts folder. Also don’t forgot to explore the jQuery UI for cool options besides the plan drag example I am using here.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=2798" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>PowerShell: My First Look</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/19/powershell-my-first-look.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/19/powershell-my-first-look.aspx</id><published>2010-02-19T21:15:34Z</published><updated>2010-02-19T21:15:34Z</updated><content type="html">&lt;p&gt;Even before the details of SharePoint 2010 were announced I’ve been wanting to learn PowerShell. Of course now that SP2010 is relying on PowerShell almost entirely I have extra motivation to learn the tool. I thought what I would do in this post is document step by step what I did to get familiar with the tool. Readers new to PS can follow along to help them get started.&lt;/p&gt;  &lt;p&gt;I first went to this link and downloaded the PowerShell cheat sheet &lt;a href="http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=2&amp;amp;ved=0CBAQFjAB&amp;amp;url=http%3A%2F%2Fblogs.msdn.com%2Fpowershell%2Fattachment%2F1525634.ashx&amp;amp;ei=7Vl9S-P5NNWslAf2sIGsBQ&amp;amp;usg=AFQjCNGB5s3rqOdbBBpSzRadwUebdmmufw&amp;amp;sig2=54sRAYzdNi56pO-BnyO2Nw"&gt;here&lt;/a&gt; . This way as I learn commands I don’t really have to remember them. &lt;/p&gt;  &lt;p&gt;After fixing some printer issues I read this article from James Kovacs &lt;a href="http://codebetter.com/blogs/james.kovacs/archive/2009/02/01/getting-started-with-powershell-developer-edition.aspx"&gt;here&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The paragraph below gives you a basis for how PowerShell commands are structured:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Believe it or not, you probably already know a fair amount of PowerShell. Many of the commands you’re familiar with in cmd.exe work in PowerShell. (More surprisingly, many of the common commands you know from bash, tcsh, or other Unix shells also work!) The command line arguments are often different, but the basic familiar commands are there. So try out dir, cd, copy, del, move, pushd, popd, … (If you’re a old Unix hacker, you can try out ls, man, kill, pwd, ps, lp, cp, … Unfortunately there is no grep equivalent built in, which is terribly unfortunate.) All of these commands are actually aliases to PowerShell commands, which are named by VERB-NOUN, where NOUN is singular. For example to get a list of running processes, you run Get-Process, which is aliased to “ps”.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;PowerShell is very conducive to experimentation. You can always find out more about a command or alias typing “Get-Help [CmdName|Alias]” or simply “help [CmdName|Alias]” since help is an alias for Get-Help. (N.B. PowerShell is case insensitive.) You can also look for commands by typing part of the command and pressing tab repeatedly. For example, if you want to find all set- commands, type “set-[TAB][TAB]…” to display Set-Acl, Set-Alias, etc. You can also look for commands using wildcards. Type “*-Acl[TAB][TAB]…” displays Get-Acl and Set-Acl.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt; After that I watched Hanselman’s PowerShell tutorial on &lt;a href="http://perseus.franklins.net/dnrtvplayer/player.aspx?ShowNum=0082"&gt;DnrTV&lt;/a&gt;. After that I immediately installed &lt;a href="http://thepowershellguy.com/blogs/posh/pages/powertab.aspx"&gt;PowerTab&lt;/a&gt;. This tool adds intellisense to PS which is a huge help. Best part is it is free.&lt;/p&gt;  &lt;p&gt;Since my main reason for learning PowerShell was to use it with SharePoint the final step was to read &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/12/04/powershell-basics-for-sharepoint-2010-sp2010.aspx"&gt;this article&lt;/a&gt; by Corey Roth which shows you how to load up the SharePoint PowerShell commands. &lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=2789" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>My First Attempt At Using the SharePoint 2010 Client OM from WPF</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/17/my-first-attempt-at-using-the-sharepoint-20101-client-om-from-wpf.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2010/02/17/my-first-attempt-at-using-the-sharepoint-20101-client-om-from-wpf.aspx</id><published>2010-02-17T21:34:00Z</published><updated>2010-02-17T21:34:00Z</updated><content type="html">&lt;p&gt;I took a crack at building a WPF application that interacts with a SharePoint 2010 site. I’m going to skim over how to create a WPF application since you can find that in other blog posts. After creating your WPF app you need to add two references: Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime. Both assemblies are in the 14 hive of any server running SharePoint 2010. &lt;/p&gt;  &lt;p&gt;Next add two using statements in the code behind class of the main window:&lt;/p&gt;  &lt;p&gt;using Microsoft.SharePoint.Client;    &lt;br /&gt;using SP = Microsoft.SharePoint.Client;&lt;/p&gt;  &lt;p&gt;Then in the constructor of the MainWindow (still in the code behind class) add the follow lines of code like so:&lt;/p&gt;  &lt;div style="font-family:consolas;background:white;color:black;font-size:10pt;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af;"&gt;ClientContext&lt;/span&gt; context;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;SP.&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;gt; listsCollection;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;public&lt;/span&gt; MainWindow()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; InitializeComponent();&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;try&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;ClientContext&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;http://sp2010/&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af;"&gt;Web&lt;/span&gt; site = context.Web;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.Load(site, osite =&amp;gt; osite.Title);&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.ExecuteQuery();&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Title = site.Title;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af;"&gt;ListCollection&lt;/span&gt; lists = site.Lists;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; listsCollection = context.LoadQuery(lists.Include(l =&amp;gt; l.Title, l =&amp;gt; l.Id));&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.ExecuteQuery();&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListBox1.ItemsSource = listsCollection;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListBox1.DisplayMemberPath = &lt;span style="color:#a31515;"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This code assumes that there is a ListBox named ListBox1 in your XAML of MainWindow. So you should go and create that now. The first thing the code snippet does is create a ClientContext object based on the URL to our SP site. The next line is using the Load method of the context object. The lamda expression being passed in as the second parameter allows us to only load that property. So we are getting the site but only loading the title property. It is also important to note that the Load method doesn’t execute until we call the ExecuteQuery. Both of these methods were written this way to improve performance by cutting down on either database calls or payload sizes.&lt;/p&gt;  &lt;p&gt;The next 3 lines follow a similar pattern of setup then execute. This code uses the site name to retrieve all the lists for that site. Again we only the title and id to reduce the amount of data coming from the server. And again we call ExecuteQuery, failing to do so would result in listsCollection being null.&lt;/p&gt;  &lt;p&gt;The final two lines simple bind our list collection to the ListBox so we can display the titles of the lists.&lt;/p&gt;  &lt;p&gt;The next thing I wanted to do was to try out updating a list. So add a textbox and button to your window. Add an event handler to the button like so:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;"&gt;&amp;#160;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af;"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;var&lt;/span&gt; list = (SP.&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;)ListBox1.SelectedItem;&lt;/p&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; list.Title = textBox1.Text;&lt;/p&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; list.Update();&lt;/p&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.ExecuteQuery();&lt;/p&gt;  &lt;p style="margin:0px;font-family:consolas;background:white;color:black;font-size:10pt;" align="left"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Again same pattern of setup and then execute. I grab the item that is selected in the ListBox and cast it. Be sure you are casting it to the client List object and not the SPList object. As our requirements grow we could simply set more properties or add columns just like we did in SharePoint 2007. Then we call ExecuteQuery to execute the changes. Note: do not forgot to call list.Update before the ExecuteQuery. If you don’t the code will execute without error but the list title would not get updated.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Side Note:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This is my first blog post where I used Visual Studio 2010. In doing so I needed to install CopyAsHtml so I could paste my code in this post properly. I had forgotten about a previous post that Corey Roth had written about getting this add-in to work in VS 2010. &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/11/20/copy-source-as-html-in-visual-studio-2010.aspx"&gt;Click Here.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=2768" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Some other UI Hooks in SharePoint 2010</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/11/10/some-other-ui-hooks-in-sharepoint-2010.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/11/10/some-other-ui-hooks-in-sharepoint-2010.aspx</id><published>2009-11-11T03:57:25Z</published><updated>2009-11-11T03:57:25Z</updated><content type="html">&lt;p&gt;In my last post I wrote about the Ribbon Control. In this post I’m going to review three new UI features in SP 2010 that SharePoint itself uses but you as a developer can leverage in your own applications. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Status Bar&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_467C851B.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_2CA84EEC.png" width="244" height="90" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The status bar is for persistent information like page status or version. It will show just below the ribbon control and you can select 4 different background colors. The javascript api is pretty simple:&lt;/p&gt;  &lt;div style="background:lightgray;"&gt;   &lt;blockquote&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;      &lt;p&gt;SP.UI.Notify.addNotification(strHtml, bSticky, tooltip, onclickHandler)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.Notify.removeNotification(id)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Notification Bar&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_251CDF7F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_647A930F.png" width="244" height="87" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The Notification bar is less intrusive then the status bar and used for more transient information. By default each message remains on the screen for five minutes. Let’s look at some javascript to add and remove these notifications:&lt;/p&gt;  &lt;div style="background:lightgray;"&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.Status.addStatus(strTitle, strHtml, atBeginning)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.Status.updateStatus(sid, strHtml)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.Status.removeStatus(sid)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.Status.removeAllStatus(hide)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.Status.setStatusPriColor(sid, strColor)&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Dialog Platform&lt;/p&gt;  &lt;p&gt;One of the first things you will notice about SP 2010 is the effort the development team has put forth to reduce the number of page refreshes. One way to do that is to make use of Modal Dialog boxes. Just create a new list item and you will see exactly what I am talking about. You can make use of this Modal Framework using the javascript API. You will pass in another webpage or a DOM element. For example:&lt;/p&gt;  &lt;div style="background:lightgray;"&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;function myCallback(dialogResult, returnValue) {alert(“Hello World!”);}&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;var options = {url: “/_layouts/somepage.aspx”, width: 500, dialogReturnValueCallback:myCallback};&lt;/p&gt;   &lt;/blockquote&gt;    &lt;blockquote&gt;     &lt;p&gt;SP.UI.ModalDialog.showModalDialog(options);&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I obtained the information in this post from Elisabeth Olson’s UI Presentation at the SharePoint 2009 Conference.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=1090" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Customizing the Ribbon Control in SharePoint 2010</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/11/10/customizing-the-ribbon-control-in-sharepoint-2010.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/11/10/customizing-the-ribbon-control-in-sharepoint-2010.aspx</id><published>2009-11-11T03:56:47Z</published><updated>2009-11-11T03:56:47Z</updated><content type="html">&lt;p&gt;&lt;a href="http://dotnetmafia.com/blogs/kylekelin/image_4A6EAF51.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://dotnetmafia.com/blogs/kylekelin/image_thumb_49964967.png" width="244" height="55" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first time I saw the html source of a page with the Ribbon control my mouth started to water thinking about all the possibilities. First the ribbon is rendered as an html list. No tables. So tweaking the styling of this is super easy. Also I have implemented some drag and drop functionality using jQuery and jQuery UI and the most common html I worked with was a html list. Most of the things going through my mind right now are just cool visual effects in that area but having that much control is going to allow for some pretty cool functionality with the ribbon.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Besides jQuery and Javascript there is a built-in way to add elements to the Ribbon control. You simply create a feature and a RibbonButton.xml file. Since I haven’t had too much time with the Beta take a look at this post for more details:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/jfrost/archive/2009/11/06/adding-custom-button-to-the-sharepoint-2010-ribbon.aspx" href="http://blogs.msdn.com/jfrost/archive/2009/11/06/adding-custom-button-to-the-sharepoint-2010-ribbon.aspx"&gt;http://blogs.msdn.com/jfrost/archive/2009/11/06/adding-custom-button-to-the-sharepoint-2010-ribbon.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I obtained the information in this post from Elisabeth Olson’s UI Presentation at the SharePoint 2009 Conference.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=1089" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Speaking at TNUG tonight</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/10/26/speaking-at-tnug-tonight.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/10/26/speaking-at-tnug-tonight.aspx</id><published>2009-10-26T21:04:27Z</published><updated>2009-10-26T21:04:27Z</updated><content type="html">&lt;p&gt;I’m giving a quick presentation over Telerik at the Tulsa .NET User’s Group meeting tonight. I go on at 6:45pm, pizza starts at 6pm.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.tulsacc.edu/page.asp?durki=4"&gt;TCC (Tulsa Community College) Northeast Campus&lt;/a&gt;    &lt;br /&gt;3727 East Apache    &lt;br /&gt;Tulsa, OK 74115    &lt;br /&gt;918-594-8000    &lt;br /&gt;&lt;a href="http://www.tulsacc.edu/archive/catalog08/3.pdf#page=168"&gt;Campus Map&lt;/a&gt; | &lt;a href="http://maps.live.com/?v=2&amp;amp;where1=3727%20E%20Apache%20St%2C%20Tulsa%2C%20OK%2074115-3150&amp;amp;encType=1"&gt;Live&lt;/a&gt; | &lt;a href="http://maps.yahoo.com/#mvt=m&amp;amp;lat=36.191718&amp;amp;lon=-95.936085&amp;amp;zoom=16&amp;amp;q1=3727%20E.%20Apache%2C%20Tulsa%2C%20OK%2074115&amp;amp;gid1=18562798"&gt;Yahoo&lt;/a&gt; | &lt;a href="http://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=3727+E.+Apache,+Tulsa,+OK+74115&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=45.8712,73.125&amp;amp;ie=UTF8&amp;amp;z=16&amp;amp;g=3727+E.+Apache,+Tulsa,+OK+74115&amp;amp;iwloc=addr"&gt;Google&lt;/a&gt; | &lt;a href="http://www.mapquest.com/maps/map.adp?country=US&amp;amp;addtohistory=&amp;amp;address=3727+East+Apache&amp;amp;city=Tulsa&amp;amp;state=ok&amp;amp;zipcode=&amp;amp;homesubmit.x=50&amp;amp;homesubmit.y=2"&gt;MapQuest&lt;/a&gt;    &lt;br /&gt;We meet in the Main Academic/Administration Building, Seminar Center, Room 109.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=1034" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Why You Should Care About SharePoint 2010</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/10/25/why-you-should-care-about-sharepoint-2010.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/10/25/why-you-should-care-about-sharepoint-2010.aspx</id><published>2009-10-26T02:13:03Z</published><updated>2009-10-26T02:13:03Z</updated><content type="html">&lt;p&gt;I spent last week at the SharePoint 2009 Conference learning about the new features in SharePoint 2010. I must say that I am pretty impressed. The product has dramatically improved especially for developers. There are tons of post already out there about specific features but I wouldn’t to write a brief post highlighting what I think the most important features are. Of course depending on what you used SharePoint 2007 for, what is most important is going to very. Since I am trying to keep this post brief I encourage you to search for each topic to gain more insight and details into each one. Note: these items aren’t in any particular order.&lt;/p&gt;  &lt;p&gt;1. Data Access &lt;/p&gt;  &lt;p&gt;There are now four ways to access data (3 new ones): &lt;/p&gt;  &lt;p&gt;· Server Object Model – same as in SP 2007&lt;/p&gt;  &lt;p&gt;· Client Object Model – this OM is used when your code isn’t running on the server. Examples Javascript, Silverlight, or a WPF app. &lt;/p&gt;  &lt;p&gt;· REST – the lists are exposed as rest services&lt;/p&gt;  &lt;p&gt;· Linq to SharePoint – you can use SPMetal to generate classes based on lists and then use linq queries on them. I have been waiting for this for a long time.&lt;/p&gt;  &lt;p&gt;In 2007 to get SharePoint data into SL, WPF or Surface you had to write your own WCF service that used the SharePoint OM or ASMX. I imagine we are going to see some really cool ways to expose SharePoint data now that this is simpler.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ee513151.aspx"&gt;http://msdn.microsoft.com/en-us/sharepoint/ee513151.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ee513152.aspx"&gt;http://msdn.microsoft.com/en-us/sharepoint/ee513152.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;2. Deployment is so much easier&lt;/p&gt;  &lt;p&gt;This one feature is going to make SP developers’ lives a lot less painful. You now have F5 deployment to your local environment from inside Visual Studio. But as easy as it is, it is also very open and extensible. Plus you can run SharePoint on Windows 7 64 bit.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.binarywave.com/blogs/eshupps/Presentations/From%20.NET%20to%20SharePoint%20-%20Introduction%20to%20SharePoint%20Programming%20for%20.NET%20Developers%20%5BSEF2008%5D.zip"&gt;http://www.binarywave.com/blogs/eshupps/Presentations/From%20.NET%20to%20SharePoint%20-%20Introduction%20to%20SharePoint%20Programming%20for%20.NET%20Developers%20%5BSEF2008%5D.zip&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;3. New Business Connectivity Services (formerly known as BDC) &lt;/p&gt;  &lt;p&gt;BDC was read only so I could view data from a database in SharePoint but couldn’t edit it. So now we can easily pull in SQL data expose it as lists and users get all the sorting, filtering and editing capabilities of a list. This also ties nicely into Office&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/sharepoint/ee513153.aspx"&gt;http://msdn.microsoft.com/sharepoint/ee513153.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;4. Relationships between lists&lt;/p&gt;  &lt;p&gt;Another feature that I have been waiting for. If you have a Customer and Orders list, you can add a lookup column on Order that points to Customers. The really cool thing is you can display as many columns from Customer as you would like. Also you can enforce referential integrity.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;5. Validation&lt;/p&gt;  &lt;p&gt;You can set validation rules using an Excel-like formula when you create columns. You no longer have to write event-receivers for this.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;6. New UI improvements &lt;/p&gt;  &lt;p&gt;They have cut out lots of page refreshes to make it faster to create and edit documents and pages. Safari and Firefox are 100% supported! I did a view source on the page and there are very little tables. Also in edit mode there is a ribbon at the top of the page which allows users quick access to those buttons needed to edit the page. The ribbon control is easily customizable. I added a new button in lab in about 10 minutes.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/sharepoint/ee513157.aspx"&gt;http://msdn.microsoft.com/sharepoint/ee513157.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;7. Managed Metadata Services &lt;/p&gt;  &lt;p&gt;Completely revamped approach for meta data.&amp;#160; There is now a central repository that will allow you to manage your taxonomies in a much more centralized way. There is a new column type called Managed Metadata which is tied to a term set. This is similar to a choice column except it is centrally managed. Let me give an example. You could have a term set called Months and the terms would be January, February etc… Months never really change but the power comes with terms sets that do and now all those columns get automatically updated. Also another cool feature is a use can type in January, Jan, or 1 and all those get stored as January. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;8. SharePoint Designer &lt;/p&gt;  &lt;p&gt;SharePoint Designer is really improved and you can export most of your work as a wsp which means those changes are portable. Huge improvement from 2007.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;9. SharePoint Workspace &lt;/p&gt;  &lt;p&gt;There is now a desktop application called SharePoint Workspace (formerly Groove) that allows users to sync with SharePoint and then work offline. Then sync those changes back the next time they go online. I haven’t used it but if it works as promised, users are going to love this. &lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=1028" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Some part of your SQL statement is nested too deeply</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/08/13/some-part-of-your-sql-statement-is-nested-too-deeply.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/08/13/some-part-of-your-sql-statement-is-nested-too-deeply.aspx</id><published>2009-08-13T17:48:20Z</published><updated>2009-08-13T17:48:20Z</updated><content type="html">&lt;p&gt;I received the following error last week:&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;Here is a good article describing the problem: &lt;a title="http://rapidapplicationdevelopment.blogspot.com/2007/05/caml-nested-too-deep.html" href="http://rapidapplicationdevelopment.blogspot.com/2007/05/caml-nested-too-deep.html"&gt;http://rapidapplicationdevelopment.blogspot.com/2007/05/caml-nested-too-deep.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The article describes the cause of the error was trying to insert a large amount of list items in a batch query. The solution is to break up the batch into smaller chunks. However I was doing a select query. After some googling and coming up short, I copied the CAML query into a text file and took a look at it. The query was several hundred lines long. It seems that the where clause of the CAML query was being added dynamically inside a loop like this&lt;/p&gt;  &lt;p&gt;foreach (HistoryItem distinctItem in distinctItems)   &lt;br /&gt; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; spQuery.Or(HistoryListColumns.Number, SPFieldTypes.Text.ToString(), distinctItem.Number);    &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;This loop builds up a CAML query by adding an OR element for each item in the distinctItems collection. This worked fine until distinctItems grew to over 1,000 items making the resulting CAML query too long for SharePoint/SQL to parse it. The simple solution for me was to break distinctItems up into subLists of 200 items and create separate CAML queries for each then combine the results.&lt;/p&gt;  &lt;p&gt;So remember if you need to dynamically build your CAML queries pay attention to the size and how big the query could possibly get.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=951" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Who the Hell Wrote This?</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/28/who-the-hell-wrote-this.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/28/who-the-hell-wrote-this.aspx</id><published>2009-05-28T14:00:09Z</published><updated>2009-05-28T14:00:09Z</updated><content type="html">&lt;p&gt;A colleague yesterday showed me a cool tip with TFS that I would like to pass along. If you have a code file open you can right-click to the left of the code in the gutter, under the source control menu, select the Annotate option. It will open the file up in a new file and show you who wrote that line. &lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=916" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Creating a List from a List Template</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/28/creating-a-list-from-a-list-template.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/28/creating-a-list-from-a-list-template.aspx</id><published>2009-05-28T13:59:46Z</published><updated>2009-05-28T13:59:46Z</updated><content type="html">&lt;p&gt;I recently struggled with this code and thought I would document it here. &lt;/p&gt;  &lt;p&gt;SPListTemplateCollection listtempColl = web.ListTemplates; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SPListTemplate myListTemplate = listtempColl[&amp;quot;Random List Template&amp;quot;];    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; web.Lists.Add(&amp;quot;MyList&amp;quot;, &amp;quot;my list description&amp;quot;, myListTemplate );&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Pretty simple code. I use the ListTemplate collection of the SPWeb to get a template I have already deployed. I then use that template in the Add method to create the list instead of one of the built in templates. &lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=915" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Post Build Actions Are Evil</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/28/post-build-actions-are-evil.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/28/post-build-actions-are-evil.aspx</id><published>2009-05-28T13:58:15Z</published><updated>2009-05-28T13:58:15Z</updated><content type="html">&lt;p&gt; This post is in response to the last SharePoint project I was on. Though this wasn’t the first time I have seen this. The developer was using wsp builder and a file called PostBuildActions.bat that was executed when they built their solution. This allowed him and other developers to simply hit F5 to build the solution and deploy it locally to their SharePoint environment. The problems started when the solution grew. It was up to 19 projects when I saw it and most projects had a bat file that was copying assemblies and ascx files after building in order for the wsp builder to work. As you can imagine this was pretty complex and unmanageable. And the build times were over 5 minutes long. Build times this long really interfere with a developers flow. I would hit F5 got get a cup of coffee or minimize the vpc and surf the web. Not a very good use of my time so I decided to cut this down. &lt;/p&gt;  &lt;p&gt;There are three solutions that you could take:&lt;/p&gt;  &lt;p&gt;&lt;u&gt;1. Create additional build modes to Debug and Release&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Use Debug and Release for compile only and create a DebugDeploy and ReleaseDeploy that will then call your PostBuildActions.bat. The does speed up the process because we now can just build if we wanted. But it still to me seemed difficult for a new developer to catch on.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;2. Create a manual deploy file&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;This is the method I chose. I removed all post build actions and copied those files into one large bat. I ended up creating two bat files, one called buildwsp.bat that copied all the files necessary assemblies and ascx files and included the wsp builder commands to create the wsp file. Next I created a file called deploy.bat that would rectract and redploy the solution package. The process was hit F5, then click buildwsp, then finally deploy. I had the two bat files on my task bar for easy use. This cut down the total deployment to about 2 minutes but it also gave me the flexibility to quickly build in just under 30 seconds.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;3. Use MSBuild&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;I didn’t use MsBuild in this situation because I didn’t have a lot of time and I don’t know MSBuild. For my next SharePoint project though I am going to use this. I think this could give me the speed and flexibility I have been wanting. There are even some MsBuild templates for SharePoint out on CodePlex.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=914" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>The .NET Framework version 4 cannot be installed because the .NET Framework version 1.0 is already installed on your computer</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/21/the-net-framework-version-4-cannot-be-installed-because-the-net-framework-version-1-0-is-already-installed-on-your-computer.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/05/21/the-net-framework-version-4-cannot-be-installed-because-the-net-framework-version-1-0-is-already-installed-on-your-computer.aspx</id><published>2009-05-21T04:05:41Z</published><updated>2009-05-21T04:05:41Z</updated><content type="html">&lt;p&gt;I ran into this error message while trying to install the .NET Framework 4.0 Beta. I went into Programs to remove it and it wasn’t listed. Hmmm. So the first thing I did was download this tool:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.raymond.cc/blog/archives/2008/11/06/how-to-check-what-version-of-microsoft-net-framework-is-installed-in-computer/" href="http://www.raymond.cc/blog/archives/2008/11/06/how-to-check-what-version-of-microsoft-net-framework-is-installed-in-computer/"&gt;http://www.raymond.cc/blog/archives/2008/11/06/how-to-check-what-version-of-microsoft-net-framework-is-installed-in-computer/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Run in and it will tell you which versions of the .NET Framework you had installed. Sure enough 1.0 was listed. So a quick google search brought me to this tool that removes versions of the .NET Framework.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog|_Tools/dotnetfx|_cleanup|_tool.zip" href="http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog|_Tools/dotnetfx|_cleanup|_tool.zip"&gt;http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog|_Tools/dotnetfx|_cleanup|_tool.zip&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Just a quick note that this comes with no warranty. It worked for me but the cleanup tool is messing with the Registry so do so at your own risk.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=910" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Improving This Blog</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/03/31/improving-this-blog.aspx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/03/31/improving-this-blog.aspx</id><published>2009-03-31T16:31:45Z</published><updated>2009-03-31T16:31:45Z</updated><content type="html">&lt;p&gt;I winding down on my current project and decided to spend some time improving my blog. The first step was downloading Live Writer. Using Live Writer instead of Word should reduce the friction of posting. In theory this should make me post more frequently.&lt;/p&gt;  &lt;p&gt;Another thing I did was sign up for Technorati which requires me to post their link here   &lt;br /&gt;&amp;lt;a href=&amp;quot;&lt;a href="http://technorati.com/claim/j6277u6ajx&amp;quot;"&gt;http://technorati.com/claim/j6277u6ajx&amp;quot;&lt;/a&gt; rel=&amp;quot;me&amp;quot;&amp;gt;Technorati Profile&amp;lt;/a&amp;gt;&lt;/p&gt;  &lt;p&gt;And the final step is to clean up my online presence a little bit. I started by updating bio on this blog but will also do that on other sites like twitter, delicious, linkedin, and facebook. And see if I tie all these together while making them consistent.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=878" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry><entry><title>Slides and Code from SharePoint Saturday</title><link rel="alternate" type="text/html" href="http://dotnetmafia.com/blogs/kylekelin/archive/2009/03/31/slides-and-code-from-sharepoint-saturday.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="2235509" href="http://dotnetmafia.com/blogs/kylekelin/attachment/877.ashx" /><id>http://dotnetmafia.com/blogs/kylekelin/archive/2009/03/31/slides-and-code-from-sharepoint-saturday.aspx</id><published>2009-03-31T15:41:00Z</published><updated>2009-03-31T15:41:00Z</updated><content type="html">&lt;p&gt;I ended up doing 3 sessions this past Saturday at the &lt;a href="http://www.schoolofdev.com/Tulsa/2009/default.aspx" target="_blank"&gt;Tulsa School of Dev/ SharePoint Saturday&lt;/a&gt; put on by &lt;a href="http://www.davidlwalker.com/" target="_blank"&gt;David Walker&lt;/a&gt;. I did two end-user sessions right after lunch, Document Library Basics and Introduction to InfoPath. After those I did a session over Unit Testing SharePoint with TypeMock. The turnout for that talk was smaller than I would have liked since David put me up against a Silverlight 3.0 talk. At the bottom of the post you will find slides and code for the unit testing session. If you want the InfoPath slides or example code just email me.&lt;/p&gt;
&lt;p&gt;DotNetMafia also had our second Beer and Code (SharePint) event.&amp;nbsp; Despite the snow, we still had some people turn out and we had a good time with plenty of food and beverages.&amp;nbsp; Our next event will be during Tech Fest 2009.&amp;nbsp; Thanks again to TekSystems for sponsoring the event.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:213be49c-5027-4b56-9d88-adaf31e77961" style="PADDING-RIGHT:0px;DISPLAY:inline;PADDING-LEFT:0px;FLOAT:none;PADDING-BOTTOM:0px;MARGIN:0px;PADDING-TOP:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/SharePoint+2007" rel="tag"&gt;SharePoint 2007&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SharePoint+Saturday" rel="tag"&gt;SharePoint Saturday&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=877" width="1" height="1"&gt;</content><author><name>KyleKelin</name><uri>http://dotnetmafia.com/members/KyleKelin.aspx</uri></author></entry></feed>