<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A better way to obtain fields values of an SPListItem</title>
	<atom:link href="http://blog.mastykarz.nl/obtain-fields-values-splistitem/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/</link>
	<description>Innovation Matters &#124; SharePoint Server MVP &#124; ISSN 2210-9390</description>
	<lastBuildDate>Thu, 09 Sep 2010 10:31:18 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-23207</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Mon, 06 Jul 2009 20:50:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-23207</guid>
		<description>@nancy: Unfortunately CAML doesn&#039;t provide any mechanism for selecting distinct values. What you could is to take care that you&#039;re retrieving items in a best possible way (I covered some samples here: http://blog.mastykarz.nl/performance-of-content-aggregation-queries-on-multiple-lists-revisited/) and then do the distinct selection. If the query is being run frequently it might be a good idea to cache the results as it will probably be a resource-expensive operation (depending on the total number of items of course).</description>
		<content:encoded><![CDATA[<p>@nancy: Unfortunately CAML doesn&#039;t provide any mechanism for selecting distinct values. What you could is to take care that you&#039;re retrieving items in a best possible way (I covered some samples here: <a href="http://blog.mastykarz.nl/performance-of-content-aggregation-queries-on-multiple-lists-revisited/)" rel="nofollow">http://blog.mastykarz.nl/performance-of-content-aggregation-queries-on-multiple-lists-revisited/)</a> and then do the distinct selection. If the query is being run frequently it might be a good idea to cache the results as it will probably be a resource-expensive operation (depending on the total number of items of course).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nancy</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-23204</link>
		<dc:creator>nancy</dc:creator>
		<pubDate>Mon, 06 Jul 2009 19:19:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-23204</guid>
		<description>Great, Thanks. question though! I have to look at all the SPListItems that are in the same list and show only those items that are not repeatetive. (I might have 3 splistitem within the same list that have the same specific field). What I want to do is to show only 1 of those splistitem instead of 3!
Any idea????
I REALLY appriciate any help. Thank you</description>
		<content:encoded><![CDATA[<p>Great, Thanks. question though! I have to look at all the SPListItems that are in the same list and show only those items that are not repeatetive. (I might have 3 splistitem within the same list that have the same specific field). What I want to do is to show only 1 of those splistitem instead of 3!<br />
Any idea????<br />
I REALLY appriciate any help. Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colby Africa</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-11076</link>
		<dc:creator>Colby Africa</dc:creator>
		<pubDate>Fri, 23 Jan 2009 14:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-11076</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-9420</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Wed, 03 Dec 2008 19:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-9420</guid>
		<description>@Jim: It&#039;s a wrapper class generated using Imtech Fields Generator v1.5 (http://blog.mastykarz.nl/imtech-fields-explorer-v1410-inconvenient-site-columns-update/).</description>
		<content:encoded><![CDATA[<p>@Jim: It&#039;s a wrapper class generated using Imtech Fields Generator v1.5 (<a href="http://blog.mastykarz.nl/imtech-fields-explorer-v1410-inconvenient-site-columns-update/" rel="nofollow">http://blog.mastykarz.nl/imtech-fields-explorer-v1410-inconvenient-site-columns-update/</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Blanchard</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-9418</link>
		<dc:creator>Jim Blanchard</dc:creator>
		<pubDate>Wed, 03 Dec 2008 17:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-9418</guid>
		<description>Quick question on your sample caller code:

MyContentType.MyDateField

Do you have custom classes in your code that inherit from SPContentType to do this or is there something else at play?</description>
		<content:encoded><![CDATA[<p>Quick question on your sample caller code:</p>
<p>MyContentType.MyDateField</p>
<p>Do you have custom classes in your code that inherit from SPContentType to do this or is there something else at play?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-8991</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Mon, 24 Nov 2008 18:33:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-8991</guid>
		<description>Thanks TJ :)</description>
		<content:encoded><![CDATA[<p>Thanks TJ <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TJ</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-8990</link>
		<dc:creator>TJ</dc:creator>
		<pubDate>Mon, 24 Nov 2008 18:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-8990</guid>
		<description>The only problem in using the ContainsField method is it only accepts a string that contains either the display name or the internal name of the field. The wrapper classes use IDs.
By the way Love It :-)</description>
		<content:encoded><![CDATA[<p>The only problem in using the ContainsField method is it only accepts a string that contains either the display name or the internal name of the field. The wrapper classes use IDs.<br />
By the way Love It <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldek Mastykarz</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-8224</link>
		<dc:creator>Waldek Mastykarz</dc:creator>
		<pubDate>Fri, 14 Nov 2008 14:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-8224</guid>
		<description>Thanks for the tip Erik, I&#039;ve definitely missed that one. Adding the extra check you mentioned would keep you off from getting an extra Exception but I still like the idea of having it all wrapped in a try..catch clause &#039;just in case&#039;.</description>
		<content:encoded><![CDATA[<p>Thanks for the tip Erik, I&#039;ve definitely missed that one. Adding the extra check you mentioned would keep you off from getting an extra Exception but I still like the idea of having it all wrapped in a try..catch clause &#039;just in case&#039;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Burger</title>
		<link>http://blog.mastykarz.nl/obtain-fields-values-splistitem/comment-page-1/#comment-8215</link>
		<dc:creator>Erik Burger</dc:creator>
		<pubDate>Fri, 14 Nov 2008 13:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mastykarz.nl/obtain-fields-values-splistitem/#comment-8215</guid>
		<description>Excellent code. I am sure it will save a lot of people a lot of hassle, including me :)

One question/remark. 

You say at one point &quot;Because it might just happen that you’re passing an invalid id, the whole process of retrieving and processing the value is wrapped in a try catch clause.&quot;

Is there a specific reason why you would not use the following:

if (listItem.Fields.ContainsField(&quot;MyDateField&quot;))
{
  // Enter retrieval code here
}

This seems to me a typical situation in which you can save yourself (and the CLR) the trouble of using Exceptions. But I might be missing something.

Regards,
Erik</description>
		<content:encoded><![CDATA[<p>Excellent code. I am sure it will save a lot of people a lot of hassle, including me <img src='http://blog.mastykarz.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One question/remark. </p>
<p>You say at one point &#034;Because it might just happen that you’re passing an invalid id, the whole process of retrieving and processing the value is wrapped in a try catch clause.&#034;</p>
<p>Is there a specific reason why you would not use the following:</p>
<p>if (listItem.Fields.ContainsField(&#034;MyDateField&#034;))<br />
{<br />
  // Enter retrieval code here<br />
}</p>
<p>This seems to me a typical situation in which you can save yourself (and the CLR) the trouble of using Exceptions. But I might be missing something.</p>
<p>Regards,<br />
Erik</p>
]]></content:encoded>
	</item>
</channel>
</rss>
