<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4727666002079866855</id><updated>2011-12-22T17:56:44.874+01:00</updated><category term='webservice'/><category term='c#'/><category term='sharepoint'/><category term='permissions'/><category term='technical stuff'/><category term='connection string'/><category term='javascript'/><category term='free webhosting'/><category term='modal dialog'/><category term='asp.net'/><category term='TableAdapters'/><category term='crm'/><category term='postback'/><category term='config file'/><category term='technical shizzle'/><category term='.NET 2.0'/><category term='typed datasets'/><category term='crm 4.0'/><category term='DTC'/><title type='text'>Koen Roos blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-7242877917130565000</id><published>2010-11-08T20:44:00.003+01:00</published><updated>2011-06-15T07:15:30.667+01:00</updated><title type='text'>SharePoint - 401: Unauthorized downloading Infopath file with WebClient.DownloadFile</title><content type='html'>Today, I got an "401: Unauthorized" exception when calling the WebClient.DownloadFile method to download an Infopath file from SharePoint, even if I provided the correct permissions (setting the WebClient.Credentials property).&lt;br /&gt;&lt;br /&gt;This was because of the Infopath Forms Server feature in MOSS 2007 Enterprise edition. This feature redirects to the /_layouts/FormServer.aspx page, apparently this was resulting in an Unauthorized exception.&lt;br /&gt;&lt;br /&gt;A workaround is to add "?NoRedirect=true" to the url, like this: http://ServerName/sites/SiteCollection/FormLibrary/Form1.xml?NoRedirect=true.&lt;br /&gt;&lt;br /&gt;More information about some Query Parameters you can use on the /_layouts/FormServer.aspx page: http://msdn.microsoft.com/en-us/library/ms772417.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-7242877917130565000?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/7242877917130565000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=7242877917130565000' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7242877917130565000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7242877917130565000'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2010/11/sharepoint-401-unauthorized-when.html' title='SharePoint - 401: Unauthorized downloading Infopath file with WebClient.DownloadFile'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-452867558694034082</id><published>2010-09-20T20:16:00.005+01:00</published><updated>2010-09-20T20:19:37.716+01:00</updated><title type='text'>CRM 2011 beta - integration with SharePoint 2010 (the real stuff)</title><content type='html'>The SharePoint Solution for the integration with CRM 2011 is fixed, you can download it here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0c7dcc45-9d41-4e2e-8126-895517b4274c&amp;displayLang=en&lt;br /&gt;&lt;br /&gt;Some screenshots of the layout of the Sharepoint folder in CRM (looking good!):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_oEgw2eFcnq4/TJezem_ZFTI/AAAAAAAAAGg/Gys5amS7oX8/s1600/1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://1.bp.blogspot.com/_oEgw2eFcnq4/TJezem_ZFTI/AAAAAAAAAGg/Gys5amS7oX8/s400/1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5519077206809711922" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_oEgw2eFcnq4/TJezkfo-bMI/AAAAAAAAAGo/kCF3uTWhujo/s1600/2.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://1.bp.blogspot.com/_oEgw2eFcnq4/TJezkfo-bMI/AAAAAAAAAGo/kCF3uTWhujo/s400/2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5519077307915857090" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oEgw2eFcnq4/TJezpzr3hYI/AAAAAAAAAGw/qgw5S6XO2sk/s1600/3.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/TJezpzr3hYI/AAAAAAAAAGw/qgw5S6XO2sk/s400/3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5519077399196042626" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_oEgw2eFcnq4/TJezuy3uOPI/AAAAAAAAAG4/BE9MLKeYugQ/s1600/4.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://3.bp.blogspot.com/_oEgw2eFcnq4/TJezuy3uOPI/AAAAAAAAAG4/BE9MLKeYugQ/s400/4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5519077484876675314" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-452867558694034082?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/452867558694034082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=452867558694034082' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/452867558694034082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/452867558694034082'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2010/09/crm-2011-beta-integration-with_20.html' title='CRM 2011 beta - integration with SharePoint 2010 (the real stuff)'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_oEgw2eFcnq4/TJezem_ZFTI/AAAAAAAAAGg/Gys5amS7oX8/s72-c/1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-1520945065930685067</id><published>2010-09-14T19:53:00.007+01:00</published><updated>2010-09-14T20:05:56.431+01:00</updated><title type='text'>CRM 2011 beta - integration with SharePoint 2010</title><content type='html'>Microsoft CRM 2011 beta is available. I was curious about the SharePoint integration in CRM 2011. Unfortunately, the Sharepoint solution delivered with the beta release wasn't working (I was getting errors "Could not load file or assembly 'Microsoft.Crm.SharePoint.CrmGridFeature' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key", a reply from Microsoft CRM Support is added, saying there are some unsigned bits - http://social.microsoft.com/Forums/en-US/crm2011beta/thread/8d195290-6bfa-4d4b-a1a9-ad21bb296ad2), hope they will post an update soon!&lt;br /&gt;&lt;br /&gt;The SharePoint solution is required to have CRM creating Sharepoint folders automatically when adding a new record. However, it is possible to add Sharepoint locations manually to a record too. Some screenshots: &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_oEgw2eFcnq4/TI_GGSKYLXI/AAAAAAAAAFo/SJ2rH8K_NbA/s1600/1.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_oEgw2eFcnq4/TI_GGSKYLXI/AAAAAAAAAFo/SJ2rH8K_NbA/s400/1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516845879809027442" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GV1n_J0I/AAAAAAAAAFw/coXFtszjqL8/s1600/2.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GV1n_J0I/AAAAAAAAAFw/coXFtszjqL8/s400/2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516846147026495298" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GdMmGFQI/AAAAAAAAAF4/36eKCzHoGSs/s1600/3.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GdMmGFQI/AAAAAAAAAF4/36eKCzHoGSs/s400/3.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516846273451660546" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_oEgw2eFcnq4/TI_GlDNzqMI/AAAAAAAAAGA/DKNzq4AZE5E/s1600/4.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_oEgw2eFcnq4/TI_GlDNzqMI/AAAAAAAAAGA/DKNzq4AZE5E/s400/4.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516846408372824258" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GqbUNXdI/AAAAAAAAAGI/LFqNt-BNf6Q/s1600/5.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GqbUNXdI/AAAAAAAAAGI/LFqNt-BNf6Q/s400/5.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516846500741471698" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GwcR1MsI/AAAAAAAAAGQ/Z-bQxVF2JWg/s1600/6.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_GwcR1MsI/AAAAAAAAAGQ/Z-bQxVF2JWg/s400/6.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516846604079149762" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_G1JCGa8I/AAAAAAAAAGY/f-isQ1YWEzQ/s1600/7.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/TI_G1JCGa8I/AAAAAAAAAGY/f-isQ1YWEzQ/s400/7.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5516846684812241858" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-1520945065930685067?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/1520945065930685067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=1520945065930685067' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1520945065930685067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1520945065930685067'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2010/09/crm-2011-beta-integration-with.html' title='CRM 2011 beta - integration with SharePoint 2010'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_oEgw2eFcnq4/TI_GGSKYLXI/AAAAAAAAAFo/SJ2rH8K_NbA/s72-c/1.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5883643821650375627</id><published>2010-03-31T16:45:00.011+01:00</published><updated>2010-04-01T19:35:17.823+01:00</updated><title type='text'>SharePoint 2010: CamlQuery on External List</title><content type='html'>When running a CamlQuery on an External List, we got an error "The given key was not present in the dictionary.".&lt;br /&gt;&lt;br /&gt;Apparently you have to specify the &amp;lt;ViewFields&amp;gt; tag in the CamlQuery.ViewXml property. So you have to specify the &amp;lt;ViewFields&amp;gt;&amp;lt;/ViewFields&amp;gt; tag with the right fields in the ViewXml property.&lt;br /&gt;&lt;br /&gt;For example, this will NOT work:&lt;br /&gt;&lt;blockquote&gt;camlQuery.ViewXml = @"&lt;br /&gt;    &amp;lt;Method Name='ReadList'/&amp;gt;&lt;br /&gt;    &amp;lt;Query&amp;gt;&lt;br /&gt;     &amp;lt;Where&amp;gt;&lt;br /&gt;                &amp;lt;Contains&amp;gt;&lt;br /&gt;           &amp;lt;FieldRef Name='Name'/&amp;gt;&lt;br /&gt;                    &amp;lt;Value Type='Text'&amp;gt;AAS&amp;lt;/Value&amp;gt;&lt;br /&gt;                &amp;lt;/Contains&amp;gt;&lt;br /&gt;     &amp;lt;/Where&amp;gt;&lt;br /&gt;            &amp;lt;OrderBy&amp;gt;&lt;br /&gt;                &amp;lt;FieldRef Name='Name'/&amp;gt;&lt;br /&gt;            &amp;lt;/OrderBy&amp;gt;&lt;br /&gt;    &amp;lt;/Query&amp;gt;&lt;br /&gt;   &amp;lt;/View&amp;gt;";&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;... but this will work:&lt;br /&gt;&lt;blockquote&gt;camlQuery.ViewXml = @"&lt;br /&gt;    &amp;lt;Method Name='ReadList'/&amp;gt;&lt;br /&gt;    &amp;lt;Query&amp;gt;&lt;br /&gt;     &amp;lt;Where&amp;gt;&lt;br /&gt;                &amp;lt;Contains&amp;gt;&lt;br /&gt;           &amp;lt;FieldRef Name='Name'/&amp;gt;&lt;br /&gt;                    &amp;lt;Value Type='Text'&amp;gt;AAS&amp;lt;/Value&amp;gt;&lt;br /&gt;                &amp;lt;/Contains&amp;gt;&lt;br /&gt;     &amp;lt;/Where&amp;gt;&lt;br /&gt;            &amp;lt;OrderBy&amp;gt;&lt;br /&gt;                &amp;lt;FieldRef Name='Name'/&amp;gt;&lt;br /&gt;            &amp;lt;/OrderBy&amp;gt;&lt;br /&gt;    &amp;lt;/Query&amp;gt;&lt;br /&gt;    &lt;strong&gt;&amp;lt;ViewFields&amp;gt;&lt;br /&gt;     &amp;lt;FieldRef Name='AccountID' ListItemMenu='TRUE' LinkToItem='TRUE'/&amp;gt;&lt;br /&gt;     &amp;lt;FieldRef Name='Name'/&amp;gt;&lt;br /&gt;    &amp;lt;/ViewFields&amp;gt;&lt;/strong&gt;&lt;br /&gt;    &lt;br /&gt;   &amp;lt;/View&amp;gt;";&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;To find out the XML you have to use for the &amp;lt;ViewFields&amp;gt; tag, you can add a ListView webpart of your External List to a page and grab the &amp;lt;ViewFields&amp;gt; XML by opening the page in SharePoint Designer:&lt;br /&gt; &lt;a href="http://4.bp.blogspot.com/_oEgw2eFcnq4/S7NvljkU6fI/AAAAAAAAAFY/1W_690WCpfg/s1600/spd.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 277px;" src="http://4.bp.blogspot.com/_oEgw2eFcnq4/S7NvljkU6fI/AAAAAAAAAFY/1W_690WCpfg/s400/spd.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5454826264669252082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I read this solution here: http://blog.trivadis.com/blogs/stefanfrutiger/archive/2010/03/15/sharepoint-2010-bcs-zugriff-auf-externe-daten-aus-einer-silverlight-4-applikation.aspx. Luckely, I understand a little bit German ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5883643821650375627?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5883643821650375627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5883643821650375627' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5883643821650375627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5883643821650375627'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2010/03/sharepoint-2010-camlquery-on-external.html' title='SharePoint 2010: CamlQuery on External List'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_oEgw2eFcnq4/S7NvljkU6fI/AAAAAAAAAFY/1W_690WCpfg/s72-c/spd.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-472655313223905960</id><published>2010-01-23T15:21:00.005+01:00</published><updated>2010-01-23T15:38:54.790+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sharepoint'/><title type='text'>Validate url to be used for a SharePoint site (replace illegal characters)</title><content type='html'>&lt;p&gt;&lt;br /&gt;I made a function to check if a string contains illegal characters to be used as an URL for a new SharePoint site. This is useful to use when calling the Webs.Add function to programmatically create a new site in SharePoint where a user has provided the desired site url.&lt;br /&gt;&lt;br /&gt;I took a look at the Create Site page in SharePoint. SharePoint calls a JavaScript function "IndexOfIllegalCharInUrlLeafName", which can be found in the "commonvalidation.js" on your SharePoint server. After the function call, SharePoint will check for a '+' character separately.&lt;br /&gt;&lt;br /&gt;This is the function i've created. Illegal characters are replaced with a '-' character. &lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;(&lt;a href="http://www.koenroos.be/blog/validatestringurlcode.txt"&gt;you can download the code in a text file here&lt;/a&gt;)&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_oEgw2eFcnq4/S1sJKZNY4MI/AAAAAAAAAEw/YpKvP9u9b2w/s1600-h/validatestringurlcode.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 360px; height: 400px;" src="http://3.bp.blogspot.com/_oEgw2eFcnq4/S1sJKZNY4MI/AAAAAAAAAEw/YpKvP9u9b2w/s400/validatestringurlcode.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5429943849895649474" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-472655313223905960?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/472655313223905960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=472655313223905960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/472655313223905960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/472655313223905960'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2010/01/validate-url-to-be-used-for-sharepoint.html' title='Validate url to be used for a SharePoint site (replace illegal characters)'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_oEgw2eFcnq4/S1sJKZNY4MI/AAAAAAAAAEw/YpKvP9u9b2w/s72-c/validatestringurlcode.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5377157382494928413</id><published>2009-12-23T14:54:00.006+01:00</published><updated>2009-12-24T08:37:53.689+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='webservice'/><category scheme='http://www.blogger.com/atom/ns#' term='crm'/><category scheme='http://www.blogger.com/atom/ns#' term='crm 4.0'/><title type='text'>MS CRM 4.0 - Call RetrieveMultiple webservice in JavaScript helper function</title><content type='html'>I've developed a function to call the CRM RetrieveMultiple webservice in JavaScript without having to write the XML yourselve: "CallRetrieveMultipleWebService".&lt;br /&gt;&lt;br /&gt;The function generates the XML for you. You just have to pass the entity to query, an array of columns to get, the filter operator and the array of conditions.&lt;br /&gt;&lt;br /&gt;Here's the function with an example how to call the webservice to find contacts with a first- and lastname as conditions.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function CallRetrieveMultipleWebService(queryEntityName, queryColumnSetAttributes, queryFilterOperator, conditionArray) {&lt;br /&gt;if (queryEntityName != null &amp;amp;&amp;amp; queryColumnSetAttributes != null) {&lt;br /&gt;var columnSetAttributesString = "";&lt;br /&gt;for (var i = 0; i &lt; queryColumnSetAttributes.length; i++) {&lt;br /&gt;columnSetAttributesString += "&lt;q1:attribute&gt;" + queryColumnSetAttributes[i] + "&lt;/q1:Attribute&gt;";&lt;br /&gt;}&lt;br /&gt;var conditionsString = "";&lt;br /&gt;if (conditionArray != null) {&lt;br /&gt;conditionsString = "&lt;q1:conditions&gt;";&lt;br /&gt;for (var i = 0; i &lt; conditionArray.length; i++) {&lt;br /&gt;conditionsString += "&lt;q1:condition&gt;";&lt;br /&gt;conditionsString += "&lt;q1:attributename&gt;" + conditionArray[i][0] + "&lt;/q1:AttributeName&gt;";&lt;br /&gt;conditionsString += "&lt;q1:operator&gt;" + conditionArray[i][1] + "&lt;/q1:Operator&gt;";&lt;br /&gt;conditionsString += "&lt;q1:values&gt;";&lt;br /&gt;var valuesArray = conditionArray[i][2];&lt;br /&gt;for (var j = 0; j &lt; valuesArray.length; j++) {&lt;br /&gt;conditionsString += "&lt;q1:value type="'xsd:string'"&gt;" + valuesArray[j] + "&lt;/q1:Value&gt;";&lt;br /&gt;}&lt;br /&gt;conditionsString += "&lt;/q1:Values&gt;";&lt;br /&gt;conditionsString += "&lt;/q1:Condition&gt;";&lt;br /&gt;}&lt;br /&gt;conditionsString += "&lt;/q1:Conditions&gt;";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var xml = "" +&lt;br /&gt;"&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" +&lt;br /&gt;"&lt;soap:envelope soap="\" xsi="\" xsd="\"&gt;" +&lt;br /&gt;GenerateAuthenticationHeader() +&lt;br /&gt;" &lt;soap:body&gt;" +&lt;br /&gt;" &lt;retrievemultiple xmlns="\"&gt;" +&lt;br /&gt;" &lt;query q1="\" type="\"&gt;" +&lt;br /&gt;" &lt;q1:entityname&gt;" + queryEntityName + "&lt;/q1:EntityName&gt;" +&lt;br /&gt;" &lt;q1:columnset type="\"&gt;" +&lt;br /&gt;" &lt;q1:attributes&gt;" +&lt;br /&gt;columnSetAttributesString +&lt;br /&gt;" &lt;/q1:Attributes&gt;" +&lt;br /&gt;" &lt;/q1:ColumnSet&gt;" +&lt;br /&gt;"&lt;q1:criteria&gt;" +&lt;br /&gt;"&lt;q1:filteroperator&gt;" + queryFilterOperator + "&lt;/q1:FilterOperator&gt;" +&lt;br /&gt;conditionsString +&lt;br /&gt;"&lt;/q1:Criteria&gt;" +&lt;br /&gt;" &lt;/query&gt;" +&lt;br /&gt;" &lt;/retrievemultiple&gt;" +&lt;br /&gt;" &lt;/soap:Body&gt;" +&lt;br /&gt;"&lt;/soap:Envelope&gt;" +&lt;br /&gt;"";&lt;br /&gt;&lt;br /&gt;var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");&lt;br /&gt;xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);&lt;br /&gt;xmlHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");&lt;br /&gt;xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");&lt;br /&gt;xmlHttpRequest.setRequestHeader("Content-Length", xml.length);&lt;br /&gt;xmlHttpRequest.send(xml);&lt;br /&gt;var resultXml = xmlHttpRequest.responseXML;&lt;br /&gt;// Check for errors.&lt;br /&gt;var errorCount = resultXml.selectNodes('//error').length;&lt;br /&gt;if (errorCount != 0) {&lt;br /&gt;var msg = resultXml.selectSingleNode('//description').nodeTypedValue;&lt;br /&gt;alert(msg);&lt;br /&gt;}&lt;br /&gt;// return results&lt;br /&gt;else {&lt;br /&gt;return resultXml;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt; &lt;/p&gt;&lt;p&gt;//function to find a contact, using the CallRetrieveMultipleWebService function:&lt;br /&gt;function FindContact(firstnameToSearch, lastnameToSearch)&lt;br /&gt;{&lt;br /&gt;//define the entity name to query&lt;br /&gt;var queryEntityName = "contact";&lt;br /&gt;//set up the array of columns to get&lt;br /&gt;var queryColumnSetAttributes = new Array();&lt;br /&gt;queryColumnSetAttributes[0] = "contactid";&lt;br /&gt;queryColumnSetAttributes[1] = "telephone1";&lt;br /&gt;//define the filter operator&lt;br /&gt;var queryFilterOperator = "And";&lt;br /&gt;//set up the array of confitions in the query&lt;br /&gt;var queryConditions = new Array();&lt;br /&gt;//define 2 conditions: add 2 items to the array:&lt;br /&gt;queryConditions[0] = new Array("firstname", "Equal", new Array(firstnameToSearch));&lt;br /&gt;queryConditions[1] = new Array("lastname", "Equal", new Array(lastnameToSearch));&lt;br /&gt;//Call function CallRetrieveMultipleWebService&lt;br /&gt;var resultXml = CallRetrieveMultipleWebService(queryEntityName, queryColumnSetAttributes, queryFilterOperator, queryConditions);&lt;br /&gt;var teleponeValueToSet = null;&lt;br /&gt;var results = resultXml.getElementsByTagName('BusinessEntity');&lt;br /&gt;if (results.length &gt; 0) {&lt;br /&gt;//do something with the found contacts&lt;br /&gt;//example: show an alert with the telephone number of the first found contact&lt;br /&gt;var telephone = results[0].selectSingleNode('./q1:telephone1') == null ? null : results[0].selectSingleNode('./q1:telephone1').nodeTypedValue;&lt;br /&gt;if (telephone != null) {&lt;br /&gt;alert(telephone);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;alert('No contact ' + firstnameToSearch + ' ' + lastnameToSearch + ' found.');&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5377157382494928413?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5377157382494928413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5377157382494928413' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5377157382494928413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5377157382494928413'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/12/ms-crm-40-call-retrievemultiple.html' title='MS CRM 4.0 - Call RetrieveMultiple webservice in JavaScript helper function'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-7962824302388487346</id><published>2009-12-08T20:29:00.003+01:00</published><updated>2009-12-08T20:35:40.304+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='crm'/><category scheme='http://www.blogger.com/atom/ns#' term='crm 4.0'/><title type='text'>MS CRM 4.0: Publish workflow not working after updating to Rollup 7</title><content type='html'>After updating my CRM 4.0 software to Rollup 7, the publishing of workflows failed.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Apparently, this is a known issue. Found the solution in this forum: https://community.dynamics.com/forums/t/18135.aspx&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-7962824302388487346?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/7962824302388487346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=7962824302388487346' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7962824302388487346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7962824302388487346'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/12/ms-crm-40-publish-workflow-not-working.html' title='MS CRM 4.0: Publish workflow not working after updating to Rollup 7'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-2729515740179972084</id><published>2009-11-21T19:48:00.003+01:00</published><updated>2009-11-23T15:10:52.490+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='crm'/><category scheme='http://www.blogger.com/atom/ns#' term='permissions'/><category scheme='http://www.blogger.com/atom/ns#' term='crm 4.0'/><title type='text'>MS CRM: Insufficient permissions Assign Case</title><content type='html'>When you get a "Insufficient permissions" message when you assign a case, check that your current user's permission roles has Read permissions on Queue.&lt;br /&gt;&lt;br /&gt;When you get a message about user permissions, you can find out what permissions are needed for the action you want to do by doing the steps described on &lt;a href="http://support.microsoft.com/kb/953962"&gt;http://support.microsoft.com/kb/953962&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-2729515740179972084?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/2729515740179972084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=2729515740179972084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/2729515740179972084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/2729515740179972084'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/11/ms-crm-insufficient-permissions-assign.html' title='MS CRM: Insufficient permissions Assign Case'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5692898145742840151</id><published>2009-11-07T14:33:00.002+01:00</published><updated>2009-11-07T14:35:19.212+01:00</updated><title type='text'>MS CRM 4.0 development: useful links</title><content type='html'>Here are some links that helped me with developing MS CRM 4.0 solutions the last couple of weeks.&lt;br /&gt;&lt;br /&gt;Checkbox style Multi-Select Picklist&lt;br /&gt;&lt;a href="http://blogs.msdn.com/crm/archive/2009/03/31/crm-4-0-checkbox-style-multi-select-picklist.aspx"&gt;http://blogs.msdn.com/crm/archive/2009/03/31/crm-4-0-checkbox-style-multi-select-picklist.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Using the Advanced Find for FetchXML builder&lt;br /&gt;&lt;a href="http://ronaldlemmen.blogspot.com/2006/11/using-advanced-find-for-fetchxml.html"&gt;http://ronaldlemmen.blogspot.com/2006/11/using-advanced-find-for-fetchxml.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;ReadOnly and Disabled Fields&lt;br /&gt;&lt;a href="http://customerfx.com/pages/crmdeveloper/2006/03/06/17312.aspx"&gt;http://customerfx.com/pages/crmdeveloper/2006/03/06/17312.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hiding the left navigation panel on a CRM entity&lt;br /&gt;&lt;a href="http://marcoamoedo.com/blog/hiding-the-left-navigation-panel-on-a-crm-entity/"&gt;http://marcoamoedo.com/blog/hiding-the-left-navigation-panel-on-a-crm-entity/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Creating Master Detail views in Dynamics CRM&lt;br /&gt;&lt;a href="http://marcoamoedo.com/blog/creating-master-detail-views-in-dynamics-crm/"&gt;http://marcoamoedo.com/blog/creating-master-detail-views-in-dynamics-crm/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Collapsable Form Sections – a bit of the future in CRM 4&lt;br /&gt;&lt;a href="http://marcoamoedo.com/blog/collapsable-form-sections-ndash-a-bit-of-the-future-in-crm-4/"&gt;http://marcoamoedo.com/blog/collapsable-form-sections-ndash-a-bit-of-the-future-in-crm-4/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Minimum Dynamics CRM Permissions&lt;br /&gt;&lt;a href="http://www.orbitone.com/en/blog/archive/2009/10/06/minimum-dynamics-crm-permissions.aspx"&gt;http://www.orbitone.com/en/blog/archive/2009/10/06/minimum-dynamics-crm-permissions.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5692898145742840151?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5692898145742840151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5692898145742840151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5692898145742840151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5692898145742840151'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/11/ms-crm-40-development-useful-links.html' title='MS CRM 4.0 development: useful links'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8150491233194743824</id><published>2009-08-20T18:54:00.000+01:00</published><updated>2009-08-20T18:55:51.565+01:00</updated><title type='text'>Problem with Sharepoint Datasheet View after installing an Office 2007 component when Office 2003 is already installed</title><content type='html'>&lt;div&gt;When we installed Project 2007 on a machine with Office 2003 already installed, the Datasheet view didn't work anymore: "The list cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Windows SharePoint Services is not installed, your browser does not support ActiveX controls, or support for ActiveX controls is disabled". &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Apparently, the Datasheet view component does not work when Office 2003 and Office 2007 components both are installed on the client machine.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is the solution:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Install Office 2003, include the Windows SharePoint Services Support&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Install the Office 2007 component(s) (in my case, this was Project 2007), &lt;b&gt;without &lt;/b&gt;Windows SharePoint Services Support!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Now re-run the Office 2003 installation. Choose Repair and then select the &lt;b&gt;Reinstall &lt;/b&gt;option.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8150491233194743824?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8150491233194743824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8150491233194743824' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8150491233194743824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8150491233194743824'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/08/problem-with-sharepoint-datasheet-view.html' title='Problem with Sharepoint Datasheet View after installing an Office 2007 component when Office 2003 is already installed'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-4622696420665903201</id><published>2009-06-23T22:27:00.000+01:00</published><updated>2009-06-23T22:28:16.057+01:00</updated><title type='text'>MS CRM 4.0 Custom Workflow Activity assembly update not executing the new code</title><content type='html'>&lt;p class="MsoNormal"&gt;When you are developing a custom workflow  activity for MS CRM 4.0, you have to register this activity with the Plugin  Registration Tool provided by MS CRM 4.0 SDK.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;When I changed the code of my workflow  activity, and tried the Update action in de Plugin Registration Tool, the new  code did not execute, it executed the cached version of the previous code. To  get your new code to run, perform an IISRESET and restart the Microsoft CRM  Asynchronous Processing Service after updating your assembly in the Plugin  Registration Tool. It took me a while to find this out, but it’s actually quite  logical.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-4622696420665903201?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/4622696420665903201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=4622696420665903201' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4622696420665903201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4622696420665903201'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/06/ms-crm-40-custom-workflow-activity.html' title='MS CRM 4.0 Custom Workflow Activity assembly update not executing the new code'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8441707361818582676</id><published>2009-06-23T22:24:00.004+01:00</published><updated>2009-06-23T22:40:24.592+01:00</updated><title type='text'>MS CRM 4.0 VPC - remove the 'crm' host header</title><content type='html'>&lt;div&gt; &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri;"&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;On the CRM Demo VPC 2009, there is a host header 'crm' defined to redirect to the crm-srv-01:5555 website (the CRM application). When you want to change this, you'll need to do this steps:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;- Change the host header in the Internet Information Services window. Select Properties on the CRM Web site, go to the Web Site tab and click Advanced. Hit Edit... and remove the 'crm' host header value&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;Because you removed your host header, the workflows won't work anymore, because the configured webservice url still points to the host header value. Perform these steps to change this:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;- Change this Registry keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM: ServerUrl to http://localhost:5555/MSCRMServices; LocalSdkHost to localhost; LocalSdkPort to 5555&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;- Go to the SQL Server Management Studio, and execute this queries on the MSCRM_CONFIG database (This is not supported! Please take a backup of this database before executing the queries):&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;USE MSCRM_CONFIG&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Update DeploymentProperties SET NVarCharColumn = 'localhost:5555' WHERE ColumnName = 'AsyncSdkRootDomain'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Update DeploymentProperties SET NvarCharColumn = 'localhost:5555' WHERE ColumnName = 'ADSdkRootDomain' &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Update DeploymentProperties SET NvarCharColumn = 'localhost:5555' WHERE ColumnName = 'ADWebApplicationRootDomain'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;(queries found on http://www.sadev.co.za/content/workflow-doesnt-work-imports-never-happen-emails-dont-flow-and-outlook-clients-cannot-connec)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;-   Perform an IISRESET and Restart the Microsoft CRM Asynchronous Processing Service.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8441707361818582676?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8441707361818582676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8441707361818582676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8441707361818582676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8441707361818582676'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/06/ms-crm-40-vpc-remove-crm-host-header.html' title='MS CRM 4.0 VPC - remove the &apos;crm&apos; host header'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-7162099353484003080</id><published>2009-04-03T18:33:00.003+01:00</published><updated>2009-04-03T18:46:47.420+01:00</updated><title type='text'>Microsoft Dynamics CRM 4.0 - enable tracing / logging</title><content type='html'>To enable logging on your Microsoft Dynamics CRM 4.0 server, you can follow this instructions: &lt;a href="http://support.microsoft.com/kb/907490/en-us"&gt;http://support.microsoft.com/kb/907490/en-us&lt;/a&gt;. A handy tool is written to do this instead of changing the registry keys yourselve: &lt;a href="http://blogs.msdn.com/benlec/archive/2008/03/04/crmdiagtool4-for-microsoft-crm-4-0-has-been-released.aspx"&gt;http://blogs.msdn.com/benlec/archive/2008/03/04/crmdiagtool4-for-microsoft-crm-4-0-has-been-released.aspx&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, the tool configures your server to log all the stuff it's processing. This is because the registry value of TraceCategories is set to "*:Verbose". Set the registry value to "*:Error" if you only want the errors to be logged. If you want to log errors and warnings, set the value to "*:Error;*:Warnings".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The default location is set to [drive]:\Program Files\Microsoft Dynamics CRM Server\Trace. To change this, change the value of the TraceDirectory registry setting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-7162099353484003080?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/7162099353484003080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=7162099353484003080' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7162099353484003080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7162099353484003080'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/04/microsoft-dynamics-crm-40-enable.html' title='Microsoft Dynamics CRM 4.0 - enable tracing / logging'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5345129234030239990</id><published>2009-03-30T18:04:00.002+01:00</published><updated>2009-03-30T18:05:02.529+01:00</updated><title type='text'>Sharepoint - An update conflict has occurred, and you must re-try this action.</title><content type='html'>&lt;p&gt;I got this error today on a restored MOSS environment, when trying to add an existing content database: &lt;/p&gt;&lt;p&gt;An update conflict has occurred, and you must re-try this action. The object SPWebApplication Name=WEBAPPLICATIONNAME Parent=SPWebService is being updated by DOMAIN\USER, in the w3wp process, on machine SERVERNAME.  View the tracing log for more information about the conflict. &lt;/p&gt;&lt;p&gt;I found this KB to solve this issue: &lt;a href="http://support.microsoft.com/kb/939308"&gt;http://support.microsoft.com/kb/939308&lt;/a&gt;&lt;/p&gt;&lt;p&gt;"This issue occurs if the contents of the file system cache on the front-end servers are newer than the contents of the configuration database. After you perform a system recovery, you may have to manually clear the file system cache on the local server."&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5345129234030239990?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5345129234030239990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5345129234030239990' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5345129234030239990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5345129234030239990'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/03/sharepoint-update-conflict-has-occurred_7667.html' title='Sharepoint - An update conflict has occurred, and you must re-try this action.'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-4527373623120810734</id><published>2009-03-30T18:03:00.001+01:00</published><updated>2009-03-30T18:03:19.290+01:00</updated><title type='text'>Sharepoint - An update conflict has occurred, and you must re-try this action.</title><content type='html'>I got this error today on a restored MOSS installation, when trying to add an existing content database:&lt;br /&gt;An update conflict has occurred, and you must re-try this action. The object SPWebApplication Name=WEBAPPLICATIONNAME Parent=SPWebService is being updated by DOMAIN\USER, in the w3wp process, on machine SERVERNAME.  View the tracing log for more information about the conflict.&lt;br /&gt;I found this KB to solve this issue: &lt;a href="http://support.microsoft.com/kb/939308"&gt;http://support.microsoft.com/kb/939308&lt;/a&gt;&lt;br /&gt;"This issue occurs if the contents of the file system cache on the front-end servers are newer than the contents of the configuration database. After you perform a system recovery, you may have to manually clear the file system cache on the local server."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-4527373623120810734?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/4527373623120810734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=4527373623120810734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4527373623120810734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4527373623120810734'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/03/sharepoint-update-conflict-has-occurred_30.html' title='Sharepoint - An update conflict has occurred, and you must re-try this action.'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5949212289182441859</id><published>2009-03-30T18:01:00.002+01:00</published><updated>2009-03-30T18:02:57.244+01:00</updated><title type='text'>Sharepoint - An update conflict has occurred, and you must re-try this action.</title><content type='html'>I got this error today on a restored MOSS installation, when trying to add an existing content database:&lt;br /&gt;&lt;br /&gt;An update conflict has occurred, and you must re-try this action. The object SPWebApplication Name=WEBAPPLICATIONNAME Parent=SPWebService is being updated by DOMAIN\USER, in the w3wp process, on machine SERVERNAME.  View the tracing log for more information about the conflict.&lt;br /&gt;&lt;br /&gt;I found this KB to solve this issue: &lt;a href="http://support.microsoft.com/kb/939308"&gt;http://support.microsoft.com/kb/939308&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;"This issue occurs if the contents of the file system cache on the front-end servers are newer than the contents of the configuration database. After you perform a system recovery, you may have to manually clear the file system cache on the local server."&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5949212289182441859?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5949212289182441859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5949212289182441859' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5949212289182441859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5949212289182441859'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/03/sharepoint-update-conflict-has-occurred.html' title='Sharepoint - An update conflict has occurred, and you must re-try this action.'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5255922924214161078</id><published>2009-03-25T20:24:00.001+01:00</published><updated>2009-03-25T20:24:24.949+01:00</updated><title type='text'>Operating system error 1330(error not found) on RESTORE DATABASE in SQLcmd</title><content type='html'>&lt;p&gt;A colleague of mine had this problem today (and found a solution!):   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;While trying to restore a database from a UNC path that’s not in the same domain as your database server, you might get the following error: &lt;/p&gt;  &lt;p&gt;&lt;em&gt;1&amp;gt; RESTORE DATABASE DatabaseName FROM DISK = '\\Server\Dump\DatabaseName.bak' WITH REPLACE &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;2&amp;gt; go &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Msg 3201, Level 16, State 2, Server ServerName, Line 1 &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Cannot open backup device '\\Server\Dump\DatabaseName.bak'. &lt;strong&gt;Operating system error 1330(error not found).&lt;/strong&gt; &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Msg 3013, Level 16, State 1, Server ServerName, Line 1 &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;RESTORE DATABASE is terminating abnormally.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;Error not found, quite handy. &lt;/p&gt;  &lt;p&gt;Note that on that network share “Everyone” has read rights (also on NTFS). So the file can be read from explorer. SQLcmd tries to use the domain user, and only that user for some reason. &lt;/p&gt;  &lt;p&gt;The solution lies in the creation of a user account on the non-domain machine, with the same name as the domain user. (Never mind the domain prefix). Set the password, and you’re off!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5255922924214161078?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5255922924214161078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5255922924214161078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5255922924214161078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5255922924214161078'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/03/operating-system-error-1330error-not.html' title='Operating system error 1330(error not found) on RESTORE DATABASE in SQLcmd'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-1808274900294647165</id><published>2009-03-05T20:44:00.001+01:00</published><updated>2009-03-05T20:46:19.377+01:00</updated><title type='text'>SharePoint Dispose Checker Tool</title><content type='html'>&lt;div&gt;"SPDisposeCheck is a tool to help you to check your assemblies that use the SharePoint API so that you can build better code."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); text-decoration: none;"&gt;&lt;a href="http://code.msdn.microsoft.com/SPDisposeCheck" style=""&gt;http://code.msdn.microsoft.com/SPDisposeCheck&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-1808274900294647165?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/1808274900294647165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=1808274900294647165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1808274900294647165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1808274900294647165'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/03/sharepoint-dispose-checker-tool.html' title='SharePoint Dispose Checker Tool'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5160515663743431741</id><published>2009-01-29T19:07:00.001+01:00</published><updated>2009-01-29T19:07:14.179+01:00</updated><title type='text'>Today in CAML query</title><content type='html'>&lt;p&gt;I had to use [Today] in a CAML query. I tried configuring the query with the U2U Caml Query Builder 2007, this was the output: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;Where&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Eq&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;FieldRef Name='Modified' /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Value Type='DateTime'&amp;gt;[Today-120Day(s)]&amp;lt;/Value&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Eq&amp;gt;       &lt;br /&gt;&amp;lt;/Where&amp;gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But this did not work when a tried to run the query in code (SPQuery). I used this query instead, and it worked fine: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;Where&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Eq&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;FieldRef Name='Modified' /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Value Type='DateTime'&amp;gt;&amp;lt;Today OffsetDays=&amp;quot;-120&amp;quot;/&amp;gt;&amp;lt;/Value&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Eq&amp;gt;       &lt;br /&gt;&amp;lt;/Where&amp;gt;&amp;#160; &lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5160515663743431741?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5160515663743431741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5160515663743431741' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5160515663743431741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5160515663743431741'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/01/today-in-caml-query_29.html' title='Today in CAML query'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-7900109941359937905</id><published>2009-01-14T19:21:00.000+01:00</published><updated>2009-01-14T19:22:40.072+01:00</updated><title type='text'>Top 25 Most Dangerous Programming Errors</title><content type='html'>&lt;a href="http://cwe.mitre.org/top25/"&gt;http://cwe.mitre.org/top25/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-7900109941359937905?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/7900109941359937905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=7900109941359937905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7900109941359937905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7900109941359937905'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2009/01/top-25-most-dangerous-programming.html' title='Top 25 Most Dangerous Programming Errors'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-6251122196141036247</id><published>2008-12-05T19:09:00.001+01:00</published><updated>2008-12-05T19:10:07.515+01:00</updated><title type='text'>SharePoint: Add a site collection policy to a content type programmatically</title><content type='html'>&lt;p&gt;In &lt;a href="http://knrs.blogspot.com/2007/12/sharepoint-create-expiration-policy.html"&gt;this blogpost&lt;/a&gt;, I wrote about how to add a Policy to a content type programmatically. &lt;/p&gt;  &lt;p&gt;I got a question by mail how I'd add a site collection policy to a content type in code.&lt;/p&gt;  &lt;p&gt;This is the code that can do this:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;using (SPSite site = new SPSite(&lt;/font&gt;&lt;a href="http://server))"&gt;&lt;font face="Courier New" size="1"&gt;http://server))&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;{ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;SPContentType contentType = null; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;//get content type id &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;foreach (SPContentType type in site.RootWeb.ContentTypes)     &lt;br /&gt;{ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;if (type.Name == &amp;quot;test content type&amp;quot;)     &lt;br /&gt;{      &lt;br /&gt;contentType = type;      &lt;br /&gt;break;      &lt;br /&gt;}      &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;PolicyCatalog catalog = new PolicyCatalog(site); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;if (catalog != null &amp;amp;&amp;amp; catalog.PolicyList != null)     &lt;br /&gt;{ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;foreach (Policy p in catalog.PolicyList)     &lt;br /&gt;{      &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;if (p.Name == &amp;quot;test site collection policy&amp;quot;)     &lt;br /&gt;{&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;//todo: check if contenttype has already got a Policy; then delete the Policy first &lt;/font&gt;&lt;font face="Courier New" size="1"&gt;     &lt;br /&gt;&lt;font face="Courier New" size="1"&gt;Policy.CreatePolicy(contentType, p);       &lt;br /&gt;}        &lt;br /&gt;}        &lt;br /&gt;}        &lt;br /&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;By the way&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;I don't think the policy on the content type is updated when you update the site collection policy.. I think this should be test very good! I tried this:   &lt;br /&gt;- create a site collection policy (in SharePoint UI)    &lt;br /&gt;- assign this site collection policy to your content type (in SharePoint UI)    &lt;br /&gt;- watch the PolicyItem.CustomData property on the Policy of your content type in code:    &lt;br /&gt;&lt;font face="Courier New" size="1"&gt;Policy pol = Policy.GetPolicy(contentType); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;foreach (PolicyItem item in pol.Items) &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;{ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;Console.WriteLine(item.CustomData.ToString()); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;- Change your site collection policy (in SharePoint UI) &lt;/p&gt;  &lt;p&gt;- Rewatch the PolicyItem.CustomData property on the Policy of your content type in code... &lt;/p&gt;  &lt;p&gt;=&amp;gt; The CustomDatea property on the policy on my content type was NOT changed... This is pretty weird..&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-6251122196141036247?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/6251122196141036247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=6251122196141036247' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6251122196141036247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6251122196141036247'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/12/sharepoint-add-site-collection-policy.html' title='SharePoint: Add a site collection policy to a content type programmatically'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8753718841780673382</id><published>2008-10-29T18:34:00.001+01:00</published><updated>2008-10-29T18:34:47.375+01:00</updated><title type='text'>Uninstalling IE8 beta on Windows XP</title><content type='html'>&lt;a href="http://support.microsoft.com/kb/957700/#ALTWin5"&gt;http://support.microsoft.com/kb/957700/#ALTWin5&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8753718841780673382?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8753718841780673382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8753718841780673382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8753718841780673382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8753718841780673382'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/10/uninstalling-ie8-beta-on-windows-xp.html' title='Uninstalling IE8 beta on Windows XP'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-1105688709903318190</id><published>2008-10-25T12:07:00.002+01:00</published><updated>2008-10-25T12:08:21.945+01:00</updated><title type='text'>SharePoint Security: Hard limits and recommended practices</title><content type='html'>&lt;a href="http://weblogs.asp.net/erobillard/archive/2008/09/11/sharepoint-security-hard-limits-and-recommended-practices.aspx"&gt;http://weblogs.asp.net/erobillard/archive/2008/09/11/sharepoint-security-hard-limits-and-recommended-practices.aspx &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-1105688709903318190?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/1105688709903318190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=1105688709903318190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1105688709903318190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1105688709903318190'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/10/sharepoint-security-hard-limits-and.html' title='SharePoint Security: Hard limits and recommended practices'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-6777985327986244461</id><published>2008-10-23T21:33:00.001+01:00</published><updated>2008-10-23T21:33:51.965+01:00</updated><title type='text'>Electrabel mailbevestiging</title><content type='html'>&lt;p&gt;Toen ik via de site van Electrabel een vraag stelde, kreeg ik een bevestiging vanwege Luc Goossens, Sales Manager. Met vriendelijke &lt;strong&gt;groenten&lt;/strong&gt;! :-D&lt;/p&gt;  &lt;p&gt;screenshot van de mail:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/koen.roos/SQDUgGtX5II/AAAAAAAAACI/Cnl7tHREFAw/s1600-h/electrabel%5B2%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="electrabel" src="http://lh3.ggpht.com/koen.roos/SQDUgnuMAFI/AAAAAAAAACM/mtouO9nqv2A/electrabel_thumb.jpg?imgmax=800" width="188" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-6777985327986244461?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/6777985327986244461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=6777985327986244461' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6777985327986244461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6777985327986244461'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/10/electrabel-mailbevestiging.html' title='Electrabel mailbevestiging'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/koen.roos/SQDUgnuMAFI/AAAAAAAAACM/mtouO9nqv2A/s72-c/electrabel_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-3879994332313008246</id><published>2008-09-02T21:50:00.002+01:00</published><updated>2008-09-02T21:51:44.303+01:00</updated><title type='text'>Download Google Chrome Beta</title><content type='html'>I've downloaded the &lt;a href="http://www.google.com/chrome/eula.html"&gt;Google Chrome Beta&lt;/a&gt; version, looks nice and it's very fast!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-3879994332313008246?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/3879994332313008246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=3879994332313008246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/3879994332313008246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/3879994332313008246'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/09/download-google-chrome-beta.html' title='Download Google Chrome Beta'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8498163136693831602</id><published>2008-06-17T19:14:00.000+01:00</published><updated>2008-06-17T19:15:10.908+01:00</updated><title type='text'>Use a Windows Live Hotmail account in Outlook</title><content type='html'>Cool: &lt;a href="http://office.microsoft.com/en-us/outlook/HA102218231033.aspx"&gt;http://office.microsoft.com/en-us/outlook/HA102218231033.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8498163136693831602?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8498163136693831602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8498163136693831602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8498163136693831602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8498163136693831602'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/06/use-windows-live-hotmail-account-in.html' title='Use a Windows Live Hotmail account in Outlook'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8610780172404810217</id><published>2008-04-19T15:06:00.003+01:00</published><updated>2008-06-10T20:36:37.151+01:00</updated><title type='text'>Sharepoint: Edit (link to edit item) button in list not redirecting to the correct view after update</title><content type='html'>&lt;p&gt;When you add a Edit (link to edit item) button in a list on a view that is not the default view, you'll notice that after clicking on the button and editing the properties, you will not be redirected to the view you were working on. It will redirect you to the default view of the list.&lt;/p&gt;&lt;p&gt;This is because there is not a "Source" querystring in the link of the button. The link on the button is:&lt;/p&gt;&lt;p&gt;&lt;a title="http://vpc01zd51:7000/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=" href="http://servername/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=1"&gt;http://servername/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=1&lt;/a&gt;&lt;/p&gt;&lt;p&gt;but it should be:&lt;/p&gt;&lt;p&gt;&lt;a title="http://vpc01zd51:7000/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=" href="http://servername/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=1&amp;amp;Source"&gt;http://servername/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=1&amp;amp;Source&lt;/a&gt;=&lt;a title="http://vpc01zd51:7000/Test%20Doc%20Lib/Forms/EditForm.aspx?ID=" href="http://servername/Test%20Doc%20Lib/TestView.aspx"&gt;http://servername/Test%20Doc%20Lib/TestView.aspx&lt;/a&gt; (a Source querystring that holds the url of the view you are working on)&lt;/p&gt;&lt;p&gt;So I took al look at how this button is built. I found out that there is a Field definition for this button, looking like this:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;&amp;lt;Field&lt;br /&gt;ID="{503f1caa-358e-4918-9094-4a2cdc4bc034}"&lt;br /&gt;ReadOnly="TRUE"&lt;br /&gt;Type="Computed"&lt;br /&gt;Name="Edit"&lt;br /&gt;Sortable="FALSE"&lt;br /&gt;Filterable="FALSE"&lt;br /&gt;DisplayName="Edit"&lt;br /&gt;ClassInfo="Icon"&lt;br /&gt;AuthoringInfo="(link to edit item)"&lt;br /&gt;SourceID="&lt;/span&gt;&lt;a href="http://schemas.microsoft.com/sharepoint/v3"&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;http://schemas.microsoft.com/sharepoint/v3"&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:78%;"&gt;StaticName="Edit"&lt;br /&gt;FromBaseType="TRUE"&amp;gt;&lt;br /&gt;&amp;lt;FieldRefs&amp;gt;&lt;br /&gt;&amp;lt;FieldRef Name="IsCheckedoutToLocal"/&amp;gt;&lt;br /&gt;&amp;lt;FieldRef Name="ServerUrl"/&amp;gt;&lt;br /&gt;&amp;lt;FieldRef Name="CheckedOutUserId"/&amp;gt;&lt;br /&gt;&amp;lt;/FieldRefs&amp;gt;&lt;br /&gt;&amp;lt;DisplayPattern&amp;gt;&lt;br /&gt;&amp;lt;IfHasRights&amp;gt;&lt;br /&gt;&amp;lt;RightsChoices&amp;gt;&lt;br /&gt;&amp;lt;RightsGroup PermEditListItems="required"/&amp;gt;&lt;br /&gt;&amp;lt;/RightsChoices&amp;gt;&lt;br /&gt;&amp;lt;Then&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&amp;lt;a href="]]&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;URL Cmd="Edit"/&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[" onclick="STSNavigateWithCheckoutAlert(this.href, ']]&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;IfEqual&amp;gt;&lt;br /&gt;&amp;lt;Expr1&amp;gt;&lt;br /&gt;&amp;lt;Field Name="CheckedOutUserId"/&amp;gt;&lt;br /&gt;&amp;lt;/Expr1&amp;gt;&lt;br /&gt;&amp;lt;Expr2/&amp;gt;&lt;br /&gt;&amp;lt;Then&amp;gt;&lt;br /&gt;&amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;&amp;lt;ListProperty Select="ForceCheckout"/&amp;gt;&lt;br /&gt;&amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;&amp;lt;/Then&amp;gt;&lt;br /&gt;&amp;lt;Else&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[0]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;/Else&amp;gt;&lt;br /&gt;&amp;lt;/IfEqual&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[',']]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;&amp;lt;Field Name="IsCheckedoutToLocal"/&amp;gt;&lt;br /&gt;&amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[',']]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;&amp;lt;Field Name="ServerUrl"/&amp;gt;&lt;br /&gt;&amp;lt;/ScriptQuote&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[',']]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;&amp;lt;HttpVDir/&amp;gt;&lt;br /&gt;&amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[') ;return false;" target="_self"&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;img border="0" alt="]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;Edit Document Properties&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[" src="/_layouts/images/RTESRCED.GIF"&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;/a&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;/Then&amp;gt;&lt;br /&gt;&amp;lt;Else&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;amp;nbsp;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&amp;lt;/Else&amp;gt;&lt;br /&gt;&amp;lt;/IfHasRights&amp;gt;&lt;br /&gt;&amp;lt;/DisplayPattern&amp;gt;&lt;br /&gt;&amp;lt;/Field&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana;"&gt;So basically, what I had to do is copy this Field definition, and make a custom Field definition for the "correct Edit button". After some javascripting, this is my resulting Field defnition:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;/p&gt;Now you can add this Field definition in the schema.xml (in the Fields section) of your list definition like this. &lt;p&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;Field&lt;br /&gt;    ID="{00C8F32E-9400-4d61-8C6E-373A0E78E62B}"&lt;br /&gt;    ReadOnly="TRUE"&lt;br /&gt;    Type="Computed"&lt;br /&gt;    Name="EditPropertiesWithRedirect"&lt;br /&gt;    Sortable="FALSE"&lt;br /&gt;    Filterable="FALSE"&lt;br /&gt;    DisplayName="Edit Properties"&lt;br /&gt;    ClassInfo="Icon"&lt;br /&gt;    AuthoringInfo="(link to edit item, with redirect to correct view)"&lt;br /&gt;    SourceID="{F326CD4A-69CD-4b61-A3F1-1427543CD745}"&lt;br /&gt;    StaticName="EditPropertiesWithRedirect"&lt;br /&gt;    FromBaseType="TRUE"&amp;gt;&lt;br /&gt;    &amp;lt;FieldRefs&amp;gt;&lt;br /&gt;     &amp;lt;FieldRef Name="IsCheckedoutToLocal"/&amp;gt;&lt;br /&gt;     &amp;lt;FieldRef Name="ServerUrl"/&amp;gt;&lt;br /&gt;     &amp;lt;FieldRef Name="CheckedOutUserId"/&amp;gt;&lt;br /&gt;    &amp;lt;/FieldRefs&amp;gt;&lt;br /&gt;    &amp;lt;DisplayPattern&amp;gt;&lt;br /&gt;     &amp;lt;IfHasRights&amp;gt;&lt;br /&gt;      &amp;lt;RightsChoices&amp;gt;&lt;br /&gt;       &amp;lt;RightsGroup PermEditListItems="required"/&amp;gt;&lt;br /&gt;      &amp;lt;/RightsChoices&amp;gt;&lt;br /&gt;      &amp;lt;Then&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&lt;br /&gt;        &amp;lt;![CDATA[&amp;lt;a href="" ]]&amp;gt;&lt;br /&gt;       &amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&lt;br /&gt;        &amp;lt;![CDATA[" onclick="STSNavigateWithCheckoutAlert(this.href, ']]&amp;gt;&lt;br /&gt;       &amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;IfEqual&amp;gt;&lt;br /&gt;        &amp;lt;Expr1&amp;gt;&lt;br /&gt;         &amp;lt;Field Name="CheckedOutUserId"/&amp;gt;&lt;br /&gt;        &amp;lt;/Expr1&amp;gt;&lt;br /&gt;        &amp;lt;Expr2/&amp;gt;&lt;br /&gt;        &amp;lt;Then&amp;gt;&lt;br /&gt;         &amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;          &amp;lt;ListProperty Select="ForceCheckout"/&amp;gt;&lt;br /&gt;         &amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;        &amp;lt;/Then&amp;gt;&lt;br /&gt;        &amp;lt;Else&amp;gt;&lt;br /&gt;         &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[0]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;        &amp;lt;/Else&amp;gt;&lt;br /&gt;       &amp;lt;/IfEqual&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[',']]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="IsCheckedoutToLocal"/&amp;gt;&lt;br /&gt;       &amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[',']]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;        &amp;lt;Field Name="ServerUrl"/&amp;gt;&lt;br /&gt;       &amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[',']]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;ScriptQuote NotAddingQuote="TRUE"&amp;gt;&lt;br /&gt;        &amp;lt;HttpVDir/&amp;gt;&lt;br /&gt;       &amp;lt;/ScriptQuote&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&lt;br /&gt;      &lt;strong&gt;  &amp;lt;![CDATA['); javascript:window.location=']]&amp;gt;&lt;br /&gt;       &amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;URL Cmd="Edit"/&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&lt;br /&gt;        &amp;lt;![CDATA[' + '&amp;amp;Source=' + escape(window.location);]]&amp;gt;&lt;br /&gt;       &amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;/strong&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[return false;" target="_self"&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;img border="0" alt="]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;Edit Document Properties&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[" src="/_layouts/images/edititem.gif"&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;/a&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;      &amp;lt;/Then&amp;gt;&lt;br /&gt;      &amp;lt;Else&amp;gt;&lt;br /&gt;       &amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;amp;nbsp;]]&amp;gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;      &amp;lt;/Else&amp;gt;&lt;br /&gt;     &amp;lt;/IfHasRights&amp;gt;&lt;br /&gt;    &amp;lt;/DisplayPattern&amp;gt;&lt;br /&gt;   &amp;lt;/Field&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The field will appear in the Create View or Modify View page, so you can select it to add the field to your view. Now you'll have an edit button that redirects to the correct view after updating the properties.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8610780172404810217?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8610780172404810217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8610780172404810217' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8610780172404810217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8610780172404810217'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/04/sharepoint-edit-link-to-edit-item.html' title='Sharepoint: Edit (link to edit item) button in list not redirecting to the correct view after update'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8156969681088032343</id><published>2008-04-08T19:33:00.001+01:00</published><updated>2008-04-08T19:33:22.970+01:00</updated><title type='text'>Sharepoint 2007 - dropdown menu with long text CSS color</title><content type='html'>&lt;p&gt;In Sharepoint 2007, when an item in a dropdown menu is long, the rollover color is different:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.google.com/koen.roos/R_u6bkFpwQI/AAAAAAAAAB4/0ZiZLNYiDXw/1%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="151" alt="1" src="http://lh6.google.com/koen.roos/R_u6cUFpwRI/AAAAAAAAACA/6gBwHoLhLe4/1_thumb%5B1%5D.jpg" width="424" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To fix this, open the core.css file and go to this class:&lt;/p&gt;  &lt;p&gt;.ms-topNavFlyOuts a{   &lt;br /&gt;display:block;    &lt;br /&gt;*width:120px;    &lt;br /&gt;min-width:120px;    &lt;br /&gt;color:#3764a0;    &lt;br /&gt;padding:4px 8px 4px 8px;    &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;replace &amp;quot;*width:120px;&amp;quot; with &amp;quot;width:100%;&amp;quot;&lt;/p&gt;  &lt;p&gt;.ms-topNavFlyOuts a{   &lt;br /&gt;display:block;    &lt;br /&gt;width:100%;    &lt;br /&gt;min-width:120px;    &lt;br /&gt;color:#3764a0;    &lt;br /&gt;padding:4px 8px 4px 8px;    &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;Tip: modifying the core.css is not best practice, better copy-paste this class in a new CSS file and use it as a &lt;a href="http://office.microsoft.com/en-us/sharepointdesigner/HA101691741033.aspx"&gt;alternate css&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8156969681088032343?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8156969681088032343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8156969681088032343' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8156969681088032343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8156969681088032343'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/04/sharepoint-2007-dropdown-menu-with-long.html' title='Sharepoint 2007 - dropdown menu with long text CSS color'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5976992616724815115</id><published>2008-03-17T20:29:00.001+01:00</published><updated>2008-03-17T20:31:24.117+01:00</updated><title type='text'>Think twice before you install Visual Studio 2005 Service Pack 1 on a Windows 2003 SP1 machine...</title><content type='html'>Today, I spent 3 hours installing the Service Pack 1 of Visual Studio 2005 on a Windows 2003 SP1 machine...&lt;br /&gt;&lt;br /&gt;The known issues are:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/heaths/archive/2007/01/11/known-issues-with-visual-studio-2005-service-pack-1.aspx"&gt;http://blogs.msdn.com/heaths/archive/2007/01/11/known-issues-with-visual-studio-2005-service-pack-1.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5976992616724815115?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5976992616724815115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5976992616724815115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5976992616724815115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5976992616724815115'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/03/think-twice-before-you-install-visual.html' title='Think twice before you install Visual Studio 2005 Service Pack 1 on a Windows 2003 SP1 machine...'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-6415779943228745603</id><published>2008-02-09T22:15:00.001+01:00</published><updated>2008-02-09T22:15:32.933+01:00</updated><title type='text'>The internet's undersea world</title><content type='html'>&lt;p&gt;&lt;a title="http://image.guardian.co.uk/sys-images/Technology/Pix/pictures/2008/02/01/SeaCableHi.jpg" href="http://image.guardian.co.uk/sys-images/Technology/Pix/pictures/2008/02/01/SeaCableHi.jpg"&gt;http://image.guardian.co.uk/sys-images/Technology/Pix/pictures/2008/02/01/SeaCableHi.jpg&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-6415779943228745603?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/6415779943228745603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=6415779943228745603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6415779943228745603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6415779943228745603'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/02/internet-undersea-world.html' title='The internet&amp;#39;s undersea world'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5748714841526949315</id><published>2008-02-06T19:17:00.000+01:00</published><updated>2008-02-06T19:18:53.959+01:00</updated><title type='text'>MOSS 2007 VPC image</title><content type='html'>Very nice posting about creating a MOSS 2007 VPC! &lt;a href="http://www.pptspaces.com/sharepointreporterblog/Lists/Posts/Post.aspx?ID=28"&gt;http://www.pptspaces.com/sharepointreporterblog/Lists/Posts/Post.aspx?ID=28&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5748714841526949315?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5748714841526949315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5748714841526949315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5748714841526949315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5748714841526949315'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/02/moss-2007-vpc-image.html' title='MOSS 2007 VPC image'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-3522721408211545383</id><published>2008-01-22T19:04:00.001+01:00</published><updated>2008-01-22T21:09:39.169+01:00</updated><title type='text'>Sharepoint Timerjob: Read the web.config inside a Timer Job</title><content type='html'>&lt;p&gt;There is no way to get a reference to a SPSite or SPWeb object inside a timerjob. So when you want to store configuration values in the web.config of your Web Application, there is no way to get the Web Application's name to open the web.config with the WebConfigurationManager. I programmed this workaround:&lt;/p&gt;&lt;p&gt;- In the FeatureReceiver of the Timer job, pass the SPSite instance of the site where the feature is activated on, to the constructor of your timer job class:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;        {&lt;br /&gt;            // Collect the reference to the site from the feature parent that can be SPSite/SPWeb.&lt;br /&gt;            using (SPSite site = properties.Feature.Parent.GetType() == typeof(SPSite) ? (SPSite)properties.Feature.Parent : (SPSite)((SPWeb)properties.Feature.Parent).Site)&lt;br /&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;MailDateAlertsJob mailDateAlertsTimerJob = new MailDateAlertsJob(SanofiConstants.JOB_NAME, site.WebApplication, properties.Definition.DisplayName, site);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;- In the constructur of your Timer job class, you will have a SPSite parameter:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;public MailDateAlertsJob(string jobName, SPWebApplication webApp, string featureName, SPSite site)&lt;br /&gt;            : base(jobName, webApp, null, SPJobLockType.Job)&lt;br /&gt;        {&lt;br /&gt;            this.Title = SanofiConstants.JOB_TITLE;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt;&lt;strong&gt;this._siteToHandleActionsOn = site.Url;&lt;br /&gt;&lt;/strong&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;- The _siteToHandleActionsOn variable holds the url string of the site where your feature is activated on. This variable is defined like this (note the [Persisted] attribute!!):&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;[Persisted]&lt;br /&gt;        private string _siteToHandleActionsOn;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;- In the Execute methods of your timer job, you now can open the web configuration of the site:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;if (this._siteToHandleActionsOn != null)&lt;br /&gt;                    {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;                        using (SPSite site = new SPSite(this._siteToHandleActionsOn))&lt;br /&gt;                        {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;string appSettingValue = WebConfigurationManager.OpenWebConfiguration("/", &lt;strong&gt;site.WebApplication.Name&lt;/strong&gt;).AppSettings.Settings["key"].Value;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;  }&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;If you have a better solution for this, please let me know ;-)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-3522721408211545383?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/3522721408211545383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=3522721408211545383' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/3522721408211545383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/3522721408211545383'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/01/sharepoint-read-webconfig-inside-timer.html' title='Sharepoint Timerjob: Read the web.config inside a Timer Job'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-6321251667546380260</id><published>2008-01-05T19:23:00.000+01:00</published><updated>2008-01-05T19:28:26.013+01:00</updated><title type='text'>Compare Dates in Sharepoint XSL</title><content type='html'>See &lt;a href="http://sharethelearning.blogspot.com/2007/06/comparing-dates-in-sharepoint-xsl.html"&gt;http://sharethelearning.blogspot.com/2007/06/comparing-dates-in-sharepoint-xsl.html&lt;/a&gt;:  &lt;br /&gt;  &lt;br /&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;lt;xsl:if test=&amp;quot;number(translate(substring-before(ddwrt:FormatDate(@Date_x0020_Raised ,1053 ,5), ' '), '-', ''))+2 &amp;lt; number(translate(substring-before(ddwrt:TodayIso(), 'T'), '-', ''))&amp;quot;&amp;gt;     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &amp;lt;img src=&amp;quot;_layouts/images/ewr210s.gif&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;lt;/xsl:if&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-6321251667546380260?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/6321251667546380260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=6321251667546380260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6321251667546380260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6321251667546380260'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2008/01/compare-dates-in-sharepoint-xsl.html' title='Compare Dates in Sharepoint XSL'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-628844518979804294</id><published>2007-12-25T15:33:00.000+01:00</published><updated>2007-12-25T15:34:50.197+01:00</updated><title type='text'>Lesswoodstock 2008: The Black Box Revelation</title><content type='html'>The main act of Lesswoodstock 2008 is &lt;a href="http://www.theblackboxrevelation.be/"&gt;The Black Box Revelation&lt;/a&gt;, yeah!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-628844518979804294?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/628844518979804294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=628844518979804294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/628844518979804294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/628844518979804294'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/12/lesswoodstock-2008-black-box-revelation.html' title='Lesswoodstock 2008: The Black Box Revelation'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-4387577589138786801</id><published>2007-12-24T17:28:00.000+01:00</published><updated>2007-12-24T17:32:50.160+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='free webhosting'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>Free ASP.NET Hosting</title><content type='html'>Finally, I found some good Free ASP.NET Webhosting: &lt;a href="http://www.qsh.es/free"&gt;Quantasoft&lt;/a&gt; (Spain).&lt;br /&gt;&lt;br /&gt;The free hosting plan includes 50MB Disk space, ASP.NET 2.0 and Sql Express. &lt;br /&gt;&lt;br /&gt;Haven't done heavy programming on it, but the simple ASP.NET stuff (in my case, uploading documents and write/read a sql express database) for the simple sites work, so I'm happy ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-4387577589138786801?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/4387577589138786801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=4387577589138786801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4387577589138786801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4387577589138786801'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/12/free-aspnet-hosting.html' title='Free ASP.NET Hosting'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-1211223400121535645</id><published>2007-12-20T19:02:00.001+01:00</published><updated>2007-12-20T19:02:37.152+01:00</updated><title type='text'>Sharepoint: Force Expiry Policy Timer job to run</title><content type='html'>&lt;p&gt;To test your custom expiry policy, you have to force the Expiry Policy Timer job to run. I found this very useful posting:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/mattlind/archive/2007/06/05/force-execution-of-expiration-policies-in-moss.aspx"&gt;http://blogs.msdn.com/mattlind/archive/2007/06/05/force-execution-of-expiration-policies-in-moss.aspx&lt;/a&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-1211223400121535645?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/1211223400121535645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=1211223400121535645' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1211223400121535645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1211223400121535645'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/12/sharepoint-force-expiry-policy-timer.html' title='Sharepoint: Force Expiry Policy Timer job to run'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-1906284636616494932</id><published>2007-12-16T21:11:00.001+01:00</published><updated>2007-12-16T21:17:27.242+01:00</updated><title type='text'>SharePoint: Create and add a Policy to a content type programmatically</title><content type='html'>&lt;p&gt;I had to add a custom action to the Sharepoint expiry policy of a content type. &lt;/p&gt;  &lt;p&gt;How to make a custom action, and add it to a policy in the Sharepoint configuration screen of the content type is not so hard - see &lt;a title="http://jack.whyyoung.com/blog/www-sharepointblogs-com-MainFeed-aspx-GroupID-3/19732-aspx.htm" href="http://jack.whyyoung.com/blog/www-sharepointblogs-com-MainFeed-aspx-GroupID-3/19732-aspx.htm"&gt;http://jack.whyyoung.com/blog/www-sharepointblogs-com-MainFeed-aspx-GroupID-3/19732-aspx.htm&lt;/a&gt; for this.&lt;/p&gt;  &lt;p&gt;But to add this policy to a content type automatically - in code int the feature event receiver of this content type - I had to search a little bit harder..&lt;/p&gt;  &lt;p&gt;Use the Policy (&lt;strong&gt;in namespace Microsoft.Office.RecordsManagement.InformationPolicy&lt;/strong&gt;) object (do not use the SPPolicy class, that's for other purposes :) ) to add the expiration policy programmatically to the content type. Here is the code:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;using (SPSite site = (SPSite)properties.Feature.Parent)     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; string policyFeatureId = &amp;quot;Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration&amp;quot;;      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; SPContentType administrativeDocumentContentType = site.RootWeb.ContentTypes[new SPContentTypeId(&amp;quot;0x01010091C4CA4E2BA24AE9BD4F276750C0A5A9&amp;quot;)]; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; //Add the custom action &amp;quot;AdministrativeDocumentExpirationSendEmail&amp;quot; to the policy resource collection     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; string actionmanifest = @&amp;quot;&amp;lt;?xml version=&amp;quot;&amp;quot;1.0&amp;quot;&amp;quot; encoding=&amp;quot;&amp;quot;utf-8&amp;quot;&amp;quot; ?&amp;gt;&amp;lt;p:PolicyResource id=&amp;quot;&amp;quot;Dolmen.SharePoint.Customer.ExpirationActions.AdministrativeDocumentExpirationSendEmail&amp;quot;&amp;quot; featureId=&amp;quot;&amp;quot;Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration&amp;quot;&amp;quot; type=&amp;quot;&amp;quot;Action&amp;quot;&amp;quot; xmlns:p=&amp;quot;&amp;quot;urn:schemas-microsoft-com:office:server:policy&amp;quot;&amp;quot;&amp;gt;&amp;lt;p:LocalizationResources&amp;gt;dlccore&amp;lt;/p:LocalizationResources&amp;gt;&amp;lt;p:Name&amp;gt;AdministrativeDocumentExpirationSendEmail&amp;lt;/p:Name&amp;gt;&amp;lt;p:Description&amp;gt;Sends a mail on the Expiration date&amp;lt;/p:Description&amp;gt;&amp;lt;p:Publisher&amp;gt;Dolmen Computer Applications&amp;lt;/p:Publisher&amp;gt;&amp;lt;p:AssemblyName&amp;gt;Dolmen.SharePoint.Customer.ExpirationActions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=79b87b017c9b0654&amp;lt;/p:AssemblyName&amp;gt;&amp;lt;p:ClassName&amp;gt;Dolmen.SharePoint.Customer.ExpirationActions.AdministrativeDocumentExpirationSendEmail&amp;lt;/p:ClassName&amp;gt;&amp;lt;/p:PolicyResource&amp;gt;&amp;quot;;      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; //string actionmanifest = System.IO.File.ReadAllText(&amp;quot;actionmanifest.xml&amp;quot;);      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; PolicyResourceCollection.Add(actionmanifest); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; if (Policy.GetPolicy(administrativeDocumentContentType) == null)     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; //if the content type hasn't got a Policy yet, create a new Policy      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Policy.CreatePolicy(administrativeDocumentContentType, null);      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Policy policyOfContentType = Policy.GetPolicy(administrativeDocumentContentType);     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; policyOfContentType.Name = &amp;quot;Administrative Document - Expiration Policy&amp;quot;;      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; //Add expiration policy to the content type      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; if (policyOfContentType.Items[policyFeatureId] == null)      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; string customData = @&amp;quot;&amp;lt;data&amp;gt;&amp;lt;formula id=&amp;quot;&amp;quot;Microsoft.Office.RecordsManagement.PolicyFeatures.Expiration.Formula.BuiltIn&amp;quot;&amp;quot;&amp;gt;&amp;lt;number&amp;gt;0&amp;lt;/number&amp;gt;&amp;lt;property&amp;gt;Expiration&amp;lt;/property&amp;gt;&amp;lt;period&amp;gt;days&amp;lt;/period&amp;gt;&amp;lt;/formula&amp;gt;&amp;lt;action type=&amp;quot;&amp;quot;action&amp;quot;&amp;quot; id=&amp;quot;&amp;quot;Dolmen.SharePoint.Customer.ExpirationActions.AdministrativeDocumentExpirationSendEmail&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/data&amp;gt;&amp;quot;; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; policyOfContentType.Items.Add(policyFeatureId, customData);     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: to get the customData and the policyFeatureId you can create a policy with the standard Sharepoint configuration screen and read it out in a console application using following code:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;SPContentType administrativeDocumentContentType = site.RootWeb.ContentTypes[new SPContentTypeId(&amp;quot;0x01010091C4CA4E2BA24AE9BD4F276750C0A5A9&amp;quot;)]; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Policy policy = Policy.GetPolicy(administrativeDocumentContentType); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; foreach (PolicyItem item in policy.Items) {     &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; Console.WriteLine(&amp;quot;Custom data: &amp;quot; + item.CustomData + &amp;quot;\n policy feature id: &amp;quot; + item.Id);       &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/font&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-1906284636616494932?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/1906284636616494932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=1906284636616494932' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1906284636616494932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/1906284636616494932'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/12/sharepoint-create-expiration-policy.html' title='SharePoint: Create and add a Policy to a content type programmatically'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8436404053548689045</id><published>2007-11-21T21:07:00.001+01:00</published><updated>2007-11-21T21:07:40.714+01:00</updated><title type='text'>Set custom properties of a custom field in List Definition</title><content type='html'>&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I made a custom field, named &amp;quot;CrossSiteLookupFilterFieldControl&amp;quot;. This field has some properties:&lt;/p&gt;  &lt;p&gt;...   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;PropertySchema&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;Fields&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;Field Name=&amp;quot;SelectedSite&amp;quot; DisplayName=&amp;quot;Site&amp;quot; Type=&amp;quot;Text&amp;quot; Hidden=&amp;quot;TRUE&amp;quot; /&amp;gt;   &lt;br /&gt;&amp;lt;Field Name=&amp;quot;SelectedList&amp;quot; DisplayName=&amp;quot;List&amp;quot; Type=&amp;quot;Text&amp;quot; Hidden=&amp;quot;TRUE&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;Field Name=&amp;quot;SelectedColumn&amp;quot; DisplayName=&amp;quot;Column&amp;quot; Type=&amp;quot;Text&amp;quot; Hidden=&amp;quot;TRUE&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;Field Name=&amp;quot;FilterValue&amp;quot; DisplayName=&amp;quot;Filter value&amp;quot; Type=&amp;quot;Text&amp;quot; Hidden=&amp;quot;TRUE&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;Field Name=&amp;quot;FilterQuery&amp;quot; DisplayName=&amp;quot;Filter query&amp;quot; Type=&amp;quot;Text&amp;quot; Hidden=&amp;quot;TRUE&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/Fields&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/PropertySchema&amp;gt;   &lt;br /&gt;...&lt;/p&gt;  &lt;p&gt;I want to use this field in a Custom List, so I add the following to schema.xml of my List:&lt;/p&gt;  &lt;p&gt;&amp;lt;Field ID=&amp;quot;{222EF3E9-3470-4619-89EC-7FFCDA18A3FC}&amp;quot; Name=&amp;quot;Segment&amp;quot;&amp;#xA0; SourceID=&amp;quot;{F9C3BB43-1EAA-4ac1-8878-EDBD7AFF3B4C}&amp;quot; StaticName=&amp;quot;Segment&amp;quot;&amp;#xA0; Type=&amp;quot;CrossSiteLookupFilterFieldControl&amp;quot; DisplayName=&amp;quot;Segment&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;This works. But if I want to add a value for the FilterQuery property of the field, something like this doesn't work automatically:&lt;/p&gt;  &lt;p&gt;&amp;lt;Field ID=&amp;quot;{222EF3E9-3470-4619-89EC-7FFCDA18A3FC}&amp;quot; &lt;b&gt;FilterQuery=&amp;quot;Test&amp;quot;&lt;/b&gt; Name=&amp;quot;Segment&amp;quot;&amp;#xA0; SourceID=&amp;quot;{F9C3BB43-1EAA-4ac1-8878-EDBD7AFF3B4C}&amp;quot; StaticName=&amp;quot;Segment&amp;quot;&amp;#xA0; Type=&amp;quot;CrossSiteLookupFilterFieldControl&amp;quot; DisplayName=&amp;quot;Segment&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the constructor of your custom field, you can read out the SchemaXml, and find the desired attributes. This way, you can set the values of your custom field with the values in the attributes:&lt;/p&gt;  &lt;p&gt;XmlDocument xmlDoc = new XmlDocument();   &lt;br /&gt;xmlDoc.LoadXml(this.SchemaXml);    &lt;br /&gt;XmlAttributeCollection fieldAttributes = xmlDoc.FirstChild.Attributes;&lt;/p&gt;  &lt;p&gt;if (fieldAttributes[&amp;quot;FilterQuery&amp;quot;] != null)   &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; this.FilterQuery = fieldAttributes[&amp;quot;FilterQuery&amp;quot;].Value;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;PS: More about custom field definitions later..&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8436404053548689045?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8436404053548689045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8436404053548689045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8436404053548689045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8436404053548689045'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/11/set-custom-properties-of-custom-field.html' title='Set custom properties of a custom field in List Definition'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8943001209077873790</id><published>2007-11-13T19:52:00.001+01:00</published><updated>2007-11-13T19:52:01.547+01:00</updated><title type='text'>Upload an InfoPath attachment to a document library</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;To copy a file attachment in an InfoPath form to a document library, I used this code. The &amp;quot;workfiche&amp;quot; object is an instance of a class generated by the XML Class Generator. For more information about this tool, go to &lt;a title="http://www.canerten.com/xml-c-class-generator-for-c-using-xsd-for-deserialization/" href="http://www.canerten.com/xml-c-class-generator-for-c-using-xsd-for-deserialization/"&gt;http://www.canerten.com/xml-c-class-generator-for-c-using-xsd-for-deserialization/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;byte[] attachFile = workfiche.Vlerick_TP_GeneralInformation.Brochure.AttachDraftText;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;//get filename     &lt;br /&gt;int namebufferlen = attachFile[20] * 2;      &lt;br /&gt;byte[] filenameBuffer = new byte[namebufferlen];      &lt;br /&gt;for (int i = 0; i &amp;lt; filenameBuffer.Length; i++)      &lt;br /&gt;{      &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; filenameBuffer[i] = attachFile[24 + i];      &lt;br /&gt;}      &lt;br /&gt;char[] asciiChars = UnicodeEncoding.Unicode.GetChars(filenameBuffer);      &lt;br /&gt;string filename = new string(asciiChars);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;filename = filename.Substring(0, filename.Length - 1);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;//upload to Input Documents doc library&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;SPFolder inputDocumentsList = web.GetFolder(&amp;quot;InputDocuments&amp;quot;);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;inputDocumentsList.Files.Add(filename, attachFile);&lt;/font&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8943001209077873790?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8943001209077873790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8943001209077873790' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8943001209077873790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8943001209077873790'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/11/upload-infopath-attachment-to-document.html' title='Upload an InfoPath attachment to a document library'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8315064229083034625</id><published>2007-11-13T19:44:00.001+01:00</published><updated>2007-11-13T19:44:46.986+01:00</updated><title type='text'>Sharepoint: Programmatically set an alert on a task list for a User</title><content type='html'>&lt;p&gt;This code adds an alert for all users in a site, with a filter: The task has to be assigned to the user, the status has to be Completed and the Start date has to be less than &amp;quot;today&amp;quot;. In other words: the active tasks :-)&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;foreach (SPUser user in newWeb.SiteUsers)     &lt;br /&gt;{      &lt;br /&gt;SPAlert alert = newWeb.Alerts.Add();&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;alert.Filter = &amp;quot;&amp;lt;Query&amp;gt;&amp;lt;And&amp;gt;&amp;lt;And&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;AssignedTo\&amp;quot;/&amp;gt;&amp;lt;Value type=\&amp;quot;string\&amp;quot;&amp;gt;&amp;quot; + user.LoginName + &amp;quot;&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;Neq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;Status\&amp;quot;/&amp;gt;&amp;lt;Value type=\&amp;quot;string\&amp;quot;&amp;gt;completed&amp;lt;/Value&amp;gt;&amp;lt;/Neq&amp;gt;&amp;lt;/And&amp;gt;&amp;lt;Leq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;StartDate\&amp;quot;/&amp;gt;&amp;lt;Value type=\&amp;quot;datetime\&amp;quot;&amp;gt;&amp;lt;Today/&amp;gt;&amp;lt;/Value&amp;gt;&amp;lt;/Leq&amp;gt;&amp;lt;/And&amp;gt;&amp;lt;/Query&amp;gt;&amp;quot;;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;alert.User = user;     &lt;br /&gt;alert.AlertType = SPAlertType.List;      &lt;br /&gt;alert.List = newWeb.Lists[&amp;quot;Tasks&amp;quot;];      &lt;br /&gt;alert.EventType = SPEventType.Modify;      &lt;br /&gt;alert.AlertFrequency = SPAlertFrequency.Immediate;      &lt;br /&gt;alert.Update();&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8315064229083034625?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8315064229083034625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8315064229083034625' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8315064229083034625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8315064229083034625'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/11/sharepoint-programmatically-set-alert.html' title='Sharepoint: Programmatically set an alert on a task list for a User'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-5380663917750007986</id><published>2007-11-02T12:30:00.001+01:00</published><updated>2007-11-02T12:31:31.979+01:00</updated><title type='text'>Modify Members Web Part in code</title><content type='html'>&lt;p&gt;To set a Members Webpart to &amp;quot;Show people in group&amp;quot; and fill in the group it has to show, use following code:&lt;/p&gt;  &lt;p&gt;SPWeb web = GetWeb();&lt;/p&gt;  &lt;p&gt;SPWebPartCollection webPartCollection = web.GetWebPartCollection(web.Navigation.Home.Url, Microsoft.SharePoint.WebPartPages.Storage.Shared);   &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; webPartCollection.Web.AllowUnsafeUpdates = true;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; foreach (WebPart webPart in webPartCollection) {    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; if (webPart is MembersWebPart) {    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; MembersWebPart membersWebPart = (MembersWebPart)webPart;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; membersWebPart.DisplayType = MembersWebPartDisplayType.GroupMembership;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; membersWebPart.MembershipGroupId = newWeb.Groups[&amp;quot;groupName&amp;quot;].ID;    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; webPartCollection.SaveChanges(membersWebPart.StorageKey);    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }    &lt;br /&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; webPartCollection.Web.AllowUnsafeUpdates = false;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-5380663917750007986?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/5380663917750007986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=5380663917750007986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5380663917750007986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/5380663917750007986'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/11/modify-members-web-part-in-code.html' title='Modify Members Web Part in code'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-3273364929893942488</id><published>2007-09-26T19:16:00.001+01:00</published><updated>2007-09-26T19:20:06.953+01:00</updated><title type='text'>TextBox TextChanged client side</title><content type='html'>&lt;p&gt;The TextChanged event of a TextBox fires when doing a postback in ASP.NET. So when you type something in the textbox, it won't fire before you change the focus or do something else that causes a postback to the server. &lt;/p&gt;  &lt;p&gt;To solve this, I found a piece of code that adds a Javascript to the HTML control's OnKeyUp event. This Javascript causes a PostBack, so that your event fires each time you type something in your textbox.&lt;/p&gt;  &lt;p&gt;Code:&lt;/p&gt;  &lt;p&gt;string js = &amp;quot;javascript:&amp;quot; + ClientScript.GetPostBackEventReference(TextBox1, &amp;quot;@@@@@buttonPostBack&amp;quot;) + &amp;quot;;&amp;quot; ;   &lt;br /&gt;TextBox1.Attributes.Add(&amp;quot;onkeyup&amp;quot;, js);&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-3273364929893942488?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/3273364929893942488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=3273364929893942488' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/3273364929893942488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/3273364929893942488'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/09/textbox-textchanged-client-side.html' title='TextBox TextChanged client side'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-683886240918731065</id><published>2007-09-11T20:08:00.001+01:00</published><updated>2007-09-11T20:09:28.876+01:00</updated><title type='text'>Windows Live Writer</title><content type='html'>&lt;p&gt;Even Windows Live Writer uittesten om op mijn blog berichten te zetten... 't ziet er allemaal wel chique uit :-)&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;EDIT: howla, het werkt nog ook, netjes ;-)&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-683886240918731065?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/683886240918731065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=683886240918731065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/683886240918731065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/683886240918731065'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/09/windows-live-writer.html' title='Windows Live Writer'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8215269498169750765</id><published>2007-08-27T21:03:00.000+01:00</published><updated>2007-08-27T21:07:08.351+01:00</updated><title type='text'>Tafiti</title><content type='html'>&lt;a href="http://www.tafiti.com"&gt;Tafiti&lt;/a&gt;: Live Search in Silverlight! Chique :) &lt;br /&gt;Had wel een ander font gekozen voor het zoekveld..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8215269498169750765?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8215269498169750765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8215269498169750765' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8215269498169750765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8215269498169750765'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/08/tafiti.html' title='Tafiti'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-7352889080334957504</id><published>2007-08-23T18:36:00.000+01:00</published><updated>2007-08-23T18:40:54.300+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><title type='text'>Sharepoint</title><content type='html'>Sharepoint. I'm not an expert (yet), but my employer asked me to put my focus on the Sharepoint technology from now on. I got a book, "Real World Sharepoint 2007", so I know what to do in my weekends ;-)&lt;br /&gt;&lt;br /&gt;I'm really excited about learning Sharepoint, I always hear a lot about it but I never got the chance learn the details.&lt;br /&gt;&lt;br /&gt;Yeah :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-7352889080334957504?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/7352889080334957504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=7352889080334957504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7352889080334957504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7352889080334957504'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/08/sharepoint.html' title='Sharepoint'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-199892644136995919</id><published>2007-08-20T18:36:00.000+01:00</published><updated>2007-08-20T18:45:30.038+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technical stuff'/><title type='text'>Microsoft Certified Technology Specialist</title><content type='html'>&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://www.microwin.ch/images/MSLogos/MCTS/MCTS_NetWeb.JPG" border="0" alt="" /&gt;&lt;br /&gt;Today I passed the Exam 070–528: Microsoft .NET Framework 2.0 - Web-Based Client Development, so now I'm a Microsoft Certified Technology Specialist. Sounds hot :p&lt;br /&gt;&lt;br /&gt;I'm proud, yes. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-199892644136995919?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/199892644136995919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=199892644136995919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/199892644136995919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/199892644136995919'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/08/microsoft-certified-technology.html' title='Microsoft Certified Technology Specialist'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-6369488725881967067</id><published>2007-06-04T18:14:00.000+01:00</published><updated>2007-06-04T18:16:23.506+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><title type='text'>Eval -&gt; DataBinder.Eval</title><content type='html'>&lt;a href="http://support.microsoft.com/kb/916443" target="_blank"&gt;http://support.microsoft.com/kb/916443&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm learning every day!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-6369488725881967067?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/6369488725881967067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=6369488725881967067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6369488725881967067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/6369488725881967067'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/06/eval-databindereval.html' title='Eval -&gt; DataBinder.Eval'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-8772474549446087768</id><published>2007-05-30T19:33:00.001+01:00</published><updated>2007-05-30T19:34:11.156+01:00</updated><title type='text'>Microsoft Surface</title><content type='html'>Nounou.. cool :)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.popularmechanics.com/technology/industry/4217348.html"&gt;http://www.popularmechanics.com/technology/industry/4217348.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-8772474549446087768?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/8772474549446087768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=8772474549446087768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8772474549446087768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/8772474549446087768'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/05/microsoft-surface.html' title='Microsoft Surface'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-7627407177211109979</id><published>2007-05-17T20:11:00.000+01:00</published><updated>2007-05-17T20:16:54.837+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><title type='text'>Encrypt URL ASP.NET</title><content type='html'>We had to encrypt our url with sensitive querystring information, so we took a look at the world wide web and we found this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.webpronews.com/expertarticles/2007/01/25/aspnet-httpmodule-for-query-string-encryption"&gt;http://www.webpronews.com/expertarticles/2007/01/25/aspnet-httpmodule-for-query-string-encryption&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Great, just add a httpModule and it's fixed! Without changing any of your code!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-7627407177211109979?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/7627407177211109979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=7627407177211109979' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7627407177211109979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/7627407177211109979'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/05/encrypt-url-aspnet.html' title='Encrypt URL ASP.NET'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-906902798531419767</id><published>2007-05-09T19:52:00.001+01:00</published><updated>2007-05-09T19:56:13.530+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='postback'/><category scheme='http://www.blogger.com/atom/ns#' term='modal dialog'/><title type='text'>Postback in ASP.NET page opend with showModalDialog()</title><content type='html'>Problem today: we created a ASP.NET page, opened it in a Model Dialog using javascript (showModalDialog()), and when the page did a postback, the stuff crashed.&lt;br /&gt;&lt;br /&gt;Found the solution on this site: &lt;a href="http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html"&gt;http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-906902798531419767?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/906902798531419767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=906902798531419767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/906902798531419767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/906902798531419767'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/05/postback-in-aspnet-page-opend-with_09.html' title='Postback in ASP.NET page opend with showModalDialog()'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-4016684730630851892</id><published>2007-05-09T19:52:00.000+01:00</published><updated>2007-05-09T19:55:48.065+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='postback'/><category scheme='http://www.blogger.com/atom/ns#' term='modal dialog'/><title type='text'>Postback in ASP.NET page opend with showModalDialog()</title><content type='html'>Problem today: we created a ASP.NET page, opened it in a Model Dialog using javascript (showModalDialog()), and when the page did a postback, the stuff crashed.&lt;br /&gt;&lt;br /&gt;Found the solution on this site: &lt;a href="http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html"&gt;http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;place &lt;base target="_self"&gt; in the &lt;head&gt; tags..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-4016684730630851892?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/4016684730630851892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=4016684730630851892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4016684730630851892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4016684730630851892'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/05/postback-in-aspnet-page-opend-with.html' title='Postback in ASP.NET page opend with showModalDialog()'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-4356786993957753319</id><published>2007-03-28T18:25:00.000+01:00</published><updated>2007-03-28T18:40:51.793+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='typed datasets'/><category scheme='http://www.blogger.com/atom/ns#' term='TableAdapters'/><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='DTC'/><title type='text'>Getting rid of the DTC using TableAdapters</title><content type='html'>DTC is not good for your performance, and it's a pain in the ass to get rid of..&lt;br /&gt;&lt;br /&gt;An interesting link is  &lt;a href="http://weblogs.asp.net/ryanw/archive/2006/03/30/441529.aspx" target="_blank"&gt;http://weblogs.asp.net/ryanw/archive/2006/03/30/441529.aspx&lt;/a&gt;, this solution uses Reflection to set the SqlTransaction object to the commands of your TableAdapter.&lt;br /&gt;&lt;br /&gt;But, we wanted to use the (new in .NET 2.0) TransactionScope object instead of the SqlTransaction object to control our transactions.. If I just use the TableAdapters of my typed DataSets as such, i got the DTC running, which isn't good for your performance. So I tried some stuff and I concluded that I had to control the connections of the TableAdapters.&lt;br /&gt;&lt;br /&gt;Instead of letting the TableAdapters create their own SqlConnection objects, I had to give them the reference to one and the same SqlConnection object for each TableAdapter.&lt;br /&gt;&lt;br /&gt;If you look at my blogpost "&lt;a href="http://knrs.blogspot.com/2007/03/use-assemblies-containing-typed_2430.html"&gt;Use assemblies containing typed DataSets: How to handle the connection strings?&lt;/a&gt;" you can see how I use a Factory class to control my TableAdapters. When invoking the methods to ask the Factory for your desired TableAdapter, you'll have to pass the ConnectionString.&lt;br /&gt;Well, now I made it so that I have to pass a SqlConnection object.&lt;br /&gt;&lt;br /&gt;Conclusion: To get rid of the DTC, you'll have to use 1 and the same SqlConnection object for all your TableAdapters AND you'll have to Open() the connection before you use a TransactionScope and you'll have to Close() the connection after the use of a TransactionScope object.&lt;br /&gt;&lt;br /&gt;Maybe I'll post an example program, but I haven't got much time.. If you want one, please mail me, I'll do my best..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-4356786993957753319?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/4356786993957753319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=4356786993957753319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4356786993957753319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4356786993957753319'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/03/getting-rid-of-dtc-using-tableadapters.html' title='Getting rid of the DTC using TableAdapters'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4727666002079866855.post-4948086974573540612</id><published>2007-03-19T19:52:00.000+01:00</published><updated>2007-03-19T22:17:14.656+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='config file'/><category scheme='http://www.blogger.com/atom/ns#' term='connection string'/><category scheme='http://www.blogger.com/atom/ns#' term='typed datasets'/><category scheme='http://www.blogger.com/atom/ns#' term='technical shizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><title type='text'>Use assemblies containing typed DataSets: How to handle the connection strings?</title><content type='html'>&lt;p&gt;&lt;em&gt;Remark 1: Found syntax- or language errors? Let me know!&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Remark 2: I’d rather not get in discussion with people about the use of typed datasets, I’m not a fan of it, but I had to use it at a customer.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The problem&lt;br /&gt;&lt;/strong&gt;If the user of the application you’re making has to set the connection string in a config file of the application, the user had to define a connection string setting for each assembly that uses typed datasets.&lt;br /&gt;Suppose I have two assemblies named Knrs.ConnectionStringsExample.Db.dll and Knrs.ConnectionStringsExample.Db2.dll, you’ll get something like this: &lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;br /&gt;&lt;add providername="System.Data.SqlClient" connectionstring="Data Source=.;Initial Catalog=Northwind;Integrated Security=True" name="Knrs.ConnectionStringExample.Db.Properties.Settings.NorthwindConnectionString"&gt;&lt;connectionstrings&gt;&lt;br /&gt;    &lt;connectionstrings&gt;&lt;br /&gt;        &lt;add name="Knrs.ConnectionStringExample.Db.Properties.Settings.NorthwindConnectionString"&lt;br /&gt;            connectionString="Data Source=.;Initial Catalog=Northwind;Integrated Security=True"&lt;br /&gt;            providerName="System.Data.SqlClient" /&gt;&lt;br /&gt;&lt;br /&gt;      &lt;add name="Knrs.ConnectionStringExample.Db2.Properties.Settings.NorthwindConnectionString2"&lt;br /&gt;          connectionString="Data Source=qsf;Initial Catalog=Northwind;Integrated Security=True"&lt;br /&gt;          providerName="System.Data.SqlClient" /&gt;&lt;br /&gt;    &lt;/connectionstrings&gt;&lt;br /&gt;&lt;add providername="System.Data.SqlClient" connectionstring="Data Source=qsf;Initial Catalog=Northwind;Integrated Security=True" name="Knrs.ConnectionStringExample.Db2.Properties.Settings.NorthwindConnectionString2"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.koenroos.be/blog/Knrs.ConnectionStringExample-step1.zip"&gt;Download the zip file containing a Visual Studio 2005 sln with the projects (+ setup project) STEP 1: Problem&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What do we want?&lt;/strong&gt;&lt;br /&gt;We wanted one single connectionstring setting in our config file for all the assemblies!&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The solution&lt;/strong&gt;&lt;br /&gt;Last week, we found a solution for this annoying problem. We studied the handling of connection string in the code that the typed dataset designer creates.&lt;br /&gt;&lt;br /&gt;We had a look at the property Connection that the designer generated. It’s a internal property, meaning that the property can be get/set by a file in the same assembly. Because the Windows form project that the assemblies uses, is not the same assembly, we can not set/get the Connection property directly.&lt;br /&gt;&lt;br /&gt;So we found out the concept: TableAdapterManager. We created a static class in each assembly that uses typed datasets:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;public static class DbTableAdapterManager&lt;br /&gt;{&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Get a SuppliersTableAdapter object with a custom connection string&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name="connectionString"&gt;The connectionstring you want to assign to the table adapter&lt;/param&gt;&lt;br /&gt;public static SuppliersTableAdapter GetSuppliersTableAdapter(string connectionString) {&lt;br /&gt;SuppliersTableAdapter suppliersTableAdapter = new SuppliersTableAdapter();&lt;br /&gt;&lt;br /&gt;//Make a SqlConnection with the given connection string&lt;br /&gt;SqlConnection sqlConnection = new SqlConnection(connectionString);&lt;br /&gt;&lt;br /&gt;//Assign the connection to the table adapter&lt;br /&gt;suppliersTableAdapter.Connection = sqlConnection;&lt;br /&gt;&lt;br /&gt;return suppliersTableAdapter;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;(for full code, download the sln file!)&lt;br /&gt;&lt;br /&gt;As you can see, it has a method called Get[tableadapternamehere](string connectionString) and it’s pretty obvious what it does: it just replaces the connection of a new instance of the table adapter class by a new connection using a connection string that you can pass in the method.&lt;br /&gt;&lt;br /&gt;If you make such a class for each assembly that uses typed datasets, your problem is solved! You can just place 1 connectionstring in the config file of the application and pass this connectionstring in the method to get the desired table adapter!&lt;br /&gt;&lt;br /&gt;The only little contra for this method is that you can not just make an instance of the table adapter class, but that you have to ask the TableAdapterManager class for an instance..&lt;br /&gt;&lt;br /&gt;But it’s easier and cleaner for the users of your application to just define 1 connectionstring, instead of defining 2, 3, …, x connectionstrings.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.koenroos.be/blog/Knrs.ConnectionStringExample-step2.zip"&gt;Download the zip file containing a Visual Studio 2005 sln with the projects (+ setup project) STEP 2: Solution&lt;/a&gt;&lt;/p&gt;Questions? koen [dot] roos [at] telenet [dot] be&lt;br /&gt;&lt;br /&gt;Thanks to Mark Devos (calidos.be)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4727666002079866855-4948086974573540612?l=knrs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://knrs.blogspot.com/feeds/4948086974573540612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4727666002079866855&amp;postID=4948086974573540612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4948086974573540612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4727666002079866855/posts/default/4948086974573540612'/><link rel='alternate' type='text/html' href='http://knrs.blogspot.com/2007/03/use-assemblies-containing-typed_2430.html' title='Use assemblies containing typed DataSets: How to handle the connection strings?'/><author><name>Knrs</name><uri>http://www.blogger.com/profile/03678124478997333060</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.koenroos.be/images/index_01.jpg'/></author><thr:total>0</thr:total></entry></feed>
