<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Josh Gaffey&amp;#39;s Blog</title><subtitle type="html" /><id>http://blogs.msdn.com/b/joshuag/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/joshuag/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2009-04-06T23:13:30Z</updated><entry><title>How to index the PublishingRollupImage field and map a metadata property in SharePoint 2007</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/12/14/how-to-index-the-publishingrollupimage-field-and-map-a-metadata-property-in-sharepoint-2007.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/12/14/how-to-index-the-publishingrollupimage-field-and-map-a-metadata-property-in-sharepoint-2007.aspx</id><published>2009-12-14T22:29:00Z</published><updated>2009-12-14T22:29:00Z</updated><content type="html">&lt;P&gt;The title of this post is a bit misleading because it’s actually not possible to index this field.&amp;nbsp; You can map it to a metadata property but you won’t ever get any results back.&amp;nbsp; The fact is, indexing this field is by design not supported in SharePoint 2007.&amp;nbsp; The good news is I have a solution to work around this problem.&amp;nbsp; What you can do is create a second text only field, I’ve called it “ThumbnailImageURL”, and make sure to always sync that field up with the URL of the image in the “PublishingRollupImage” field.&amp;nbsp; You can do this using a custom event receiver which was actually the topic of my &lt;A href="http://blogs.msdn.com/joshuag/archive/2009/12/14/updating-an-item-using-itemupdating-itemupdated-or-any-event-receiver-in-sharepoint-2007.aspx" target=_blank mce_href="http://blogs.msdn.com/joshuag/archive/2009/12/14/updating-an-item-using-itemupdating-itemupdated-or-any-event-receiver-in-sharepoint-2007.aspx"&gt;last post&lt;/A&gt;.&amp;nbsp; I’ll paste the code here again to make it easy:&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;
&lt;DIV style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum1&gt;   1:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum2&gt;   2:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum3&gt;   3:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.DisableEventFiring();&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum4&gt;   4:&lt;/SPAN&gt;&amp;nbsp; &lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum5&gt;   5:&lt;/SPAN&gt;     SPListItem item = properties.ListItem;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum6&gt;   6:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; imageUrl = &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Empty;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum7&gt;   7:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (item[&lt;SPAN style="COLOR: #006080"&gt;"PublishingRollupImage"&lt;/SPAN&gt;] != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum8&gt;   8:&lt;/SPAN&gt;     {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum9&gt;   9:&lt;/SPAN&gt;         imageUrl = ((Microsoft.SharePoint.Publishing.Fields.ImageFieldValue)(item[&lt;SPAN style="COLOR: #006080"&gt;"PublishingRollupImage"&lt;/SPAN&gt;])).ImageUrl;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum10&gt;  10:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (imageUrl != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt; &amp;amp;&amp;amp; imageUrl.StartsWith(&lt;SPAN style="COLOR: #006080"&gt;"/"&lt;/SPAN&gt;))&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum11&gt;  11:&lt;/SPAN&gt;             imageUrl = item.Web.Site.Url.AsDomain() + imageUrl;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum12&gt;  12:&lt;/SPAN&gt;         item[&lt;SPAN style="COLOR: #006080"&gt;"ThumbnailImageURL"&lt;/SPAN&gt;] = imageUrl;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum13&gt;  13:&lt;/SPAN&gt;         item.SystemUpdate();&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum14&gt;  14:&lt;/SPAN&gt;     }                &lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum15&gt;  15:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum16&gt;  16:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (Exception ex)&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum17&gt;  17:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum18&gt;  18:&lt;/SPAN&gt;     Utilities.LogError(properties.ListItem.Web, ex);&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum19&gt;  19:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum20&gt;  20:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;finally&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum21&gt;  21:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum22&gt;  22:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.EnableEventFiring();&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum23&gt;  23:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a method included in here called “AsDomain()”.&amp;nbsp; This method makes sure to append the correct URL onto the beginning of the image URL in case we want to access this image from a different site collection.&amp;nbsp; The image URL’s SharePoint returns from the ImageFieldValue field is a relative URL, which can cause broken images across site collections.&amp;nbsp; Here is the code for the “AsDomain()” extension method:&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;
&lt;DIV style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum1&gt;   1:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum2&gt;   2:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;/// Parses the domain from a URL string or returns the string if no URL was found&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum3&gt;   3:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum4&gt;   4:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;param name="url"&amp;gt;&amp;lt;/param&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum5&gt;   5:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum6&gt;   6:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; AsDomain(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; url)&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum7&gt;   7:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum8&gt;   8:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.IsNullOrEmpty(url))&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum9&gt;   9:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; url;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum10&gt;  10:&lt;/SPAN&gt;&amp;nbsp; &lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum11&gt;  11:&lt;/SPAN&gt;     var match = Regex.Match(url, &lt;SPAN style="COLOR: #006080"&gt;@"^http[s]?[:/]+[^/]+"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum12&gt;  12:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (match.Success)&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum13&gt;  13:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; match.Captures[0].Value;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum14&gt;  14:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum15&gt;  15:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; url;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum16&gt;  16:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;After you have created the ThumbnailImageURL field you will need to populate it in at least one place and run a full crawl before you will be able to map your metadata property to it.&amp;nbsp; That is about all it takes in order to be able to index Image URL’s from the PublishingRollupImage field, or any field for that matter.&amp;nbsp; If you have other solutions to this problem I’d love to hear about them.&lt;/P&gt;
&lt;SCRIPT type=text/javascript&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/SCRIPT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936793" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Updating an item using ItemUpdating, ItemUpdated or any event receiver in SharePoint 2007</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/12/14/updating-an-item-using-itemupdating-itemupdated-or-any-event-receiver-in-sharepoint-2007.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/12/14/updating-an-item-using-itemupdating-itemupdated-or-any-event-receiver-in-sharepoint-2007.aspx</id><published>2009-12-14T22:09:00Z</published><updated>2009-12-14T22:09:00Z</updated><content type="html">&lt;P&gt;When using the Event Receivers in SharePoint a common scenario is to update a property on the item the event was fired on.&amp;nbsp; I’ve heard of people running into this issue a few times and it’s not all that obvious what the proper way is to do this.&amp;nbsp; A general software development principle is to suspend or temporarily disable events from firing that you may trigger unintentionally from your code.&amp;nbsp; It is particularly difficult to do this yourself in an event receiver in SharePoint because you typically don’t have any context to work with.&amp;nbsp; It turns out there is actually a very simple way to accomplish this, but it’s not clearly documented in the places you would expect it.&amp;nbsp; The MSDN documentation on the &lt;A href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdated.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdated.aspx"&gt;ItemUpdated&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdating.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemupdating.aspx"&gt;ItemUpdating&lt;/A&gt; event make no mention of a method called &lt;A href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase.disableeventfiring.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase.disableeventfiring.aspx"&gt;DisableEventFiring&lt;/A&gt;.&amp;nbsp; It turns out that by calling this method at the beginning of your event receiver you can prevent yourself from getting into an infinite loop.&amp;nbsp; You do want to make sure to call &lt;A href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase.enableeventfiring.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.speventreceiverbase.enableeventfiring.aspx"&gt;EnableEventFiring&lt;/A&gt; when you are done however.&amp;nbsp; Here is some sample code:&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;
&lt;DIV style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum1&gt;   1:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum2&gt;   2:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum3&gt;   3:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.DisableEventFiring();&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum4&gt;   4:&lt;/SPAN&gt;&amp;nbsp; &lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum5&gt;   5:&lt;/SPAN&gt;     SPListItem item = properties.ListItem;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum6&gt;   6:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; imageUrl = &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;.Empty;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum7&gt;   7:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (item[&lt;SPAN style="COLOR: #006080"&gt;"PublishingRollupImage"&lt;/SPAN&gt;] != &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum8&gt;   8:&lt;/SPAN&gt;     {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum9&gt;   9:&lt;/SPAN&gt;         imageUrl = ((Microsoft.SharePoint.Publishing.Fields.ImageFieldValue)(item[&lt;SPAN style="COLOR: #006080"&gt;"PublishingRollupImage"&lt;/SPAN&gt;])).ImageUrl;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum10&gt;  10:&lt;/SPAN&gt;         item[&lt;SPAN style="COLOR: #006080"&gt;"ThumbnailImageURL"&lt;/SPAN&gt;] = imageUrl;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum11&gt;  11:&lt;/SPAN&gt;         item.SystemUpdate();&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum12&gt;  12:&lt;/SPAN&gt;     }                &lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum13&gt;  13:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum14&gt;  14:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (Exception ex)&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum15&gt;  15:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum16&gt;  16:&lt;/SPAN&gt;     Utilities.LogError(properties.ListItem.Web, ex);&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum17&gt;  17:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum18&gt;  18:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;finally&lt;/SPAN&gt;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum19&gt;  19:&lt;/SPAN&gt; {&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum20&gt;  20:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.EnableEventFiring();&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum21&gt;  21:&lt;/SPAN&gt; }&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;SCRIPT type=text/javascript&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/SCRIPT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936783" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Using SQL Management Studio as a domain user from a machine that is not on the domain in Windows Server 2008 R2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/10/29/using-sql-management-studio-as-a-domain-user-from-a-machine-that-is-not-on-the-domain-in-windows-server-2008-r2.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/10/29/using-sql-management-studio-as-a-domain-user-from-a-machine-that-is-not-on-the-domain-in-windows-server-2008-r2.aspx</id><published>2009-10-29T14:46:00Z</published><updated>2009-10-29T14:46:00Z</updated><content type="html">&lt;P&gt;My main development machine is not domain joined, but I often need to use it to access domain resources.&amp;nbsp; Usually this isn’t an issue as I have the option to enter my credentials through some type of login box.&amp;nbsp; In SQL Management Studio this option doesn’t exist if you are using Windows Authentication, you will always default to the user you are currently logged on as with no option to change.&amp;nbsp; The only way I can see to get around this is to use the command line to specify the following command:&lt;/P&gt;
&lt;P&gt;runas /noprofile /netonly /user:&amp;lt;domain&amp;gt;\&amp;lt;username&amp;gt; &amp;lt;program&amp;gt;&lt;/P&gt;
&lt;P&gt;A typical usage of this would look like:&lt;/P&gt;
&lt;P&gt;runas /noprofile /netonly /user:CXDMN\gaffeyj "C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe"&lt;/P&gt;
&lt;P&gt;I assume this would work in any other apps but this is the only one I’ve tried so far.&amp;nbsp; Hope this helps someone avoid searching for this answer.&lt;/P&gt;
&lt;SCRIPT type=text/javascript&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/SCRIPT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9914731" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Crawling Large Lists in SharePoint 2007</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/10/05/crawling-large-lists-in-sharepoint-2007.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/10/05/crawling-large-lists-in-sharepoint-2007.aspx</id><published>2009-10-05T13:32:00Z</published><updated>2009-10-05T13:32:00Z</updated><content type="html">&lt;P&gt;There is a lot of information out there on working with large lists in SharePoint 2007.&amp;nbsp; There is some good info &lt;A href="http://sharepointsearch.com/cs/blogs/notorioustech/archive/2009/04/08/best-practices-for-large-sharepoint-lists-and-documents-libraries.aspx" target=_blank mce_href="http://sharepointsearch.com/cs/blogs/notorioustech/archive/2009/04/08/best-practices-for-large-sharepoint-lists-and-documents-libraries.aspx"&gt;here&lt;/A&gt; and &lt;A href="http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=162" target=_blank mce_href="http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=162"&gt;here&lt;/A&gt; and Steve Peschka has a great &lt;A href="http://office.microsoft.com/download/afile.aspx?AssetID=AM102377231033" target=_blank mce_href="http://office.microsoft.com/download/afile.aspx?AssetID=AM102377231033"&gt;whitepaper on working with large lists in SharePoint 2007&lt;/A&gt; that has been out for a while now.&amp;nbsp; One thing that I haven’t seen a lot of information on is crawling large lists.&amp;nbsp; Steve’s whitepaper has a quick reference in his whitepaper saying “If the indexer is timing out when crawling large lists, you can increase the time-out value”.&amp;nbsp; We had been experiencing issues crawling a large pages library of over 4,000 items.&amp;nbsp; We were getting the error “The item may be too large or corrupt.”&amp;nbsp; Increasing the time out&amp;nbsp; seemed to help, but many times the indexer would still not make it through the whole library, we were still looking for a better solution.&amp;nbsp; After working with Microsoft Support we were told to modify three registry values:&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=730&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=457&gt;Key&lt;/TD&gt;
&lt;TD vAlign=top width=135&gt;Default Value&lt;/TD&gt;
&lt;TD vAlign=top width=136&gt;New Value&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=458&gt;HKLM\SOFTWARE\Microsoft\Office Server\12\Search\Global\GatheringManager\DedicatedFilterProcessMemoryQuota&lt;/TD&gt;
&lt;TD vAlign=top width=135&gt;104,857,600&lt;/TD&gt;
&lt;TD vAlign=top width=135&gt;209,715,200&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=458&gt;HKLM\SOFTWARE\Microsoft\Office Server\12\Search\Global\GatheringManager\FilterProcessMemoryQuota&lt;/TD&gt;
&lt;TD vAlign=top width=135&gt;104,857,600&lt;/TD&gt;
&lt;TD vAlign=top width=135&gt;209,715,200&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=458&gt;HKLM\SOFTWARE\Microsoft\Office Server\12\Search\Global\GatheringManager\FolderHighPriority&lt;/TD&gt;
&lt;TD vAlign=top width=135&gt;50&lt;/TD&gt;
&lt;TD vAlign=top width=168&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;BR&gt;Modifying these registry values has definitely seemed to do the trick for us so far.&amp;nbsp; This was for x64 machines with a lot of RAM, so this might not be a good idea if you are still on x86 and are RAM constrained.&amp;nbsp; I’d like to hear your results, did this work for you?&amp;nbsp; What are your experiences crawling large pages libraries in SharePoint 2007?&lt;/P&gt;
&lt;SCRIPT type=text/javascript&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/SCRIPT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9903222" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>SPWeb.GetFile Hangs when retrieving a publishing page</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/09/29/spweb-getfile-hangs-when-retrieving-a-publishing-page.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/09/29/spweb-getfile-hangs-when-retrieving-a-publishing-page.aspx</id><published>2009-09-29T20:38:00Z</published><updated>2009-09-29T20:38:00Z</updated><content type="html">&lt;P&gt;I’ve been working on a utility for the past few days to manipulate some data on a SharePoint server.&amp;nbsp; This code got the “works on my machine” stamp of approval, but every time we ran it against a backup of production data it would hang after processing a certain number of pages with no errors to be found anywhere.&amp;nbsp; Since this was a backup of production data I tried deleting the file it was hanging on to see if that specific file was the issue…no luck.&amp;nbsp; After a few hours of trying to track down the problem I eventually switched from using SPWeb.GetFile to SPWeb.GetFileOrFolderObject.&amp;nbsp; The only impact this had on my code was I then had to cast the object type returned from GetFileOrFolderObject to SPFile.&amp;nbsp; Magically the hang disappeared.&amp;nbsp; I’m throwing this one in the SharePoint believe it or not bucket and moving on, in case you run into the same issue I’ve shown the difference in code below.&lt;/P&gt;
&lt;P&gt;Here is the original code&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 101.88%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; HEIGHT: 82px; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;
&lt;DIV style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum1&gt;   1:&lt;/SPAN&gt; SPFile article = web.GetFile(articleUrl);&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum2&gt;   2:&lt;/SPAN&gt; articleGuid = article.UniqueId;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the version that worked&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: silver 1px solid; TEXT-ALIGN: left; BORDER-LEFT: silver 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 101.65%; PADDING-RIGHT: 4px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; HEIGHT: 91px; MAX-HEIGHT: 200px; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: silver 1px solid; CURSOR: text; BORDER-RIGHT: silver 1px solid; PADDING-TOP: 4px" id=codeSnippetWrapper&gt;
&lt;DIV style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" id=codeSnippet&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum1&gt;   1:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; spObject = web.GetFileOrFolderObject(articleUrl);&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;PRE style="BORDER-BOTTOM-STYLE: none; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: 'Courier New', courier, monospace; DIRECTION: ltr; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;SPAN style="COLOR: #606060" id=lnum2&gt;   2:&lt;/SPAN&gt; articleGuid = ((SPFile)spObject).UniqueId;&lt;/PRE&gt;&lt;!--CRLF--&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;I’ve shortened these for clarity, obviously you should be checking if you actually got a SPFile object back, but you get the idea.
&lt;SCRIPT type=text/javascript&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/SCRIPT&gt;
 &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9900982" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>I’ve got my SharePoint development environment setup, now what?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/08/18/i-ve-got-my-sharepoint-development-environment-setup-now-what.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/08/18/i-ve-got-my-sharepoint-development-environment-setup-now-what.aspx</id><published>2009-08-17T23:38:00Z</published><updated>2009-08-17T23:38:00Z</updated><content type="html">&lt;P&gt;There are a bunch of posts out there on how to get your SharePoint development environment up and running.&amp;nbsp; A quick search on “Setting up your SharePoint development environment” will yield plenty of results to skim through to fit your needs.&amp;nbsp; However, not many of these articles focus on tips and tricks to make day to day development in SharePoint easier.&amp;nbsp; I’ve compiled some useful tips over the past few years that I wanted to share.&lt;/P&gt;
&lt;H1&gt;Software&lt;/H1&gt;
&lt;P&gt;&lt;A href="http://code.msdn.microsoft.com/SPDisposeCheck" target=_blank mce_href="http://code.msdn.microsoft.com/SPDisposeCheck"&gt;SP Dispose Check&lt;/A&gt; – This is a tool release by Microsoft to check for un-disposed SPSite and SPWeb objects.&amp;nbsp; You should run this on a regular basis, and always before deployment to production.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42&amp;amp;displaylang=en"&gt;SharePoint Designer&lt;/A&gt; – A lot of people overlook SharePoint designer claiming it’s not for “real developers”, but it can be invaluable for quickly manipulating existing SharePoint sites.&amp;nbsp; Real developers know how to use the tools available to them, and this is just another tool.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.red-gate.com/products/reflector/" target=_blank mce_href="http://www.red-gate.com/products/reflector/"&gt;Red Gate .NET Reflector&lt;/A&gt; – This is great for digging into SharePoint assemblies when you want to get intimate with how something works.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.u2u.be/Res/Tools/CamlQueryBuilder.aspx" target=_blank mce_href="http://www.u2u.be/Res/Tools/CamlQueryBuilder.aspx"&gt;U2U Caml Query Builder&lt;/A&gt; – If you are developing for SharePoint you need this, no exceptions.&amp;nbsp; It will make writing CAML queries much, much easier&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.fiddler2.com/fiddler2/" target=_blank mce_href="http://www.fiddler2.com/fiddler2/"&gt;Fiddler&lt;/A&gt; – Great tool for HTTP Request/Response debugging.&amp;nbsp; This comes in handy when debugging AJAX web service calls.&amp;nbsp; Firebug also works good here.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://firefox.com/" target=_blank mce_href="http://firefox.com"&gt;Firefox and Firebug&lt;/A&gt; – Firebug is an extremely useful tool for HTML, CSS and Javascript.&amp;nbsp; If you are doing SharePoint development you are inherently going to be working with these things a lot, hands down Firebug is the best tool for this.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;amp;displaylang=en"&gt;IE Developer Toolbar&lt;/A&gt; – When you need to troubleshoot rendering issues in IE, this tool comes in handy.&amp;nbsp; IE8 has these built in, but anything before that you will need to download the add on.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://codeplex.com/wspbuilder" target=_blank mce_href="http://codeplex.com/wspbuilder"&gt;WSPBuilder&lt;/A&gt; – Absolutely invaluable tool for building solution packages, otherwise known as .wsp’s.&lt;/P&gt;
&lt;H1&gt;OS Modifications&lt;/H1&gt;
&lt;P&gt;&lt;U&gt;Environment Variables&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;First thing you should do is add stsadm to your “Path” variable.&amp;nbsp; This will allow you to execute stsadm from anywhere in your command prompt.&amp;nbsp; You can do this by adding the following to your “Path” variable in environment variables.&amp;nbsp; Don’t delete what is already there, just add to the end.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;c:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would also add SPDispose check if you installed above (I highly recommend it).&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;C:\Program Files\Microsoft\SharePoint Dispose Check\;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I also like to add my bin directory as a new variable to make copying assemblies easier, this works well for team development when not everyone has the same VM as you can all use the same post build steps.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/SettingupyourSharePointdevelopmentenviro_7C79/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/SettingupyourSharePointdevelopmentenviro_7C79/image_2.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://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/SettingupyourSharePointdevelopmentenviro_7C79/image_thumb.png" width=471 height=118 mce_src="http://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/SettingupyourSharePointdevelopmentenviro_7C79/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;U&gt;If you are looking to squeeze every bit of performance out of your VM you can stop the following services:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Windows SharePoint Timer Service – this runs scheduled jobs for SharePoint.&amp;nbsp; If you shut this off some things may not function as you would expect.&amp;nbsp; For example, you need to manually execute .wsp deployments.&amp;nbsp; You can manually run the timer service by calling stsadm –o execadmsvcjobs.&amp;nbsp; This can consume quite a bit of resources, I have always developed with mine off, but be warned, you should understand what this does.&lt;/P&gt;
&lt;P&gt;Windows SharePoint Services Search – If you don’t need search and aren’t developing any components using search on your VM you can turn this service off.&lt;/P&gt;
&lt;P&gt;Office SharePoint Server Search – Same as above.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Quick Access&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;In my quick launch bar I like to add:&lt;/P&gt;
&lt;P&gt;A shortcut to the 12 hive and virtual directory root&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12"&lt;/LI&gt;
&lt;LI&gt;C:\inetpub\wwwroot\wss\VirtualDirectories\80&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;A shortcut to recycle the app pool&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Windows 2008 &lt;BR&gt;%windir%\System32\inetsrv\appcmd.exe recycle apppool "SharePoint - 80"&lt;/LI&gt;
&lt;LI&gt;Windows 2003 &lt;BR&gt;cscript %windir%\system32\iisapp.vbs /a "SharePointDefaultAppPool" /r &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;H1&gt;Visual Studio&lt;/H1&gt;
&lt;P&gt;Add Guid Generator to Tools menu – this used to be there by default, not sure why they removed it, but you really need it for SharePoint development&lt;/P&gt;
&lt;P&gt;Tools / External Tools / Add - c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\guidgen.exe&lt;/P&gt;
&lt;P&gt;That’s all I can think of for now.&amp;nbsp; What tools do you like to use?&amp;nbsp; What did I miss and more importantly what am I missing out on?&lt;/P&gt;
&lt;SCRIPT type=text/javascript&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/SCRIPT&gt;

&lt;SCRIPT type=text/javascript&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/SCRIPT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9873159" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Using custom web services in SharePoint</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/08/17/using-custom-web-services-in-sharepoint.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/08/17/using-custom-web-services-in-sharepoint.aspx</id><published>2009-08-17T20:57:00Z</published><updated>2009-08-17T20:57:00Z</updated><content type="html">&lt;p&gt;If you are developing custom SharePoint applications there is a good chance that you are going to need some custom web services at some point, especially if you are making use of AJAX and JSON.&amp;#160; There is a great &lt;a href="http://msdn.microsoft.com/en-us/library/dd583131(office.11).aspx" target="_blank"&gt;walkthrough over on MSDN&lt;/a&gt; on how to do this, but if you just need a web service to enable AJAX on a page it is a bit of overkill, especially since there is no way to automate deployment on some of the steps they detail.&amp;#160; I also recently saw a presentation where the presenter put his custom web service in a separate web application, I’m going to show that this really isn’t necessary, and you can fully automate your web service deployments through solution packages.&amp;#160; In the long run this method of deployment will make your life much easier.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I use &lt;a href="http://wspbuilder.codeplex.com/" target="_blank"&gt;WSPBuilder&lt;/a&gt; for all my SharePoint development.&amp;#160; I know there are other tools out there but I’ve been using WSPBuilder since 2007 and it hasn’t failed me yet (Thanks Carsten!).&amp;#160; Why fix it if it ain’t broke?&amp;#160; For this reason I always structure my SharePoint projects in the WSPBuilder method, which mirrors the SharePoint 12 Hive.&lt;/p&gt;  &lt;p&gt;The first thing you want to do is create a new class library and build out your folder structure.&amp;#160; You can use “wspbuilder – createfolders” to do this, but it will give you a bunch of folders you won’t need for this.&amp;#160; I opted to create mine by hand.&amp;#160; &lt;/p&gt;  &lt;p&gt;You should then add a folder under “LAYOUTS” to separate your custom code from SharePoint out of the box code.&lt;/p&gt;  &lt;p&gt;In the “LAYOUTS” folder you can add your .asmx file.&amp;#160; Unfortunately Visual Studio won’t let you add web services to a class library project, so I usually just add a text file, rename the extension, and add the appropriate markup inside the file.&lt;/p&gt;  &lt;p&gt;You’ll also want to add the code behind file.&amp;#160; For the purposes of this sample I’ve kept them both in the same assembly, but they don’t have to be.&amp;#160; Here is what my project looks like so far.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/UsingcustomAJAXwebservicesinSharePoint_7CA4/image_4.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://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/UsingcustomAJAXwebservicesinSharePoint_7CA4/image_thumb_1.png" width="410" height="438" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Inside ServiceSample.asmx I have the following single line which tells the web service which code behind assembly and class to use:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;%@ WebService Language=&amp;quot;C#&amp;quot; Class=&amp;quot;CustomWebServiceSample.ServiceSample,CustomWebServiceSample,Version=1.0.0.0,Culture=neutral&amp;quot; %&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Inside ServiceSample.cs I have the following code:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ServiceSample : System.Web.Services.WebService
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        [WebMethod]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetServerName()
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; HttpContext.Current.Server.MachineName; 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        [WebMethod]
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetCurrentSiteUrl()
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; SPContext.Current.Web.Url.ToString();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&amp;#160; &lt;/p&gt;

&lt;p&gt; The important thing to note here is that your SPContext will still be valid, as long as you enter the web service through the appropriate URL.&amp;#160; My development machine is named wssdev, so if I go to the web service through &lt;a href="http://wssdev"&gt;http://wssdev&lt;/a&gt;, I’ll get the context for the root site collection.&amp;#160; If I go to the service through http://wssdev/sites/&amp;lt;sitename&amp;gt;, I’ll get the context for that site collection.&amp;#160; &lt;/p&gt;

&lt;p&gt;I have a post build script that copies my assembly and .asmx file to the appropriate location, if you package this using wspbuilder you won’t have to do this step, but it helps during development.&amp;#160; Here is the script:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@SET TEMPLATEDIR=c:\program files\common files\microsoft shared\web server extensions\12
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;xcopy /e /y bin\debug\CustomWebServiceSample.dll %BINDIR%
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;xcopy /e /y /q 12\* &amp;quot;%TEMPLATEDIR%&amp;quot;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Compile, build/deploy your wsp, or run the post build script, and you should be ready to go.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/UsingcustomAJAXwebservicesinSharePoint_7CA4/image_6.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://blogs.msdn.com/blogfiles/joshuag/WindowsLiveWriter/UsingcustomAJAXwebservicesinSharePoint_7CA4/image_thumb_2.png" width="632" height="541" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;It really is that simple to deploy your custom SharePoint web services.&amp;#160; The important take aways here is that this works with standard solution package deployment and is very simple as opposed to some of the much more complex ways I have seen people doing this.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9873101" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author><category term="Sharepoint" scheme="http://blogs.msdn.com/b/joshuag/archive/tags/Sharepoint/" /></entry><entry><title>Why cheap developers will cost you</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/04/10/why-cheap-developers-will-cost-you.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/04/10/why-cheap-developers-will-cost-you.aspx</id><published>2009-04-10T22:25:26Z</published><updated>2009-04-10T22:25:26Z</updated><content type="html">&lt;p&gt;I’m going to take a break from the normal techno-speak ASP.NET and SharePoint for a minute because I was recently reading something that really struck a chord with me as I’ve been experiencing a lot of it lately.&amp;#160; I was reading &lt;a href="http://thedailywtf.com/Comments/Spaced-Out.aspx"&gt;this article&lt;/a&gt; on &lt;a href="http://thedailywtf.com"&gt;The Daily WTF&lt;/a&gt; today, mainly because I had just submitted an item for their &lt;a href="http://thedailywtf.com/Series/CodeSOD.aspx"&gt;Code Snippet of the Date (CodeSOD)&lt;/a&gt; section.&amp;#160; For those of you who don’t know The Daily WTF and CodeSOD contain articles about real issues developers and IT professionals encounter on a daily basis.&amp;#160; I was reading this article on &lt;a href="http://thedailywtf.com/Articles/Spaced-Out.aspx"&gt;“Spaced Out”&lt;/a&gt; and I came across a comment by someone named Captain Kirk&lt;/p&gt;  &lt;p&gt;&lt;em&gt;As a customer your choices are: &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;1. Hire an experienced competent developer who understands the library functions, knows how to write properly structured code with appropriate variable scope and data types, or &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;2. Hire someone who will produce what appears to be exactly the same output. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;As a customer who doesn't happen to be a developer himself, the above two options translate as: &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;1. Hire an expensive expensive expensive who expensive the expensive expensive, knows how to write expensive expensive code with expensive expensive expensive and expensive expensive, or &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;2. Save a bunch of money and get exactly the same thing. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;At this time I thought to myself, been there, done that.&amp;#160; I kept reading and came across this comment&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Cpt Kirk: who are you? Why don't you put this in a blog and post a link to it so we can all share it? Seriously, the sarcasm &amp;amp; wit may have made my day, but the point is actually very insightful... &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;That second comment was enough to make me write this post. &lt;/p&gt;  &lt;p&gt;Captain Kirk’s comment was sarcastic in nature, but he was echoing the sentiment of the mistake I’ve seen many of my customers make time and time again.&amp;#160; A project I was recently on made the same mistake, hence why I was at The Daily WTF in the first place :).&amp;#160; My goal here is to illustrate why you should care about code quality, and how the upfront cost never really translates to the bottom line.&lt;/p&gt;  &lt;h1 align="center"&gt;Software never ends at version 1.0&lt;/h1&gt;  &lt;p align="left"&gt;Anyone who has ever designed, developed or used any piece of software knows that software is never done at version 1.0.&amp;#160; There will always be another version.&amp;#160; Users are inherently unhappy with any software that is delivered to them (including myself) and good software just takes longer for users to be unhappy about.&amp;#160; A sign of a good developer is his ability to isolate pieces of functionality into neat and tiny boxes.&amp;#160; Low quality code ALWAYS is the opposite of this.&amp;#160; Imagine you are in a large department store, like Macy’s, and you want to buy a white t-shirt.&amp;#160; The only problem is, this “department” store has no departments.&amp;#160; Everything is just thrown together all over the place.&amp;#160; Some on racks, some in boxes, etc.&amp;#160; How much longer would it take you to find that white t-shirt?&amp;#160; The same issue applies to low quality code.&amp;#160; Anytime you need to make a bug fix or feature change/addition it’s going to take at least five times as long because the code is such a mess.&amp;#160; Something that seems like it should take 1 hour to fix could end up taking 2 weeks.&amp;#160; This same issue actually applies during development as well because we all know there are always bugs and changes before you even launch the first version.&lt;/p&gt;  &lt;h1 align="center"&gt;Inconsistencies&lt;/h1&gt;  &lt;p align="left"&gt;Good developers also do another thing that bad developers don’t, they know how to write re-useable, centralized code.&amp;#160; This means that with bad developers you will get inconsistent behavior across your application because the same thing is done in different ways throughout the application.&amp;#160; Have you ever come across a sink where the hot water was on the right and the cold water was on the left?&amp;#160; This probably bothered you because the standard is to have the hot on the left, cold on the right.&amp;#160; When you are writing a custom application this inconsistency translates into bugs, and to compound the problem, when you fix these bugs you usually have to update the code in many places instead of just one.&amp;#160; So in many cases you can introduce more bugs by fixing the original ones.&amp;#160; In turn this results in longer development and test cycles.&lt;/p&gt;  &lt;h1 align="center"&gt;Performance&lt;/h1&gt;  &lt;p align="left"&gt;This is a big one because most customers I come across don’t give this a thought.&amp;#160; They think that developers just build applications and they are going to work and respond well.&amp;#160; Good developers think about performance all the time, they don’t obsess over it, but it’s always in their mind.&amp;#160; Bad developers don’t even flirt with the topic, if they even understand the performance implications of what they are doing.&amp;#160; This means that unless your application is very small and for a very small set of users, you are going to spend a good amount of time at the end of your project doing performance tuning that you probably didn’t plan for.&lt;/p&gt;  &lt;h1 align="center"&gt;Maintenance and Operations&lt;/h1&gt;  &lt;p align="left"&gt;Bad developers write the kind of code that your IT department loathes.&amp;#160; This is the application that is always breaking and causing them heartache.&amp;#160; In the long run this application is going to cost you a whole lot more to support and maintain then a well written one would.&amp;#160; Your users will have disdain for it as well, is that the kind of legacy you want to leave behind?&lt;/p&gt;  &lt;h1 align="center"&gt;Get what you want&lt;/h1&gt;  &lt;p align="left"&gt;In the end the bad developers will probably satisfy the requirements, and they may or may not end up delivering the first version for cheaper than the good developers would have.&amp;#160; The reality is, you aren’t going to get what you want, they never are going to deliver more than expected and give you something that really blows people away.&amp;#160; Do you want something that just makes the grade, or do you want something that was better than you expected?&amp;#160; If you have a health problem and are looking for a doctor, do you look for the cheapest one that does what you need?&amp;#160; Or do you look for the one that will do the best job?&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;Writing this may not have any impact, but it did make me feel a little better :).&amp;#160; If I save just one project manager from this mistake then it was worth it.&amp;#160; Happy coding!&lt;/p&gt;  &lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt; &lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9543870" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author><category term="Project Management" scheme="http://blogs.msdn.com/b/joshuag/archive/tags/Project+Management/" /></entry><entry><title>DataFormWebPart Parameters and ParameterBindings</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/04/06/dataformwebpart-parameters-and-parameterbindings.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/04/06/dataformwebpart-parameters-and-parameterbindings.aspx</id><published>2009-04-07T01:47:40Z</published><updated>2009-04-07T01:47:40Z</updated><content type="html">&lt;p&gt;Since my post on &lt;a href="http://blogs.msdn.com/joshuag/archive/2008/11/10/easily-making-the-data-form-web-part-reusable.aspx"&gt;Easily Making the DataFormWebPart Reuseable&lt;/a&gt;, I’ve had a couple questions on the parameters and how to make use of them.&amp;#160; I’m going to attempt to document some of the more useful parameters, but hopefully provide a framework for you to be able to figure out how to do anything you may need with the DFWP. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The first thing you need inside your DFWP is a data source.&amp;#160; This goes inside the &amp;lt;DataSources&amp;gt; node in the DFWP markup.&amp;#160; You’ll notice I put some “DataFormParameters” inside the &amp;lt;SelectParameters&amp;gt; node.&lt;/p&gt;    &lt;pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;SharePoint&lt;/span&gt;:&lt;span style="color: #800000"&gt;SPDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;		&lt;span style="color: #ff0000"&gt;DataSourceMode&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;List&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;		&lt;span style="color: #ff0000"&gt;UseInternalName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;p&gt;		&lt;span style="color: #ff0000"&gt;selectcommand&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;&amp;lt;View&amp;gt;&amp;lt;Query&amp;gt;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name='Meal'/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;                       &amp;lt;Value Type='Choice'&amp;gt;{MealQs}&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&amp;lt;/Query&amp;gt;&amp;lt;/View&amp;gt;&amp;quot;&lt;/span&gt; 
&lt;/p&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;p&gt;		&lt;span style="color: #ff0000"&gt;id&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Cafeteria_x0020_Menu1&amp;quot;&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;SelectParameters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;                           &lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;WebPartPages&lt;/span&gt;:&lt;span style="color: #800000"&gt;DataFormParameter&lt;/span&gt; 
&lt;/p&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;			&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ListName&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;			&lt;span style="color: #ff0000"&gt;ParameterKey&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ListName&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;			&lt;span style="color: #ff0000"&gt;PropertyName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ParameterValues&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;p&gt;			&lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Cafeteria Menu&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;                           &lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;WebPartPages&lt;/span&gt;:&lt;span style="color: #800000"&gt;dataformparameter&lt;/span&gt; 
&lt;/p&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;			&lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;			&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Meal&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;			&lt;span style="color: #ff0000"&gt;ParameterKey&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Meal&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;			&lt;span style="color: #ff0000"&gt;PropertyName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ParameterValues&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;p&gt;			&lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Breakfast&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;                           &lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;WebPartPages&lt;/span&gt;:&lt;span style="color: #800000"&gt;dataformparameter&lt;/span&gt; 
&lt;/p&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;			&lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;server&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;			&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MealQs&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;			&lt;span style="color: #ff0000"&gt;ParameterKey&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MealQs&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;			&lt;span style="color: #ff0000"&gt;PropertyName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;ParameterValues&amp;quot;&lt;/span&gt; 
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;			&lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Breakfast&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;		&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;SelectParameters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;		&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;SharePoint&lt;/span&gt;:&lt;span style="color: #800000"&gt;SPDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;/pre&gt;

  &lt;p&gt;In this example I’m using ListName, this allows me to reference the list by name instead of GUID, making this solution re-useable on other SharePoint sites since every time a list is created it get’s a new GUID.&lt;/p&gt;

  &lt;p&gt;I’ve also added two parameters to pickup the meal I’m trying to display.&amp;#160; One of these parameters comes from a drop down list on the page, the other comes from a query string variable.&amp;#160; More on this later.&lt;/p&gt;

  &lt;p&gt;If you want to limit the number of rows in a query you can include the “MaximumRows” parameter in your &amp;lt;SelectParameters&amp;gt; section.&lt;/p&gt;

  &lt;pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&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;Parameter&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MaximumRows&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;500&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

  &lt;p&gt;By default, the DFWP will query the current sub site. If you are looking to query items from a list in another sub site you can include the “WebUrl” parameter.&amp;#160; Possible options here are “{sitecollectionroot}” or the path to the actual web “/services/cafeteria”.&lt;/p&gt;

  &lt;pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&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;Parameter&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;WebUrl&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{sitecollectionroot}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

  &lt;p&gt;Next is the &amp;lt;ParameterBindings&amp;gt; section.&amp;#160; This is where you can bind variables in your query to controls or the querystring.&lt;/p&gt;

  &lt;pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ParameterBinding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;UserID&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Location&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CAMLVariable&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CurrentUserName&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ParameterBinding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Today&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Location&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CAMLVariable&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CurrentDate&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ParameterBinding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Meal&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Location&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Control(ddlMeal)&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Breakfast&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ParameterBinding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MealQs&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Location&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;QueryString(m)&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultValue&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Breakfast&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;/pre&gt;&lt;/pre&gt;

  &lt;p&gt;“UserID” and “Today” are two variables inserted automatically by SharePoint.&amp;#160; I’m not sure what else is available here, if anyone has any more info on that I’d love to know.&lt;/p&gt;

  &lt;p&gt;“Meal” and “MealQs” are two that I created to bind to the query above.&amp;#160; You’ll notice in the “selectcommand” that I’m referencing “{MealQs}”.&amp;#160; Here is where I declare that “MealQs” is a value from the querystring variable m.&amp;#160; So adding “?m=breakfast” onto the end of my URL will give me only breakfast items.&lt;/p&gt;

  &lt;p&gt;“Meal” does the same thing as MealQs except it is bound to a drop down list I created called “ddlMeal”.&lt;/p&gt;

  &lt;p&gt;In summary, to bind to a control the syntax is “Control(id of the control)”.&amp;#160; To bind to a querystring variable the syntax is “QueryString(variable name)”.&amp;#160; Once you do this step you are free to use these in your “selectcommand” in your SPDataSource.&lt;/p&gt;

  &lt;p&gt;Hope that was helpful.&amp;#160; If there are any other topics or questions you want to know about concerning the DataFormWebPart let me know, if there is interest in something I’ll write up a post about it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9534634" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Changing the SharePoint Welcome Page through code</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/joshuag/archive/2009/04/06/changing-the-sharepoint-welcome-page-through-code.aspx" /><id>http://blogs.msdn.com/b/joshuag/archive/2009/04/06/changing-the-sharepoint-welcome-page-through-code.aspx</id><published>2009-04-07T01:13:30Z</published><updated>2009-04-07T01:13:30Z</updated><content type="html">&lt;p&gt;Sometimes you will have a feature that you activate on a sub site where you want to change the “Welcome Page” or landing page to be a custom one that you provision through your feature.&amp;#160; I was doing this the other day and realized that it isn’t blatantly obvious through Intellisense because it is called “DefaultPage”.&amp;#160; Here is a sample on how you would change default.aspx to be a file home.aspx that you have just created.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(rootWeb);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;SPFile homePageFile = rootWeb.GetFile(&amp;quot;&lt;span style="color: #8b0000"&gt;Pages/Home.aspx&lt;/span&gt;&amp;quot;);
&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #fbfbfb"&gt;&lt;p&gt;pubWeb.DefaultPage = homePageFile;&lt;/p&gt;&lt;/pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Hope that comes in handy at some point.&lt;/p&gt;

&lt;script type="text/javascript"&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
try {
var pageTracker = _gat._getTracker("UA-5879214-1");
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9534567" width="1" height="1"&gt;</content><author><name>joshuag</name><uri>http://blogs.msdn.com/joshuag/ProfileUrlRedirect.ashx</uri></author></entry></feed>