<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Efficient way to add a new item to a SharePoint list</title>
	<atom:link href="http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/</link>
	<description>Software and Technology Tid-bits</description>
	<lastBuildDate>Mon, 09 Jan 2012 22:06:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: TazD</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-1155</link>
		<dc:creator><![CDATA[TazD]]></dc:creator>
		<pubDate>Fri, 08 Apr 2011 08:41:51 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-1155</guid>
		<description><![CDATA[Very helpful post. Thanks. 
We are using this solution, but we&#039;ve noticed a problem.

The case:
OwnFolder is custom type inherited from SPFolder.
ItemUpdated event handler is attached to OwnFolder&#039;s ItemUpdated. We want on moderation status change (inside ItemUpdated event) to do something to the items inside the folder. But when the folder was created using the AddItem on moderation status change the code inside ItemUpdated is not executed. All other events are executed correctly except this one. 
We have verified that when the folder is created through list.Items.Add(..) the problem is not verified.

How we create:
Creating SPFolder using AddItem and changing the content type to OwnFolder. Like this:
SPListItem item = GetEmptyItems(list).Add(folderUrl, fsoType, fsoName);
item.SystemUpdate(false);
item[SPBuiltInFieldId.ContentTypeId] = OwnFolderContentTypeId;
item.SystemUpdate(false);

I hope this helps someone as I haven&#039;t found any info on this problem anywhere.]]></description>
		<content:encoded><![CDATA[<p>Very helpful post. Thanks.<br />
We are using this solution, but we&#8217;ve noticed a problem.</p>
<p>The case:<br />
OwnFolder is custom type inherited from SPFolder.<br />
ItemUpdated event handler is attached to OwnFolder&#8217;s ItemUpdated. We want on moderation status change (inside ItemUpdated event) to do something to the items inside the folder. But when the folder was created using the AddItem on moderation status change the code inside ItemUpdated is not executed. All other events are executed correctly except this one.<br />
We have verified that when the folder is created through list.Items.Add(..) the problem is not verified.</p>
<p>How we create:<br />
Creating SPFolder using AddItem and changing the content type to OwnFolder. Like this:<br />
SPListItem item = GetEmptyItems(list).Add(folderUrl, fsoType, fsoName);<br />
item.SystemUpdate(false);<br />
item[SPBuiltInFieldId.ContentTypeId] = OwnFolderContentTypeId;<br />
item.SystemUpdate(false);</p>
<p>I hope this helps someone as I haven&#8217;t found any info on this problem anywhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: List Item Add Using SPQuery &#171; Sladescross&#039;s Blog</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-1130</link>
		<dc:creator><![CDATA[List Item Add Using SPQuery &#171; Sladescross&#039;s Blog]]></dc:creator>
		<pubDate>Tue, 14 Dec 2010 16:15:29 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-1130</guid>
		<description><![CDATA[[...] it sounds weird, but it’s true – it’s more efficient to run an empty query to get an SPListItemCollection to add the new SPListItem to, than to use SPList.Items.Add(). [...]]]></description>
		<content:encoded><![CDATA[<p>[...] it sounds weird, but it’s true – it’s more efficient to run an empty query to get an SPListItemCollection to add the new SPListItem to, than to use SPList.Items.Add(). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Random things I learnt doing a code review &#187; Andy Burns&#8217; SharePoint Blog</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-1129</link>
		<dc:creator><![CDATA[Random things I learnt doing a code review &#187; Andy Burns&#8217; SharePoint Blog]]></dc:creator>
		<pubDate>Mon, 13 Dec 2010 14:02:12 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-1129</guid>
		<description><![CDATA[[...] it sounds weird, but it&#8217;s true &#8211; it&#8217;s more efficient to run an empty query to get an SPListItemCollection to add the new SPListItem to, than to use SPList.Items.Add(). [...]]]></description>
		<content:encoded><![CDATA[<p>[...] it sounds weird, but it&#8217;s true &#8211; it&#8217;s more efficient to run an empty query to get an SPListItemCollection to add the new SPListItem to, than to use SPList.Items.Add(). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Garrett</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-907</link>
		<dc:creator><![CDATA[Rob Garrett]]></dc:creator>
		<pubDate>Wed, 04 Nov 2009 19:27:27 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-907</guid>
		<description><![CDATA[SPQuery q = new SPQuery();
Query = EmptyQuery;

Object inline initialization is part of .NET 3.0 and Visual Studio 2008.]]></description>
		<content:encoded><![CDATA[<p>SPQuery q = new SPQuery();<br />
Query = EmptyQuery;</p>
<p>Object inline initialization is part of .NET 3.0 and Visual Studio 2008.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Ackerbuch</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-905</link>
		<dc:creator><![CDATA[Joseph Ackerbuch]]></dc:creator>
		<pubDate>Wed, 04 Nov 2009 14:56:09 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-905</guid>
		<description><![CDATA[The syntax of
SPQuery q = new SPQuery {Query = EmptyQuery};
does not work in Visual Studio 2005 and .NET2.0
How is the correct syntax for those VS2005?
Thanks.]]></description>
		<content:encoded><![CDATA[<p>The syntax of<br />
SPQuery q = new SPQuery {Query = EmptyQuery};<br />
does not work in Visual Studio 2005 and .NET2.0<br />
How is the correct syntax for those VS2005?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: #30 Sharepoint: Accessing a Site Collection within a Workflow and updating a list &#171; Integration Points</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-862</link>
		<dc:creator><![CDATA[#30 Sharepoint: Accessing a Site Collection within a Workflow and updating a list &#171; Integration Points]]></dc:creator>
		<pubDate>Mon, 20 Jul 2009 21:41:34 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-862</guid>
		<description><![CDATA[[...] Credit due for OptimizedAddItem(): http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Credit due for OptimizedAddItem(): <a href="http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/" rel="nofollow">http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-861</link>
		<dc:creator><![CDATA[Denis]]></dc:creator>
		<pubDate>Wed, 17 Jun 2009 17:28:21 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-861</guid>
		<description><![CDATA[Some comments on MSDN&#039;s SharePoint Best Practices page were complaining that the SPListItem.AddItem() method was missing.

http://msdn.microsoft.com/en-us/library/bb687949.aspx 

I let them in on your helpful code here (re-cast as an extension method). Thanks for making it available.

Cheers!]]></description>
		<content:encoded><![CDATA[<p>Some comments on MSDN&#8217;s SharePoint Best Practices page were complaining that the SPListItem.AddItem() method was missing.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb687949.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb687949.aspx</a> </p>
<p>I let them in on your helpful code here (re-cast as an extension method). Thanks for making it available.</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SharePoint Document Library and List &#8211; File Upload &#171; Karthikeyan K&#8217;s Blog</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-838</link>
		<dc:creator><![CDATA[SharePoint Document Library and List &#8211; File Upload &#171; Karthikeyan K&#8217;s Blog]]></dc:creator>
		<pubDate>Wed, 27 May 2009 14:54:14 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-838</guid>
		<description><![CDATA[[...] can look for more info about adding list item efficiently in this article by Rob [...]]]></description>
		<content:encoded><![CDATA[<p>[...] can look for more info about adding list item efficiently in this article by Rob [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Burns</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-832</link>
		<dc:creator><![CDATA[Andy Burns]]></dc:creator>
		<pubDate>Tue, 03 Mar 2009 17:43:54 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-832</guid>
		<description><![CDATA[Ah! So that&#039;s why they have them! Always did wonder why the separate ItemCount - always figured it was just a shortcut...   ...but it makes sense now!

Methinks I&#039;ll have to go tell the rest of the team...]]></description>
		<content:encoded><![CDATA[<p>Ah! So that&#8217;s why they have them! Always did wonder why the separate ItemCount &#8211; always figured it was just a shortcut&#8230;   &#8230;but it makes sense now!</p>
<p>Methinks I&#8217;ll have to go tell the rest of the team&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http://</title>
		<link>http://blog.robgarrett.com/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list/#comment-831</link>
		<dc:creator><![CDATA[http://]]></dc:creator>
		<pubDate>Tue, 03 Mar 2009 17:40:35 +0000</pubDate>
		<guid isPermaLink="false">/cs/blogs/software/archive/2009/02/25/efficient-way-to-add-a-new-item-to-a-sharepoint-list.aspx#comment-831</guid>
		<description><![CDATA[Hi Rob,

SPList.Items.Add will fire events but in that case hopefully all the necessary column fields will be populated (e.g. Title), so any alert or workflow that get created will have all the information they need.

The only reason I bring it up is because in my experience, with such an approach email alerts will still be sent out without any information (other than the List Item ID). So it is something to be aware of.

~

P.S. - Nice blog. It is very well organized and has extremely useful content.]]></description>
		<content:encoded><![CDATA[<p>Hi Rob,</p>
<p>SPList.Items.Add will fire events but in that case hopefully all the necessary column fields will be populated (e.g. Title), so any alert or workflow that get created will have all the information they need.</p>
<p>The only reason I bring it up is because in my experience, with such an approach email alerts will still be sent out without any information (other than the List Item ID). So it is something to be aware of.</p>
<p>~</p>
<p>P.S. &#8211; Nice blog. It is very well organized and has extremely useful content.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

