<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dotnet thoughts &#187; Sharepoint API</title>
	<atom:link href="http://www.dotnetthoughts.net/tag/sharepoint-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotnetthoughts.net</link>
	<description>a dotnet developer&#039;s technical blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 03:18:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to access SharePoint List Items using Silverlight Object Model</title>
		<link>http://www.dotnetthoughts.net/2010/11/04/how-to-access-sharepoint-list-items-using-silverlight-object-model/</link>
		<comments>http://www.dotnetthoughts.net/2010/11/04/how-to-access-sharepoint-list-items-using-silverlight-object-model/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 15:36:01 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 3.0 / 3.5]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Sharepoint API]]></category>
		<category><![CDATA[Silverlight Object Model]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=1199</guid>
		<description><![CDATA[In the last postI introduced the Silverlight Object Model, which helps to access the SharePoint objects directly from Silverlight. In this I am posting about how to access SharePoint List Items using Silverlight Object Model. In this I am using &#8230; <a href="http://www.dotnetthoughts.net/2010/11/04/how-to-access-sharepoint-list-items-using-silverlight-object-model/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.dotnetthoughts.net/2010/10/26/using-the-silverlight-object-model/">last post</a>I introduced the Silverlight Object Model, which helps to access the SharePoint objects directly from Silverlight. In this I am posting about how to access SharePoint List Items using Silverlight Object Model. In this I am using Caml query object, which is used to get the Fields.</p>
<pre class="brush: csharp; title: ; notranslate">
private Web oWebSite = null;
private List oList = null;
private ListItemCollection oListItems = null;
private ClientContext clientContext = null;

this.clientContext = ClientContext.Current;
if (this.clientContext == null)
{
this.clientContext = new ClientContext(url);
}
using (this.clientContext)
{
this.oWebSite = clientContext.Web;
this.oList = this.oWebSite.Lists.GetByTitle(this.listName);
this.oListItems = this.oList.GetItems(CamlQuery.CreateAllItemsQuery());
    clientContext.Load(this.oListItems);
clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed);
}

private void onQuerySucceeded(object sender, ClientRequestSucceededEventArgs args)
{
//FillItems method converts the List items to Class Properties
//and binds them to the Silverlight User Interface.
this.Dispatcher.BeginInvoke(new Action(FillItems));
}

private void onQueryFailed(object sender, ClientRequestFailedEventArgs args)
{
MessageBox.Show(&quot;An error occured.\n&quot; + args.Message + &quot;\n&quot; + args.StackTrace);
}
</pre>
<p>And if you don&#8217;t want all the columns or you want to specify the columns you want to access you can use Caml Query object&#8217;s ViewXml property.</p>
<pre class="brush: csharp; title: ; notranslate">
CamlQuery camlQuery = new CamlQuery();
string query = &quot;&lt;OrderBy&gt;&lt;FieldRef Name='Name' Ascending='False' /&gt;&lt;/OrderBy&gt;&quot;;
camlQuery.ViewXml = query;
this.oListItems = this.oList.GetItems(camlQuery);
</pre>
<p>You can access CustomLists and Document Libraries by this method.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2010/10/26/using-the-silverlight-object-model/" title="Permanent link to Using the Silverlight Object Model">Using the Silverlight Object Model</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/11/15/how-to-add-items-to-sharepoint-list-using-silverlight-object-model/" title="Permanent link to How to Add Items to Sharepoint list using Silverlight Object Model">How to Add Items to Sharepoint list using Silverlight Object Model</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/09/20/drag-and-drop-in-silverlight-3/" title="Permanent link to Drag and Drop in Silverlight 3">Drag and Drop in Silverlight 3</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/01/06/file-uploader-using-silverlight-and-wcf/" title="Permanent link to File Uploader using Silverlight and WCF">File Uploader using Silverlight and WCF</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/11/05/hosting-silverlight-application-in-sharepoint-2010/" title="Permanent link to Hosting Silverlight application in Sharepoint 2010">Hosting Silverlight application in Sharepoint 2010</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2010/11/04/how-to-access-sharepoint-list-items-using-silverlight-object-model/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using the Silverlight Object Model</title>
		<link>http://www.dotnetthoughts.net/2010/10/26/using-the-silverlight-object-model/</link>
		<comments>http://www.dotnetthoughts.net/2010/10/26/using-the-silverlight-object-model/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 15:30:42 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#.Net]]></category>
		<category><![CDATA[Sharepoint API]]></category>
		<category><![CDATA[Silverlight Object Model]]></category>

		<guid isPermaLink="false">http://www.dotnetthoughts.net/?p=1192</guid>
		<description><![CDATA[Recently I moved to a new project where I have to integrate Silverlight with SharePoint. I had done a few posts regarding this also. Yesterday I found that in SharePoint 2010(SharePoint foundation), Microsoft introduces Silverlight Object Model which helps to &#8230; <a href="http://www.dotnetthoughts.net/2010/10/26/using-the-silverlight-object-model/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I moved to a new project where I have to integrate Silverlight with SharePoint. I had done a few posts regarding this also. Yesterday I found that in SharePoint 2010(SharePoint foundation), Microsoft introduces Silverlight Object Model which helps to access SharePoint Lists and Document Libraries directly from Silverlight.</p>
<p>Here is my first experiment with Silverlight Object Model which helps to retrieve all the Lists from a given SharePoint site, and displays it in a Combo Box.</p>
<pre class="brush: csharp; title: ; notranslate">
private Web oWebSite;
private ListCollection collList;
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    using (ClientContext clientContext = new ClientContext(&quot;http://sharepoint2010/&quot;))
    {
        this.oWebSite = clientContext.Web;
        this.collList = this.oWebSite.Lists;
        clientContext.Load(collList);
        clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed);
    }
}

private void onQuerySucceeded(object sender, ClientRequestSucceededEventArgs args)
{
    this.Dispatcher.BeginInvoke(new Action(DisplayLists));
}
private void onQueryFailed(object sender, ClientRequestFailedEventArgs args)
{
    MessageBox.Show(&quot;An error occured.\n&quot; + args.Message + &quot;\n&quot; + args.StackTrace);
}

private void DisplayLists()
{
    foreach (List item in collList)
    {
        lstItems.Items.Add(item.Title);
    }
}
</pre>
<p>Because query execution is asynchronous when you use the SharePoint Foundation Silverlight object model, you must pass delegates for callback methods as parameters in the ExecuteQueryAsync(ClientRequestSucceededEventHandler, ClientRequestFailedEventHandler) method.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2010/11/04/how-to-access-sharepoint-list-items-using-silverlight-object-model/" title="Permanent link to How to access SharePoint List Items using Silverlight Object Model">How to access SharePoint List Items using Silverlight Object Model</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/11/15/how-to-add-items-to-sharepoint-list-using-silverlight-object-model/" title="Permanent link to How to Add Items to Sharepoint list using Silverlight Object Model">How to Add Items to Sharepoint list using Silverlight Object Model</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/11/05/hosting-silverlight-application-in-sharepoint-2010/" title="Permanent link to Hosting Silverlight application in Sharepoint 2010">Hosting Silverlight application in Sharepoint 2010</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/09/20/drag-and-drop-in-silverlight-3/" title="Permanent link to Drag and Drop in Silverlight 3">Drag and Drop in Silverlight 3</a>  </li>
<li> <a href="http://www.dotnetthoughts.net/2010/10/11/silverlight-in-sharepoint-wss-3-0/" title="Permanent link to Silverlight in Sharepoint (WSS 3.0)">Silverlight in Sharepoint (WSS 3.0)</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2010/10/26/using-the-silverlight-object-model/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SPUtility.SendEmail</title>
		<link>http://www.dotnetthoughts.net/2007/11/07/sputilitysendemail/</link>
		<comments>http://www.dotnetthoughts.net/2007/11/07/sputilitysendemail/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 23:02:49 +0000</pubDate>
		<dc:creator>Anuraj P</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C#.Net]]></category>
		<category><![CDATA[Sharepoint API]]></category>
		<category><![CDATA[SPContext]]></category>
		<category><![CDATA[SPUtility]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://anuraj.wordpress.com/2007/11/07/sputilitysendemail/</guid>
		<description><![CDATA[In my project I need to send mail to Administrator, while adding items to a list using Webpart. I have tried ASP.Net, System.Net namespace but I need to read all the server and mail settings from any config file. After &#8230; <a href="http://www.dotnetthoughts.net/2007/11/07/sputilitysendemail/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my project I need to send mail to Administrator, while adding items to a list using Webpart. I have tried ASP.Net, System.Net namespace but I need to read all the server and mail settings from any config file. After I got sharepoint&#8217;s own mechanism to send mail.</p>
<pre class="brush: csharp; title: ; notranslate">
SPUtility.SendEmail(SPContext.Current.Site.OpenWeb(), false, false, &quot;admin@myserver.com&quot;, &quot;Hello World&quot;, &quot;This is a Sample Mail&quot;);
</pre>
<p>This will send a mail to &#8220;admin@myserver.com&#8221;, with &#8220;Hello World&#8221; as subject and &#8220;This is a Sample Mail&#8221; as body. You can send HTML emails by changing the third parameter to TRUE.</p>
<p>Update : You may need to use <strong>SPSecurity.RunWithElevatedPrivileges</strong> method to send mails.</p>
<p>Url :<a target="_blank" href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx"></p>
<p>http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx</a></p>
<p>This method enable users to Execute the specified method with Full Control rights even if the user does not otherwise have Full Control.</p>
<div class="betterrelated"><p><strong>Related content:</strong></p>
<ol><li> <a href="http://www.dotnetthoughts.net/2011/07/02/fluent-email-library-for-c-using-dynamicobject/" title="Permanent link to Fluent email library for c# using DynamicObject">Fluent email library for c# using DynamicObject</a>  </li>
</ol></div>]]></content:encoded>
			<wfw:commentRss>http://www.dotnetthoughts.net/2007/11/07/sputilitysendemail/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

