<?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>Sharepoint Server &#187; Sharepoint</title>
	<atom:link href="http://www.fivenumber.com/tag/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fivenumber.com</link>
	<description>It&#039;s all about SharePoint</description>
	<lastBuildDate>Tue, 03 Jan 2012 16:33:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
<link>http://www.fivenumber.com</link>
<url>http://www.fivenumber.com/wp-content/mbp-favicon/5.jpg</url>
<title>Sharepoint Server</title>
</image>
		<item>
		<title>SharePoint Document Counter Counts The Document Downloads</title>
		<link>http://www.fivenumber.com/sharepoint-document-counter-counts-the-document-downloads/</link>
		<comments>http://www.fivenumber.com/sharepoint-document-counter-counts-the-document-downloads/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 19:26:36 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[SharePoint 2010 - Object Model]]></category>
		<category><![CDATA[Custom Webparts]]></category>
		<category><![CDATA[download counter]]></category>
		<category><![CDATA[object model]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=914</guid>
		<description><![CDATA[In this post I&#8217;m going to show you how to count the document events of SharePoint site, after going through this post you will learn how to count the document downloads, views, updates, deletion, restoration etc. I remember this solution has been asked by few people on this blog. Before knowing the document events (add, [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I&#8217;m going to show you how to count the document events of SharePoint site, after going through this post you will learn how to count the document downloads, views, updates, deletion, restoration etc.</p>
<p>I remember this solution has been asked by few people on this blog.</p>
<p>Before knowing the document events (add, delete, update, view etc) we have to configure the audit entry settings for the SharePoint site collection in site settings page under <strong>Site Collection Administration</strong> section (see figure 1)</p>
<div id="attachment_915" class="wp-caption aligncenter" style="width: 274px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/12/1.jpg" rel="lightbox[914]"><img class="size-medium wp-image-915" title="Figure 1 - Configure Site Collection Audit Settings" src="http://www.fivenumber.com/wp-content/uploads/2010/12/1-264x300.jpg" alt="Figure 1 - Configure Site Collection Audit Settings" width="264" height="300" /></a><p class="wp-caption-text">Figure 1 - Configure Site Collection Audit Settings</p></div>
<p>On <strong>Audit Settings</strong> page check the required events to track, in this example I&#8217;m configuring for <strong>Opening or downloading documents, viewing items in lists, or viewing item properties</strong>, <strong>Editing items</strong>, <strong>Deleting or restoring items</strong></p>
<div id="attachment_917" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/12/21.jpg" rel="lightbox[914]"><img class="size-medium wp-image-917" title="Figure 2 - Configure Audit Events" src="http://www.fivenumber.com/wp-content/uploads/2010/12/21-300x130.jpg" alt="Figure 2 - Configure Audit Events" width="300" height="130" /></a><p class="wp-caption-text">Figure 2 - Configure Audit Events</p></div>
<p>You can also configure audit entry settings programmatically with few lines of code, here it is:</p>
<pre class="brush: csharp; title: ; notranslate">
static void Main()
        {
            using (SPSite mySite = new SPSite(&quot;http://&lt;servername&gt;:port&quot;))
            {
                using (SPWeb myWeb = mySite.OpenWeb())
                {
                    mySite.Audit.AuditFlags = SPAuditMaskType.All; //Configures all settings

                    //you can even configure specific settings using the below lines of code

                    //mySite.Audit.AuditFlags = SPAuditMaskType.CheckIn | SPAuditMaskType.CheckOut | SPAuditMaskType.ChildDelete |
                    //     SPAuditMaskType.Copy | SPAuditMaskType.Delete | SPAuditMaskType.Move | SPAuditMaskType.ProfileChange |
                    //     SPAuditMaskType.SchemaChange | SPAuditMaskType.Search | SPAuditMaskType.SecurityChange |
                    //     SPAuditMaskType.Undelete | SPAuditMaskType.Update | SPAuditMaskType.View | SPAuditMaskType.Workflow;

                    //mySite.Audit.AuditFlags = SPAuditMaskType.None; //Configures to none
                    mySite.Audit.Update();

                }
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p>After configuring the settings, SharePoint audits the library events on item viewing, downloading, editing, deleting etc.,<br />
SharePoint also generates audit log reports on this events in .CSV format. In this example we are reading the data from the configured audit entry logs to know event actions on documents.</p>
<p>Use the below code to know the event count on documents</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.ComponentModel;
using System.Web;
using System.Text;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace DownloadCounter.VisualWebPart1
{
    [ToolboxItemAttribute(false)]
    public class VisualWebPart1 : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @&quot;~/_CONTROLTEMPLATES/DownloadCounter/DownloadCounterWebPart/DownloadCounterUserControl.ascx&quot;;
        SPGridView myGridView;
        SPDataSource myDataSource = new SPDataSource();
        string errorMessage = string.Empty;

        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);

            base.CreateChildControls();

            myGridView = new SPGridView();
            myGridView.AutoGenerateColumns = false;
            myGridView.Enabled = true;
            myGridView.AllowSorting = true;
            myGridView.AllowGrouping = true;
            myGridView.AllowGroupCollapse = true;
            myGridView.GroupField = &quot;Event&quot;;
            myGridView.DisplayGroupFieldName = false;
            myGridView.AllowPaging = true;
            myGridView.PageSize = 50;
            myGridView.PageIndexChanging += new GridViewPageEventHandler(myGridView_PageIndexChanging);

            BoundField colEvent = new BoundField();
            colEvent.DataField = &quot;Event&quot;;
            colEvent.HeaderText = &quot;Event&quot;;
            this.myGridView.Columns.Add(colEvent);

            BoundField colItemType = new BoundField();
            colItemType.DataField = &quot;ItemType&quot;;
            colItemType.HeaderText = &quot;ItemType&quot;;
            this.myGridView.Columns.Add(colItemType);

            BoundField colDocLocation = new BoundField();
            colDocLocation.DataField = &quot;DocLocation&quot;;
            colDocLocation.HeaderText = &quot;DocLocation&quot;;
            this.myGridView.Columns.Add(colDocLocation);

            BoundField colOccurred = new BoundField();
            colOccurred.DataField = &quot;Occurred&quot;;
            colOccurred.HeaderText = &quot;Occurred&quot;;
            this.myGridView.Columns.Add(colOccurred);

            BoundField colUserName = new BoundField();
            colUserName.DataField = &quot;UserName&quot;;
            colUserName.HeaderText = &quot;UserName&quot;;
            this.myGridView.Columns.Add(colUserName);

            Controls.Add(myGridView);
            myGridView.PagerTemplate = null;
            GetAudEntries();
            GroupByGridView();
        }
        private void GroupByGridView()
        {
            StringBuilder scriptFunction = new StringBuilder();
            scriptFunction.Append(&quot;&lt;script src='/SiteAssets/jquery-1.4.2.min.js' type='text/javascript'&gt;&lt;/script&gt;&quot;);
            scriptFunction.Append(&quot;&lt;script type='text/javascript'&gt;&quot;);
            scriptFunction.Append(&quot;$(document).ready(function(){$('.ms-gb').each(function(){var rowNums=$(this).nextUntil('.ms-gb').length;&quot;);
            scriptFunction.Append(&quot;$(this).children(0).append('('+rowNums+')');&quot;);
            scriptFunction.Append(&quot;$(this).children(0).children(0).trigger('onclick');&quot;);
            scriptFunction.Append(&quot;});&quot;);
            scriptFunction.Append(&quot;});&quot;);
            scriptFunction.Append(&quot;&lt;/script&gt;&quot;);
            Page.ClientScript.RegisterStartupScript(Page.GetType(), &quot;GroupBy&quot;, scriptFunction.ToString());
        }

        private void GetAudEntries()
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                SPSite mySite = SPContext.Current.Site;
                SPWeb myWeb = SPContext.Current.Web;
                DataTable myDataTable = new DataTable();
                DataRow myRow;
                SPUser user;
                try
                {
                    SPAuditQuery wssQuery = new SPAuditQuery(mySite);
                    SPAuditEntryCollection auditCol = mySite.Audit.GetEntries(wssQuery);

                    myDataTable.Columns.Add(&quot;Event&quot;);
                    myDataTable.Columns.Add(&quot;ItemType&quot;);
                    myDataTable.Columns.Add(&quot;DocLocation&quot;);
                    myDataTable.Columns.Add(&quot;Occurred&quot;, typeof(DateTime));
                    myDataTable.Columns.Add(&quot;UserName&quot;);

                    foreach (SPAuditEntry entry in auditCol)
                    {
                        if (entry.DocLocation.EndsWith(&quot;.xls&quot;) || (entry.DocLocation.EndsWith(&quot;.doc&quot;)) || (entry.DocLocation.EndsWith(&quot;.ppt&quot;)))
                        {
                            user = myWeb.SiteUsers.GetByID(entry.UserId);
                            myRow = myDataTable.NewRow();
                            myRow[&quot;Event&quot;] = entry.Event;
                            myRow[&quot;ItemType&quot;] = entry.ItemType.ToString();
                            myRow[&quot;DocLocation&quot;] = entry.DocLocation;
                            myRow[&quot;Occurred&quot;] = entry.Occurred.ToLocalTime();
                            myRow[&quot;UserName&quot;] = user.ToString();
                            myDataTable.Rows.Add(myRow);
                        }
                    }
                    myGridView.DataSource = myDataTable;
                    myGridView.DataBind();
                }
                catch (Exception ex)
                {
                    errorMessage = ex.ToString();
                }
            });

        }
        void myGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            myGridView.PageIndex = e.NewPageIndex;
            myGridView.DataBind();
        }

        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.Write(errorMessage);
            EnsureChildControls();
            RenderChildren(writer);
        }
    }
}
</pre>
<p>Use the above code or try to deploy the <a title="SharePoint Download Counter" href="http://www.fivenumber.com/wp-content/uploads/2010/12/DownloadCounter.wsp" target="_blank">DownloadCounter.wsp</a><br />
<strong>Note</strong>: In the above code we have used JQuery jquery-1.4.2.min.js files to show the count of the group by field, so please download the jquery-1.4.2.min.js file from <a href="http://code.jquery.com/jquery-1.4.2.min.js" target="_blank">http://code.jquery.com/jquery-1.4.2.min.js</a> and place in some location of the SharePoint site and also refer the same source location in the above code, in this example I have placed the Jquery file in Site Assets library, you can even place in the same location if you don&#8217;t want to change the code.</p>
<p>After deploying the downloaded solution, please try to activate<strong> Download Counter Feature</strong> see figure 3</p>
<div id="attachment_918" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/12/3.jpg" rel="lightbox[914]"><img class="size-medium wp-image-918" title="Figure 3 - Activate Download Counter Feature" src="http://www.fivenumber.com/wp-content/uploads/2010/12/3-300x19.jpg" alt="Figure 3 - Activate Download Counter Feature" width="300" height="19" /></a><p class="wp-caption-text">Figure 3 - Activate Download Counter Feature</p></div>
<p>Then add the webpart to the page see figure 4</p>
<div id="attachment_919" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/12/4.jpg" rel="lightbox[914]"><img class="size-medium wp-image-919" title="Figure 4 - Adding Download Counter WebPart to SharePoint Site" src="http://www.fivenumber.com/wp-content/uploads/2010/12/4-300x219.jpg" alt="Figure 4 - Adding Download Counter WebPart to SharePoint Site" width="300" height="219" /></a><p class="wp-caption-text">Figure 4 - Adding Download Counter WebPart to SharePoint Site</p></div>
<p>Then you can view the webpart updating on every action of documents see figure 5</p>
<div id="attachment_920" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/12/5.jpg" rel="lightbox[914]"><img class="size-medium wp-image-920" title="Figure 5 - Download counter webPart shows the count of events for the documents" src="http://www.fivenumber.com/wp-content/uploads/2010/12/5-300x250.jpg" alt="Figure 5 - Download counter webPart shows the count of events for the documents" width="300" height="250" /></a><p class="wp-caption-text">Figure 5 - Download counter webPart shows the count of events for the documents</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/sharepoint-document-counter-counts-the-document-downloads/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Most Common Custom WebParts Part 4 – Flash Media WebPart</title>
		<link>http://www.fivenumber.com/most-common-custom-webparts-part-4-%e2%80%93-flash-media-webpart/</link>
		<comments>http://www.fivenumber.com/most-common-custom-webparts-part-4-%e2%80%93-flash-media-webpart/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 21:33:53 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[MOSS - Object Model]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>
		<category><![CDATA[SharePoint 2010 - Object Model]]></category>
		<category><![CDATA[Custom Webparts]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=895</guid>
		<description><![CDATA[In my previous post you can view the most commonly used custom webparts, Tree View WebPart Shows Sites and Sub-Sites, Menu WebPart Shows Sites and Sub-Sites in Fly-Out Mode, Windows Media Player WebPart In this continuation series of most commonly used custom webparts, I come up with a simple Flash Player webpart which plays flash [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post you can view the most commonly used custom webparts, Tree View WebPart Shows Sites and Sub-Sites, Menu WebPart Shows Sites and Sub-Sites in Fly-Out Mode, Windows Media Player WebPart</p>
<p>In this continuation series of most commonly used custom webparts, I come up with a simple Flash Player webpart which plays flash files on Sharepoint sites, the webpart also supports to configure the properties as required.</p>
<p>Download the solution file <a title="Flash Media Player WebPart Solution" href="www.fivenumber.com/wp-content/uploads/2010/11/FlashWebPart.wsp" target="_blank">FlashWebPart.wsp</a></p>
<div id="attachment_896" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/18.jpg" rel="lightbox[895]"><img class="size-medium wp-image-896" title="Flash Media Player WebPart" src="http://www.fivenumber.com/wp-content/uploads/2010/11/18-300x218.jpg" alt="Flash Media Player WebPart" width="300" height="218" /></a><p class="wp-caption-text">Flash Media Player WebPart</p></div>
<div id="attachment_897" class="wp-caption aligncenter" style="width: 200px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/33.jpg" rel="lightbox[895]"><img class="size-medium wp-image-897" title="Flash Media Player WebPart Configuration" src="http://www.fivenumber.com/wp-content/uploads/2010/11/33-190x300.jpg" alt="Flash Media Player WebPart Configuration" width="190" height="300" /></a><p class="wp-caption-text">Flash Media Player WebPart Configuration</p></div>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace FlashWebPart.Flash
{
    [ToolboxItemAttribute(false)]
    public class Flash : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        //private const string _ascxPath = @&quot;~/_CONTROLTEMPLATES/FlashWebPart/Flash/FlashWebPartUserControl.ascx&quot;;

        private string flashFilePath = &quot;http://www.adobe.com/content/dam/Adobe/en/devnet/flash/samples/time_1/1_timer.swf&quot;;
        private string flashWidth = &quot;320&quot;;
        private string flashHeight = &quot;240&quot;;
        private string bgColor = string.Empty;
        private bool loopPlayBack = true;

        [WebBrowsable(true),
        Personalizable(PersonalizationScope.User),
        WebDescription(&quot;Specifies the media file location&quot;),
        Category(&quot;Flash Media Properties&quot;),
        WebDisplayName(&quot;Media File Location&quot;)]
        public string FlashFilePath
        {
            get { return flashFilePath; }
            set { flashFilePath = value; }
        }

        [WebBrowsable(true),
        Personalizable(PersonalizationScope.User),
        WebDescription(&quot;Sets the width of the Media player&quot;),
        Category(&quot;Flash Media Properties&quot;),
        WebDisplayName(&quot;Width&quot;)]
        public string FlashWidth
        {
            get { return flashWidth; }
            set { flashWidth = value; }
        }

        [WebBrowsable(true),
        Personalizable(PersonalizationScope.User),
        WebDescription(&quot;Sets the height of the Media player&quot;),
        Category(&quot;Flash Media Properties&quot;),
        WebDisplayName(&quot;Height&quot;)]
        public string FlashHeight
        {
            get { return flashHeight; }
            set { flashHeight = value; }
        }

        [WebBrowsable(true),
        Personalizable(PersonalizationScope.User),
        WebDescription(&quot;Background Color: Specifies the back color&quot;),
        Category(&quot;Flash Media Properties&quot;),
        WebDisplayName(&quot;Background Color&quot;)]
        public string BGColor
        {
            get { return bgColor; }
            set { bgColor = value; }
        }

        [WebBrowsable(true),
        Personalizable(PersonalizationScope.User),
        WebDescription(&quot;Loop Play Back: (True/False) Repeats the video automatically&quot;),
        Category(&quot;Flash Media Properties&quot;),
        WebDisplayName(&quot;Loop Play Back&quot;)]
        public bool LoopPlayBack
        {
            get { return loopPlayBack; }
            set { loopPlayBack = value; }
        }

        //protected override void CreateChildControls()
        //{
        //    Control control = Page.LoadControl(_ascxPath);
        //    Controls.Add(control);
        //}

        protected override void Render(HtmlTextWriter writer)
        {
            SPSite site = null;
            SPWeb web = SPContext.Current.Web;
            if (!string.IsNullOrEmpty(FlashFilePath) &amp;&amp; !string.IsNullOrEmpty(FlashWidth) &amp;&amp; !string.IsNullOrEmpty(FlashHeight))
            {
                try
                {
                    SPSecurity.RunWithElevatedPrivileges(delegate()
                    {
                        site = new SPSite(web.Site.ID);

                        using (site)
                        {
                            #region Script
                            writer.Write(&quot;&lt;OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='&quot; + FlashWidth + &quot;' height='&quot; + FlashWidth + &quot;'&gt;&quot;);
                            writer.Write(&quot;&lt;param name='movie' value='&quot; + FlashFilePath + &quot;'&gt;&quot;);
                            writer.Write(&quot;&lt;param name='bgcolor' value='&quot; + BGColor + &quot;'&gt;&quot;);
                            writer.Write(&quot;&lt;param name='loop' value='&quot; + LoopPlayBack + &quot;'&gt;&quot;);
                            writer.Write(&quot;&lt;EMBED src='&quot; + FlashFilePath + &quot;' quality='high' bgcolor='#FFFFFF' width='&quot; + FlashWidth + &quot;' height='&quot; + FlashHeight + &quot;' loop='&quot; + LoopPlayBack + &quot;' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'&gt;&quot;);
                            writer.Write(&quot;&lt;/EMBED&gt;&quot;);
                            writer.Write(&quot;&lt;/OBJECT&gt;&quot;);
                            #endregion
                        }
                    });
                }
                catch (Exception ex)
                {
                    writer.Write(ex.Message);
                }
            }
            else
            {
                writer.Write(&quot;&lt;span class='ms-formvalidation'&gt;&quot;);
                writer.Write(&quot;Please configure the &lt;B&gt;Media WebPart&lt;/B&gt; properties in webpart properties section&quot;);
                writer.Write(&quot;&lt;/span&gt;&quot;);
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/most-common-custom-webparts-part-4-%e2%80%93-flash-media-webpart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Single Zone Split DNS</title>
		<link>http://www.fivenumber.com/single-zone-split-dns/</link>
		<comments>http://www.fivenumber.com/single-zone-split-dns/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 06:30:41 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[MOSS - General]]></category>
		<category><![CDATA[Sharepoint 2010 - General]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=865</guid>
		<description><![CDATA[Single Zone Split DNS -  This terminology is not correlated to SharePoint, but still I want to post in my blog, since I had stretch lot of my time to configure forward lookup zones on my Windows Server 2008 R2. You may think why I want to configure forward lookup zones, that is not my [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Single Zone Split DNS</strong> -  This terminology is not correlated to SharePoint, but still I want to post in my blog, since I had stretch lot of my time to configure forward lookup zones on my Windows Server 2008 R2.</p>
<p>You may think why I want to configure forward lookup zones, that is not my job and it is related to Windows administrator (not SharePoint admin)</p>
<p>Let me illuminate the contextual background first</p>
<p>Just recently I bought a new laptop with Core i5 2.66 Ghz processor, installed memory of 6GB RAM, system type is 64 bit, I got the laptop with pre-installed OS Windows 7 however my idea is to create a server farm on single machine, so initially I have installed a fresh copy of Windows Server 2008 R2 Enterprise (still Windows 7 is there and has choice of selecting the operating system before booting, we can call it as dual boot machine)</p>
<p>After installing Windows Server 2008 R2 ENT, I have configured DNS (Domain Name System) then given <strong>FIVENUMBER.COM</strong> as domain name, my full computer name is <strong>SHAREPOINT.FIVENUMBER.COM</strong> (SHAREPOINT is my computer name, computer name + domain name = full computer name), then in Active Directory I have created two service accounts for SharePoint basically <strong>FIVENUMBER\SPAdmin</strong> and <strong>FIVENUMBER\SPService</strong></p>
<p>At that moment I have restarted the system and logged in with the newly created account <strong>FIVENUMBER\SPAdmin</strong></p>
<p>Then, I have installed SQL Server 2008 R2 Enterprise Edition, followed by SharePoint 2010 pre-requisites, we will get pre-requisite installer file within the SharePoint 2010 software, then last but not least I have installed my favorite SharePoint 2010 Enterprise Edition</p>
<p>Throughout the installation period the whole thing went smooth without a single problem, and then after I was on the go to configuring services and created the first web application on the new laptop, creation of web application was very fast and site accessing too, as it is recommended 4GB of RAM for developer or evaluation use for SharePoint 2010 (Please have a look at <a title="Hardware and software requirements for SharePoint 2010" href="http://technet.microsoft.com/en-us/library/cc262485.aspx" target="_blank">hardware and software requirements for SharePoint 2010</a>) but my laptop has 6GB of RAM then apparently it will be fast.</p>
<p>Now we will get into the real article.</p>
<p>After finalizing the installations and configurations on my new laptop, I assumed to access my blog site <a title="www.fivenumber.com" href="http://www.fivenumber.com" target="_blank">www.fivenumber.com</a>, as soon as I type the URL in the browser a windows authentication prompt appeared, look as if prompt for SharePoint sites, observing the prompt I stood shocked and I provided the user and password and then it navigated to the SharePoint site which is running on 80 port number, I have tried couple of times to access my blog site but continuously it prompts the box and takes me to SharePoint site, the blog site was working without any problem if I access from another PC, but I cannot access the blog site from my new laptop, then I become conscious that my domain name is also same as my blog site name</p>
<p>At that point I started Binging and came to identify that this is called as Single Zone Split DSN and can be fixed by configuring forward lookup zone, that means I have to create a new zone under forward lookup zone in the DNS manager, then I have to create a new host (A record), then followed by creating an Alias (CNAME)</p>
<p>Now we will see step by step how to add a forward lookup zone in Windows Server 2008 R2</p>
<p>Go to <strong>Start </strong>&gt; <strong>Administrative Tools</strong> &gt; <strong>DNS </strong>(see Figure 1)</p>
<div id="attachment_866" class="wp-caption aligncenter" style="width: 275px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/16.jpg" rel="lightbox[865]"><img class="size-medium wp-image-866" title="Figure 1 - Configuring Forward Lookup Zone" src="http://www.fivenumber.com/wp-content/uploads/2010/11/16-265x300.jpg" alt="Figure 1 - Configuring Forward Lookup Zone" width="265" height="300" /></a><p class="wp-caption-text">Figure 1 - Configuring Forward Lookup Zone</p></div>
<p>In <strong>DNS Manager</strong>, right click on <strong>Forward Lookup Zones</strong> and click on <strong>New Zone</strong> (see Figure 2)</p>
<div id="attachment_867" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/21.jpg" rel="lightbox[865]"><img class="size-medium wp-image-867" title="Figure 2 - Create New Zone" src="http://www.fivenumber.com/wp-content/uploads/2010/11/21-300x154.jpg" alt="Figure 2 - Create New Zone" width="300" height="154" /></a><p class="wp-caption-text">Figure 2 - Create New Zone</p></div>
<p>Then <strong>New Zone Wizard</strong> will start click <strong>Next </strong>(see Figure 3)</p>
<div id="attachment_868" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/31.jpg" rel="lightbox[865]"><img class="size-medium wp-image-868" title="Figure 3 - New Zone Wizard" src="http://www.fivenumber.com/wp-content/uploads/2010/11/31-300x229.jpg" alt="Figure 3 - New Zone Wizard" width="300" height="229" /></a><p class="wp-caption-text">Figure 3 - New Zone Wizard</p></div>
<p>Under <strong>Zone Type</strong> ensure that <strong>Primary Zone</strong> is selected and <strong>Store the zone in Active Directory</strong> is checked, click <strong>Next </strong>(see Figure 4)</p>
<div id="attachment_869" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/41.jpg" rel="lightbox[865]"><img class="size-medium wp-image-869" title="Figure 4 - Zone Type" src="http://www.fivenumber.com/wp-content/uploads/2010/11/41-300x229.jpg" alt="Figure 4 - Zone Type" width="300" height="229" /></a><p class="wp-caption-text">Figure 4 - Zone Type</p></div>
<p>Under <strong>Active Directory Zone Replication Scope</strong> ensure that <strong>To all DNS servers running on domain controllers in this domain &lt;</strong><em>domainname.com</em><strong>&gt; is selected</strong>, click <strong>Next</strong> (see Figure 5)</p>
<div id="attachment_870" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/52.jpg" rel="lightbox[865]"><img class="size-medium wp-image-870" title="Figure 5 - Active Directory Zone Replication Scope" src="http://www.fivenumber.com/wp-content/uploads/2010/11/52-300x229.jpg" alt="Figure 5 - Active Directory Zone Replication Scope" width="300" height="229" /></a><p class="wp-caption-text">Figure 5 - Active Directory Zone Replication Scope</p></div>
<p>Under <strong>Zone Name</strong>, please provide the domain name (for example: fivenumber.com), click <strong>Next</strong> (see Figure 6)</p>
<div id="attachment_871" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/61.jpg" rel="lightbox[865]"><img class="size-medium wp-image-871" title="Figure 6 - Zone Name" src="http://www.fivenumber.com/wp-content/uploads/2010/11/61-300x230.jpg" alt="Figure 6 - Zone Name" width="300" height="230" /></a><p class="wp-caption-text">Figure 6 - Zone Name</p></div>
<p>Under <strong>Dynamic Update</strong> ensure that <strong>Allow only secure dynamic updates is selected</strong>, click <strong>Next</strong> (see Figure 7)</p>
<div id="attachment_872" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/71.jpg" rel="lightbox[865]"><img class="size-medium wp-image-872" title="Figure 7 - Dynamic Update" src="http://www.fivenumber.com/wp-content/uploads/2010/11/71-300x229.jpg" alt="Figure 7 - Dynamic Update" width="300" height="229" /></a><p class="wp-caption-text">Figure 7 - Dynamic Update</p></div>
<p>We reached the final step in the wizard and can view <strong>Completing the New Zone Wizard</strong>, click <strong>Finish</strong> (see Figure <img src='http://www.fivenumber.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </p>
<div id="attachment_873" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/81.jpg" rel="lightbox[865]"><img class="size-medium wp-image-873" title="Figure 8 - Completing the New Zone Wizard" src="http://www.fivenumber.com/wp-content/uploads/2010/11/81-300x229.jpg" alt="Figure 8 - Completing the New Zone Wizard" width="300" height="229" /></a><p class="wp-caption-text">Figure 8 - Completing the New Zone Wizard</p></div>
<p>Now we have to create a new host under the new zone, to do that select the newly created created zone, in the DNS manager, then right click and click on <strong>New Host (A or AAA)</strong> to create the A record (see Figure 9)</p>
<p><strong>For your information</strong>: A record is an entrance in the DNS zone, that maps each domain to an IP address.</p>
<div id="attachment_874" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/91.jpg" rel="lightbox[865]"><img class="size-medium wp-image-874" title="Figure 9 - Creating New Host (A record)" src="http://www.fivenumber.com/wp-content/uploads/2010/11/91-300x183.jpg" alt="Figure 9 - Creating New Host (A record)" width="300" height="183" /></a><p class="wp-caption-text">Figure 9 - Creating New Host (A record)</p></div>
<p>In the <strong>New Host</strong> dialog box provide the name as <strong>www </strong>and <strong>IP address</strong> in the appropriate boxes and click <strong>Add Host</strong> (see Figure 10)</p>
<p><strong>Note</strong>: You will come to know the IP address of the site when you ping the site in command prompt</p>
<div id="attachment_875" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/101.jpg" rel="lightbox[865]"><img class="size-medium wp-image-875" title="Figure 10 - Creating New Host" src="http://www.fivenumber.com/wp-content/uploads/2010/11/101-300x185.jpg" alt="Figure 10 - Creating New Host" width="300" height="185" /></a><p class="wp-caption-text">Figure 10 - Creating New Host</p></div>
<p>You can view the host record successfully created message (see Figure 11)</p>
<div id="attachment_876" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/111.jpg" rel="lightbox[865]"><img class="size-medium wp-image-876" title="Figure 11 - Host Record Successfully Created" src="http://www.fivenumber.com/wp-content/uploads/2010/11/111-300x185.jpg" alt="Figure 11 - Host Record Successfully Created" width="300" height="185" /></a><p class="wp-caption-text">Figure 11 - Host Record Successfully Created</p></div>
<p>Now we have to create a new alias under the new zone, to do that select  the newly created created zone, in the DNS manager, then right click and  click on <strong>New Alias (CNAME)</strong> to create the alias name (see Figure 12)</p>
<p><strong>For your information</strong>: Canonical Name in short called as <strong>CNAME </strong>that indicates the true host name of a computer that it&#8217;s aliases are linked with</p>
<div id="attachment_877" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/121.jpg" rel="lightbox[865]"><img class="size-medium wp-image-877" title="Figure 12 - Creating New Alias Name (CNAME)" src="http://www.fivenumber.com/wp-content/uploads/2010/11/121-300x190.jpg" alt="Figure 12 - Creating New Alias Name (CNAME)" width="300" height="190" /></a><p class="wp-caption-text">Figure 12 - Creating New Alias Name (CNAME)</p></div>
<p>In the <strong>New Resource Record</strong> dialog box provide <strong>Alias name</strong> as <strong>www2</strong>, then click on <strong>Browse </strong>and select the newly created host file <strong>www</strong> located under <strong>Forward Lookup Zones</strong> &gt; <strong><em>&lt;Newly created zone name</em></strong>&gt; (see Figure 13)</p>
<div id="attachment_878" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/131.jpg" rel="lightbox[865]"><img class="size-medium wp-image-878" title="Figure 13 - Creating Alias Name (CNAME)" src="http://www.fivenumber.com/wp-content/uploads/2010/11/131-300x287.jpg" alt="Figure 13 - Creating Alias Name (CNAME)" width="300" height="287" /></a><p class="wp-caption-text">Figure 13 - Creating Alias Name (CNAME)</p></div>
<p>After selecting the fully qualified name, click <strong>OK</strong> (see Figure 14)</p>
<div id="attachment_879" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/141.jpg" rel="lightbox[865]"><img class="size-medium wp-image-879" title="Figure 14 - Creating New Alias Name (CNAME)" src="http://www.fivenumber.com/wp-content/uploads/2010/11/141-300x224.jpg" alt="Figure 14 - Creating New Alias Name (CNAME)" width="300" height="224" /></a><p class="wp-caption-text">Figure 14 - Creating New Alias Name (CNAME)</p></div>
<p>We are done almost, now try to execute the NSLOOKUP command to verify the IP address of the site and ping the site to view the reply ping back (see Figure 15 and 16)</p>
<div id="attachment_880" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/151.jpg" rel="lightbox[865]"><img class="size-medium wp-image-880" title="Figure 15 - Executing NSLOOKUP command to verify the IP address of the site" src="http://www.fivenumber.com/wp-content/uploads/2010/11/151-300x169.jpg" alt="Figure 15 - Executing NSLOOKUP command to verify the IP address of the site" width="300" height="169" /></a><p class="wp-caption-text">Figure 15 - Executing NSLOOKUP command to verify the IP address of the site</p></div>
<div id="attachment_881" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/161.jpg" rel="lightbox[865]"><img class="size-medium wp-image-881" title="Figure 16 - Pinging the Site to view the reply ping back" src="http://www.fivenumber.com/wp-content/uploads/2010/11/161-300x147.jpg" alt="Figure 16 - Pinging the Site to view the reply ping back" width="300" height="147" /></a><p class="wp-caption-text">Figure 16 - Pinging the Site to view the reply ping back</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/single-zone-split-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting an Excel SpreadSheet to SharePoint 2010 list</title>
		<link>http://www.fivenumber.com/connecting-an-excel-spreadsheet-to-sharepoint-2010-list/</link>
		<comments>http://www.fivenumber.com/connecting-an-excel-spreadsheet-to-sharepoint-2010-list/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 06:55:24 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[Sharepoint 2010]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=844</guid>
		<description><![CDATA[Sharepoint 2010 has a feature of connecting an Excel workbook Whenever an item is added/updated/deleted in SharPoint list the record is also added/updated/deleted in the connected Excel workbook In this example we will see how to connect an Excel workbook to SharePoint list Initially I have created a simple SharePoint custom list with few records [...]]]></description>
			<content:encoded><![CDATA[<p>Sharepoint 2010 has a feature of connecting an Excel workbook<br />
Whenever an item is added/updated/deleted in SharPoint list the record is also added/updated/deleted in the connected Excel workbook<br />
In this example we will see how to connect an Excel workbook to SharePoint list</p>
<p>Initially I have created a simple SharePoint custom list with few records in that, the list contains four columns <strong>Title</strong> (default column), <strong>Employee Name</strong> (single line text), <strong>Designation </strong>(choice filed), <strong>Department </strong>(choice field)<br />
(See in<strong> </strong>Figure 1)</p>
<div id="attachment_845" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/1.jpg" rel="lightbox[844]"><img class="size-medium wp-image-845" title="Figure 1 - Simple SharePoint Custom List" src="http://www.fivenumber.com/wp-content/uploads/2010/11/1-300x77.jpg" alt="Figure 1 - Simple SharePoint Custom List" width="300" height="77" /></a><p class="wp-caption-text">Figure 1 - Simple SharePoint Custom List</p></div>
<p>Now, we are ready to connect, click on <strong>List</strong> then click <strong>Export to Excel</strong> option (see Figure 2)</p>
<div id="attachment_846" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/2.jpg" rel="lightbox[844]"><img class="size-medium wp-image-846" title="Figure 2 - Click on Export to Excel" src="http://www.fivenumber.com/wp-content/uploads/2010/11/2-300x130.jpg" alt="Figure 2 - Click on Export to Excel" width="300" height="130" /></a><p class="wp-caption-text">Figure 2 - Click on Export to Excel</p></div>
<p>A file download window pops, click on <strong>Save</strong> (see Figure 3)</p>
<div id="attachment_847" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/3.jpg" rel="lightbox[844]"><img class="size-medium wp-image-847" title="Figure 3 - File Download Window, Click Save" src="http://www.fivenumber.com/wp-content/uploads/2010/11/3-300x144.jpg" alt="Figure 3 - File Download Window, Click Save" width="300" height="144" /></a><p class="wp-caption-text">Figure 3 - File Download Window, Click Save</p></div>
<p>Save the file in some location (in this example I have saved in E:\Employee location) (see Figure 4)</p>
<div id="attachment_848" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/4.jpg" rel="lightbox[844]"><img class="size-medium wp-image-848" title="Figure 4 - Saving Excel Web Query File" src="http://www.fivenumber.com/wp-content/uploads/2010/11/4-300x201.jpg" alt="Figure 4 - Saving Excel Web Query File" width="300" height="201" /></a><p class="wp-caption-text">Figure 4 - Saving Excel Web Query File</p></div>
<p>Then open the saved<strong> Excel Web Query</strong> file from the location where you saved or click on the<strong> Open</strong> button in download dialog window (see Figure 5)</p>
<div id="attachment_849" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/51.jpg" rel="lightbox[844]"><img class="size-medium wp-image-849" title="Figure 5 - Open the downloaded file" src="http://www.fivenumber.com/wp-content/uploads/2010/11/51-300x229.jpg" alt="Figure 5 - Open the downloaded file" width="300" height="229" /></a><p class="wp-caption-text">Figure 5 - Open the downloaded file</p></div>
<p>While the <strong>Excel Web Query File</strong> is opening you can view the <strong>Microsoft Excel Security Notice</strong> (the dialog window says warning about the data connection) click on <strong>Enable </strong>(see Figure 6)</p>
<div id="attachment_850" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/6.jpg" rel="lightbox[844]"><img class="size-medium wp-image-850" title="Figure 6 - Enable Data Connections" src="http://www.fivenumber.com/wp-content/uploads/2010/11/6-300x207.jpg" alt="Figure 6 - Enable Data Connections" width="300" height="207" /></a><p class="wp-caption-text">Figure 6 - Enable Data Connections</p></div>
<p>As soon as you click on <strong>Enable </strong>button you can view the SharePoint list data in the<strong> Excel Web Query File</strong> (see Figure 7)</p>
<div id="attachment_851" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/7.jpg" rel="lightbox[844]"><img class="size-medium wp-image-851" title="Figure 7 - Excel Web Query File, Shows SharePoint List Data" src="http://www.fivenumber.com/wp-content/uploads/2010/11/7-300x162.jpg" alt="Figure 7 - Excel Web Query File, Shows SharePoint List Data" width="300" height="162" /></a><p class="wp-caption-text">Figure 7 - Excel Web Query File, Shows SharePoint List Data</p></div>
<p>Now we have to set the data connection to this workbook, to do that select<strong> Data</strong> menu and click on <strong>Connections </strong>(see Figure 8 )</p>
<div id="attachment_852" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/8.jpg" rel="lightbox[844]"><img class="size-medium wp-image-852" title="Figure 8 - Data Connections for the workbook" src="http://www.fivenumber.com/wp-content/uploads/2010/11/8-300x153.jpg" alt="Figure 8 - Data Connections for the workbook" width="300" height="153" /></a><p class="wp-caption-text">Figure 8 - Data Connections for the workbook</p></div>
<p>A <strong>Workbook Connections</strong> window opens, select the workbook name and click on <strong>Properties </strong>(see Figure 9)</p>
<div id="attachment_853" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/9.jpg" rel="lightbox[844]"><img class="size-medium wp-image-853" title="Figure 9 - Workbook Connections" src="http://www.fivenumber.com/wp-content/uploads/2010/11/9-300x213.jpg" alt="Figure 9 - Workbook Connections" width="300" height="213" /></a><p class="wp-caption-text">Figure 9 - Workbook Connections</p></div>
<p>Then in <strong>Connection Properties</strong> dialog box select <strong>Enable background refresh </strong>and <strong>Refresh data when opening the file</strong>, then click <strong>OK </strong>(see Figure 10)</p>
<div id="attachment_854" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/10.jpg" rel="lightbox[844]"><img class="size-medium wp-image-854" title="Figure 10 - Settings the Connection Properties" src="http://www.fivenumber.com/wp-content/uploads/2010/11/10-300x223.jpg" alt="Figure 10 - Settings the Connection Properties" width="300" height="223" /></a><p class="wp-caption-text">Figure 10 - Settings the Connection Properties</p></div>
<p>Now we have to save the Excel file in a trusted location, so before saving the Excel file first we have to specify a trusted location, to do that Select <strong>File </strong>menu and click on <strong>Options </strong>(see Figure 11)</p>
<div id="attachment_855" class="wp-caption aligncenter" style="width: 290px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/11.jpg" rel="lightbox[844]"><img class="size-medium wp-image-855" title="Figure 11 - Specifying Trusted Location" src="http://www.fivenumber.com/wp-content/uploads/2010/11/11-280x300.jpg" alt="Figure 11 - Specifying Trusted Location" width="280" height="300" /></a><p class="wp-caption-text">Figure 11 - Specifying Trusted Location</p></div>
<p>In<strong> Excel Options</strong> window select<strong> Trust Center</strong> and click on <strong>Trust Center Settings</strong> (see Figure 12)</p>
<div id="attachment_856" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/12.jpg" rel="lightbox[844]"><img class="size-medium wp-image-856" title="Figure 12 - Specifying Trusted Location" src="http://www.fivenumber.com/wp-content/uploads/2010/11/12-300x242.jpg" alt="Figure 12 - Specifying Trusted Location" width="300" height="242" /></a><p class="wp-caption-text">Figure 12 - Specifying Trusted Location</p></div>
<p>In <strong>Trust Center</strong> dialog window select <strong>Trusted Locations</strong> and click on <strong>Add new locations</strong>, specify a path for trusted source, then click  <strong>OK </strong>(see Figure 13)</p>
<div id="attachment_857" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/13.jpg" rel="lightbox[844]"><img class="size-medium wp-image-857" title="Figure 13 - Spedifying Trusted Location" src="http://www.fivenumber.com/wp-content/uploads/2010/11/13-300x241.jpg" alt="Figure 13 - Specifying Trusted Location" width="300" height="241" /></a><p class="wp-caption-text">Figure 13 - Specifying Trusted Location</p></div>
<p>Click <strong>OK </strong>on <strong>Trust Center</strong> window, click <strong>OK </strong>on <strong>Excel Options</strong> window, then save the Excel workbook in some location, in this example I&#8217;m saving the Excel file in the same location (E:\Employees) where Excel Web Query File was saved</p>
<p>Now I will try to add the new Item in the SharePoint list, so we will see whether item is added in the Excel spread sheet (see Figure 14)</p>
<div id="attachment_858" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/14.jpg" rel="lightbox[844]"><img class="size-medium wp-image-858" title="Figure 14 - Adding Item in Sharepoint List" src="http://www.fivenumber.com/wp-content/uploads/2010/11/14-300x203.jpg" alt="Figure 14 - Adding Item in Sharepoint List" width="300" height="203" /></a><p class="wp-caption-text">Figure 14 - Adding Item in Sharepoint List</p></div>
<p>Now I can see the newly item added SharePoint list is also updated in the Excel workbook (see Figure 14)</p>
<div id="attachment_859" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/15.jpg" rel="lightbox[844]"><img class="size-medium wp-image-859" title="Figure 15 - Item Updated in the Connected Excel Workbook" src="http://www.fivenumber.com/wp-content/uploads/2010/11/15-300x185.jpg" alt="Figure 15 - Item Updated in the Connected Excel Workbook" width="300" height="185" /></a><p class="wp-caption-text">Figure 15 - Item Updated in the Connected Excel Workbook</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/connecting-an-excel-spreadsheet-to-sharepoint-2010-list/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Configure SharePoint 2010 Metadata Navigation and Filter</title>
		<link>http://www.fivenumber.com/configure-sharepoint-2010-metadata-navigation-and-filter/</link>
		<comments>http://www.fivenumber.com/configure-sharepoint-2010-metadata-navigation-and-filter/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 03:58:03 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[Sharepoint 2010 - General]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=835</guid>
		<description><![CDATA[We have to discuss about the most thrilling and useful feature for the document library today. Yes I’m talking about Metadata Navigation Settings in SharePoint 2010 document library. SharePoint 2010 Metadata Navigation is the new piece of feature that supports to navigate and filter the documents in a library by means of metadata. It is [...]]]></description>
			<content:encoded><![CDATA[<p>We have to discuss about the most thrilling and useful feature for the document library today.</p>
<p>Yes I’m talking about <strong>Metadata Navigation Settings</strong> in SharePoint 2010 document library.</p>
<p>SharePoint 2010 Metadata Navigation is the new piece of feature that supports to navigate and filter the documents in a library by means of metadata.</p>
<p>It is one of the most significant feature to navigate through the documents.</p>
<p>If we wants to navigate through the documents by metadata, first we have to configure the Metadata Navigation Settings</p>
<p>In this article I would like to show how to navigate and filter the documents by content types and columns</p>
<p>First of all I have enabled the document library to support the content types, please follow the article <a title="Document templates by using site content types in MOSS" href="http://www.fivenumber.com/document-template-by-using-site-content-type-in-moss/" target="_blank">Document templates by using site content types in MOSS</a></p>
<p>However enabling site content types in SharePoint 2010 is similar to MOSS</p>
<p>So now I&#8217;m ready with the document library which contains few documents and content types like Word/Excel/Power Point documents etc.</p>
<p>I can create/upload documents using the above content types, so I have uploaded few documents (Word, Excel, PowerPoint etc) to my library can view in Figure 1</p>
<div id="attachment_837" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/11.png" rel="lightbox[835]"><img class="size-medium wp-image-837" title="Figure 1 - SharePoint 2010 Document Library With Different Types of Document" src="http://www.fivenumber.com/wp-content/uploads/2010/11/11-300x116.png" alt="Figure 1 - SharePoint 2010 Document Library With Different Types of Document" width="300" height="116" /></a><p class="wp-caption-text">Figure 1 -SharePoint 2010 Document Library With Different Types of Document</p></div>
<p>Then, go to SharePoint 2010 <strong>document library &gt; library settings</strong></p>
<ul>
<li>Under <strong>General Settings</strong> section click on <strong>Metadata navigation settings</strong></li>
<li><strong> </strong>Select fields from avaliable hirerarchy fields and add for configuring navigation</li>
<li>Then, select available key filter fields and add for configuring filters</li>
<li>Then, click on <strong>OK</strong> button (please follow Figure 2)</li>
</ul>
<div id="attachment_840" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/31.png" rel="lightbox[835]"><img class="size-medium wp-image-840" title="Figure 2 - Configuring Metadata Navigation and Filter Settings" src="http://www.fivenumber.com/wp-content/uploads/2010/11/31-300x167.png" alt="Figure 2 - Configuring Metadata Navigation and Filter Settings" width="300" height="167" /></a><p class="wp-caption-text">Figure 2 - Configuring Metadata Navigation and Filter Settings</p></div>
<p>Now, you are also most done, navigate the document library you can view the newly added section which shows the navigation hirerarchy and filtering options (see Figure 3)</p>
<div id="attachment_841" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/11/5.jpg" rel="lightbox[835]"><img class="size-medium wp-image-841" title="Figure 3 - Navigation and Filtering Through Metadata" src="http://www.fivenumber.com/wp-content/uploads/2010/11/5-300x167.jpg" alt="Figure 3 - Navigation and Filtering Through Metadata" width="300" height="167" /></a><p class="wp-caption-text">Figure 3 - Navigation and Filtering Through Metadata</p></div>
<p>It allows filtering the document library documents by means of content types, columns.</p>
<p>After configure Metadata navigation, I can navigate through the document very easily by selecting the appropriate content type.<br />
I can also filter the document library to show only one group of document types like word/excel/powerpoint/publisher/infopath document type.<br />
It is possible to filter through column like….If I want to show only documents which belongs to HR/IT/Admin/Finance/Security department.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/configure-sharepoint-2010-metadata-navigation-and-filter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Most Common Custom WebParts Part 2 – Menu WebPart Shows Sites and Sub-Sites in Fly-Out Mode</title>
		<link>http://www.fivenumber.com/most-common-custom-webparts-part-2-%e2%80%93-menu-webpart-shows-sites-and-sub-sites-in-fly-out-mode/</link>
		<comments>http://www.fivenumber.com/most-common-custom-webparts-part-2-%e2%80%93-menu-webpart-shows-sites-and-sub-sites-in-fly-out-mode/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 05:12:49 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[MOSS - Object Model]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>
		<category><![CDATA[SharePoint 2010 - Object Model]]></category>
		<category><![CDATA[Custom Webparts]]></category>
		<category><![CDATA[object model]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=832</guid>
		<description><![CDATA[In my previous post can view the most common custom webparts part 1 From last post I want to continue the series of most commonly used custom webparts, so once again I come up with a simple and small custom menu webpart shows all the sites and sub-sites of a SharePoint site in fly-out style]]></description>
			<content:encoded><![CDATA[<p>In my previous post can view the <a title="Most common custom webparts part 1" href="http://www.fivenumber.com/most-common-custom-webparts-part1-tree-view-webpart-shows-sites-and-sub-sites/" target="_blank">most common custom webparts part 1</a></p>
<p>From last post I want to continue the series of most commonly used custom webparts, so once again I come up with a simple and small custom menu webpart shows all the sites and sub-sites of a SharePoint site in fly-out style</p>
<div id="attachment_833" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/10/11.png" rel="lightbox[832]"><img class="size-medium wp-image-833" title="SharePoint Menu WebPart in fly-Out Style" src="http://www.fivenumber.com/wp-content/uploads/2010/10/11-300x225.png" alt="SharePoint Menu WebPart in fly-Out Style" width="300" height="225" /></a><p class="wp-caption-text">SharePoint Menu WebPart in fly-Out Style</p></div>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.ComponentModel;
using System.Web;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace CustomWebParts.VisualWebPart1
{
    [ToolboxItemAttribute(false)]
    public class VisualWebPart1 : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
       // private const string _ascxPath = @&quot;~/_CONTROLTEMPLATES/CustomWebParts/TreeView/TreeViewUserControl.ascx&quot;;

        System.Web.UI.WebControls.Menu menu = null;

        protected override void CreateChildControls()
        {
            //Control control = Page.LoadControl(_ascxPath);
            //Controls.Add(control);

            menu = new System.Web.UI.WebControls.Menu();
            SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;

            menu.StaticDisplayLevels = 1;
            menu.MaximumDynamicDisplayLevels = 200;
            menu.Orientation = System.Web.UI.WebControls.Orientation.Horizontal;
            menu.StaticEnableDefaultPopOutImage = false;
            menu.StaticPopOutImageUrl = &quot;/_layouts/images/menudark.gif&quot;;
            menu.SkipLinkText = &quot;&quot;;
            menu.DynamicHoverStyle.BackColor = System.Drawing.Color.FromName(&quot;#CBE3F0&quot;);
            menu.CssClass = &quot;ms-topNavContainer&quot;;

            menu.StaticMenuItemStyle.ItemSpacing = Unit.Pixel(0);
            menu.StaticSelectedStyle.CssClass = &quot;ms-topnavselected&quot;;
            menu.StaticHoverStyle.CssClass = &quot;ms-topNavHover&quot;;

            menu.DynamicMenuStyle.BackColor = System.Drawing.Color.FromName(&quot;#F2F3F4&quot;);
            menu.DynamicMenuStyle.BorderColor = System.Drawing.Color.FromName(&quot;#A7B4CE&quot;);
            menu.DynamicMenuStyle.BorderWidth = Unit.Pixel(1);

            menu.DynamicMenuItemStyle.CssClass = &quot;ms-topNavFlyOuts&quot;;
            menu.DynamicHoverStyle.CssClass = &quot;ms-topNavFlyOutsHover&quot;;
            menu.DynamicSelectedStyle.CssClass = &quot;ms-topNavFlyOutsSelected&quot;;

            MenuItemStyle stMenuStyle = menu.StaticMenuItemStyle;
            stMenuStyle.CssClass = &quot;ms-topnav&quot;;

            stMenuStyle.HorizontalPadding = 0;
            stMenuStyle.VerticalPadding = 0;
            stMenuStyle.ItemSpacing = Unit.Pixel(0);

            MenuItemStyle dyMenuStyle = menu.DynamicMenuItemStyle;
            dyMenuStyle.CssClass = &quot;ms-topNavFlyOuts&quot;;
            dyMenuStyle.HorizontalPadding = 0;
            dyMenuStyle.VerticalPadding = 0;

            System.Web.UI.WebControls.MenuItem mItem = new System.Web.UI.WebControls.MenuItem(web.Title);
            mItem.NavigateUrl = web.Site.Url;
            menu.Items.Add(mItem);

            GenerateMenu(menu, Context);
            menu.DataBind();
            this.Controls.Add(menu);
        }

        public static void GenerateMenu(System.Web.UI.WebControls.Menu menu, HttpContext context)
        {
            SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;

            foreach (SPWeb subsite in web.Webs)
            {
                System.Web.UI.WebControls.MenuItem mItem = new System.Web.UI.WebControls.MenuItem();
                mItem.NavigateUrl = subsite.Url;
                mItem.Text = subsite.Title;
                mItem.ToolTip = subsite.Title;
                menu.Items.Add(mItem);
                BuildMenu(subsite, mItem, context);
            }
        }

        private static void BuildMenu(SPWeb subweb, System.Web.UI.WebControls.MenuItem mItem, HttpContext context)
        {
            SPSite site = SPContext.Current.Site;
            SPWeb web = SPContext.Current.Web;

            foreach (SPWeb subsite in subweb.Webs)
            {
                System.Web.UI.WebControls.MenuItem mSubItem = new System.Web.UI.WebControls.MenuItem();
                mSubItem.NavigateUrl = subsite.Url;
                mSubItem.Text = subsite.Title;
                mSubItem.ToolTip = subsite.Title;
                mItem.ChildItems.Add(mSubItem);
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/most-common-custom-webparts-part-2-%e2%80%93-menu-webpart-shows-sites-and-sub-sites-in-fly-out-mode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Most Common Custom WebParts Part 1 &#8211; Tree View WebPart Shows Sites and Sub-Sites</title>
		<link>http://www.fivenumber.com/most-common-custom-webparts-part1-tree-view-webpart-shows-sites-and-sub-sites/</link>
		<comments>http://www.fivenumber.com/most-common-custom-webparts-part1-tree-view-webpart-shows-sites-and-sub-sites/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 04:26:07 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[MOSS - Object Model]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>
		<category><![CDATA[SharePoint 2010 - Object Model]]></category>
		<category><![CDATA[Custom Webparts]]></category>
		<category><![CDATA[object model]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=825</guid>
		<description><![CDATA[I desired to support most common custom webparts used by the SharePoint professional, so that these can be helpful for them. A custom tree view webpart shows all the sites and sub-sites of a SharePoint site Please use the below code and to get the exact look as show in the aboave image, the tree [...]]]></description>
			<content:encoded><![CDATA[<p>I desired to support most common custom webparts used by the SharePoint professional, so that these can be helpful for them.<br />
A custom tree view webpart shows all the sites and sub-sites of a SharePoint site</p>
<div id="attachment_826" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/10/1.png" rel="lightbox[825]"><img class="size-medium wp-image-826" title="SharePoint Custom Tree View WebPart" src="http://www.fivenumber.com/wp-content/uploads/2010/10/1-300x243.png" alt="SharePoint Custom Tree View WebPart" width="300" height="243" /></a><p class="wp-caption-text">SharePoint Custom Tree View WebPart</p></div>
<p>Please use the below code and to get the exact look as show in the aboave image, the tree view webpart can expand/collapse</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace CustomWebParts.CustomTreeView
{
    [ToolboxItemAttribute(false)]
    public class CustomTreeView : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        //private const string _ascxPath = @&quot;~/_CONTROLTEMPLATES/CustomWebParts/CustomTreeView/CustomTreeViewUserControl.ascx&quot;;

        TreeView myTree;
        LinkButton lnkBtnExpand;
        LinkButton lnkBtnCollapse;
        Label lblPipeDivider;
        Label lbl_ErrorMsg;
        private string errorMessage = string.Empty;
        private int level = 0;

        protected override void CreateChildControls()
        {
            //Control control = Page.LoadControl(_ascxPath);
            //Controls.Add(control);

            this.Controls.Clear();
            myTree = new TreeView();
            myTree.ExpandImageUrl = &quot;/_layouts/images/tvplus.gif&quot;;
            myTree.RootNodeStyle.ImageUrl = &quot;/_layouts/images/stsicon.gif&quot;;
            myTree.ParentNodeStyle.ImageUrl = &quot;/_layouts/images/stsicon.gif&quot;;
            myTree.LeafNodeStyle.ImageUrl = &quot;/_layouts/images/stsicon.gif&quot;;
            myTree.CollapseImageUrl = &quot;/_layouts/images/tvminus.gif&quot;;
            myTree.NoExpandImageUrl = &quot;/_layouts/images/stsicon.gif&quot;;            

            myTree.NodeWrap = true;
            myTree.ShowLines = true;
            myTree.ShowExpandCollapse = true;
            myTree.EnableClientScript = true;

            GenerateTreeView();
            myTree.CollapseAll();
            myTree.CssClass = &quot;ms-navitem a&quot;;
            this.Controls.Add(myTree);

            lnkBtnExpand = new LinkButton();
            lnkBtnExpand.Click += new EventHandler(expandAll_Click);
            lnkBtnExpand.Text = &quot;Expand all&quot;;
            lnkBtnExpand.CssClass = &quot;ms-navitem a&quot;;
            this.Controls.Add(lnkBtnExpand);

            lblPipeDivider = new Label();
            lblPipeDivider.Text = &quot;  |  &quot;;
            this.Controls.Add(lblPipeDivider);

            lnkBtnCollapse = new LinkButton();
            lnkBtnCollapse.Click += new EventHandler(collapseAll_Click);
            lnkBtnCollapse.Text = &quot;Collapse all&quot;;
            lnkBtnCollapse.CssClass = &quot;ms-navitem a&quot;;
            this.Controls.Add(lnkBtnCollapse);

            lbl_ErrorMsg = new Label();
            this.Controls.Add(lbl_ErrorMsg);

            base.CreateChildControls();
        }

        private void GenerateTreeView()
        {
            SPSite mySite = null;
            SPWeb myWeb = SPContext.Current.Web;
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                try
                {
                    mySite = new SPSite(myWeb.Site.ID);
                    using (mySite)
                    {
                        level = 1;
                        foreach (SPWeb subWeb in myWeb.Webs)
                        {
                            TreeNode myTreeNode = new TreeNode(subWeb.Title);
                            myTreeNode.NavigateUrl = subWeb.Url;
                            ReadSubSites(subWeb, ref myTreeNode);
                            myTree.Nodes.Add(myTreeNode);
                        }

                    }
                }
                catch (Exception ex)
                {
                    errorMessage = ex.ToString();
                }
            });
        }

        private void ReadSubSites(SPWeb subWeb, ref TreeNode myTreeNode)
        {
            try
            {
                foreach (SPWeb myChildSubWeb in subWeb.Webs)
                {
                    TreeNode subnode = new TreeNode(myChildSubWeb.Title);
                    subnode.NavigateUrl = myChildSubWeb.Url;

                    myTreeNode.ChildNodes.Add(subnode);

                    if (myChildSubWeb.Webs.Count &gt; 0)
                    {
                        if (myTreeNode.ChildNodes.Count &gt; 0)
                        {
                            level = level + 1;
                            TreeNode myChildNode = myTreeNode.ChildNodes[myTreeNode.ChildNodes.Count - 1];
                            ReadSubSites(myChildSubWeb, ref myChildNode);
                            level = level - 1;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.ToString();
            }
        }

        void expandAll_Click(object sender, EventArgs e)
        {
            myTree.ExpandAll();
        }

        void collapseAll_Click(object sender, EventArgs e)
        {
            myTree.CollapseAll();
        }      

        protected override void RenderContents(HtmlTextWriter writer)
        {
            EnsureChildControls();
            lnkBtnExpand.RenderControl(writer);
            lblPipeDivider.RenderControl(writer);
            lnkBtnCollapse.RenderControl(writer);
            RenderChildren(writer);
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/most-common-custom-webparts-part1-tree-view-webpart-shows-sites-and-sub-sites/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Seminar &#8211; Getting Started with SharePoint in Hyderabad</title>
		<link>http://www.fivenumber.com/seminar-getting-started-with-sharepoint-in-hyderabad/</link>
		<comments>http://www.fivenumber.com/seminar-getting-started-with-sharepoint-in-hyderabad/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 12:54:07 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Sharepoint 2010 - General]]></category>
		<category><![CDATA[seminar]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=821</guid>
		<description><![CDATA[We will be happy to announce that we are starting introductory session on SharePoint in Hyderabad, India on Sunday September 19th 2010 at 11:00 a.m. If you or your friends interested to join please let us know through the contact form The seminar will be on topics of why SharePoint, where SharePoint and how SharePoint [...]]]></description>
			<content:encoded><![CDATA[<p>We will be happy to announce that we are starting introductory session on SharePoint in Hyderabad, India on Sunday September 19th 2010 at 11:00 a.m. If you or your friends interested to join please let us know through the <a title="Contact for seminar on SharePoint" href="http://www.fivenumber.com/contact/" target="_blank">contact form</a><br />
The seminar will be on topics of why SharePoint, where SharePoint and how SharePoint<br />
Please forward this in the community, thank you.</p>
<p>Venu:</p>
<p># 17, IInd Floor,<br />
Above Cafe Coffee Day,<br />
Beside ICICI Bank,<br />
Vanasthali Puram,<br />
Hyderabad.500070</p>
<p>Mobile: +91-9987491026 (or) 91-9030043050</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/seminar-getting-started-with-sharepoint-in-hyderabad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Understanding SharePoint Property Bag Settings</title>
		<link>http://www.fivenumber.com/understanding-sharepoint-property-bag-settings/</link>
		<comments>http://www.fivenumber.com/understanding-sharepoint-property-bag-settings/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 16:14:23 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[MOSS - Object Model]]></category>
		<category><![CDATA[object model]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sharepoint 2010]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=802</guid>
		<description><![CDATA[Today my ex-coworker and friend ask me regarding SharePoint property bag, therefore I got an opportunity of posting this article on understanding SharePoint property bag settings. SharePoint property bag is a good place where we are able to accumulate key and value like a couple, It&#8217;s a hash table. There is no such user interface [...]]]></description>
			<content:encoded><![CDATA[<p>Today my ex-coworker and friend ask me regarding SharePoint property bag, therefore I got an opportunity of posting this article on understanding SharePoint property bag settings.</p>
<p>SharePoint property bag is a good place where we are able to accumulate key and value like a couple, It&#8217;s a hash table.</p>
<p>There is no such user interface to view/add/edit/delete the property bag key-value, but there is an option to perform the actions on property bag via SharePoint designer.</p>
<p>After you open a site in SharePoint Designer, go to <strong>Site </strong>menu click on Settings option, a <strong>Site Settings</strong> dialog box opens, click on <strong>Parameters </strong>tab where you can see the list of existing properties, from the same place you can even perform add/modify/remove actions.</p>
<div id="attachment_811" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.fivenumber.com/wp-content/uploads/2010/08/1.jpg" rel="lightbox[802]"><img class="size-medium wp-image-811" title="View SharePoint property bag properties using SharePoint Designer" src="http://www.fivenumber.com/wp-content/uploads/2010/08/1-300x275.jpg" alt="View SharePoint property bag properties using SharePoint Designer" width="300" height="275" /></a><p class="wp-caption-text">View SharePoint property bag properties using SharePoint Designer</p></div>
<p>Subsequently, prior to start on deep into property bag, we will discuss going on additional area some where we can store up value other than SharePoint property bag.</p>
<p><strong>web.config</strong> file is too a place where we be able to accumulate the settings such as file location, URLs, etc.<br />
Example:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;configuration&gt;
    &lt;appSettings&gt;
        &lt;add key=&quot;MyKey&quot; value=&quot;MyValue&quot; /&gt;
    &lt;/appSettings&gt;
&lt;/configuration&gt;
</pre>
<p>In view of the fact that we have single global web.config file meant for complete site. If we would like to accumulate additional settings correlated to several sites we have to make multiple entries in web.config file.</p>
<p>One more method of storing the settings by creating table in database, this approach is not recommend all the time in SharePoint.</p>
<p>Even we can store values in SharePoint list by creating two columns like Keys and Values using OOTB functionality and still can access the key-value pair using object model.</p>
<p>But, if you have several settings related to different sites with some unique permissions for individuals sites then we have to decide where the list is to be created.</p>
<p>On the way to over come this situation SharePoint provided property bag to store the properties in several levels like <strong>SPFarm</strong>, <strong>SPWebApplication</strong>, <strong>SPSite</strong>, <strong>SPWeb </strong>and <strong>SPList</strong>.</p>
<p>Storing key-value in <strong>SPFarm </strong>include more danger that require farm administrator privileges.</p>
<p>Below are few examples on <strong>SPFarm</strong>, <strong>SPWebApplication</strong>, <strong>SPSite</strong>, <strong>SPWeb </strong>add/view/edit/delete property bag values.</p>
<p><strong>Add property in SPFarm level</strong></p>
<pre class="brush: csharp; title: ; notranslate">
static void Main(string[] args)
        {
            SPFarm myFarm = SPFarm.Local;
            myFarm.Properties.Add(&quot;SPFarmKey&quot;, &quot;SPFarmValue&quot;);
            myFarm.Update();
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>View SPFarm property</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SSPFarm myFarm = SPFarm.Local;
            if (myFarm.Properties != null &amp;&amp; myFarm.Properties.Count &gt; 0)
            {
                if (myFarm.Properties.ContainsKey(&quot;SPFarmKey&quot;))
                {
                    Console.WriteLine(myWebApplication.Properties[&quot;SPFarmKey&quot;]);
                }
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Modify property in SPFarm level</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPFarm myFarm = SPFarm.Local;
            myFarm.Properties[&quot;SPFarmKey&quot;] = &quot;NewSPFarmValue&quot;;
            myFarm.Update();
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Delete property in SPFarm level</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPFarm myFarm = SPFarm.Local;
            myFarm.Properties[&quot;SPFarmKey&quot;] = null;
            myFarm.Properties.Remove(&quot;SPFarmKey&quot;);
            myFarm.Update();
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Add property in SPWebApplication level</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPWebApplication myWebApplication = SPWebApplication.Lookup(new Uri(&quot;http://WebApplicationURL&quot;));
            myWebApplication.Properties.Add(&quot;SPWebAppKey&quot;, &quot;SPWebAppValue&quot;);
            myWebApplication.Update();
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>View SPWebApplication property</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPWebApplication myWebApplication = SPWebApplication.Lookup(new Uri(&quot;http://WebApplicationURL&quot;));
            if (myWebApplication.Properties != null &amp;&amp; myWebApplication.Properties.Count &gt; 0)
            {
                if (myWebApplication.Properties.ContainsKey(&quot;SPWebAppKey&quot;))
                {
                    Console.WriteLine(myWebApplication.Properties[&quot;SPWebAppKey&quot;]);
                }
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Modify property in SPWebApplication level</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPWebApplication myWebApplication = SPWebApplication.Lookup(new Uri(&quot;http://WebApplicationURL&quot;));
            myWebApplication.Properties[&quot;SPWebAppKey&quot;] = &quot;NewSPWebAppValue&quot;;
            myWebApplication.Update();
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Delete property in SPWebApplication level</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPWebApplication myWebApplication = SPWebApplication.Lookup(new Uri(&quot;http://WebApplicationURL&quot;));
            myWebApplication.Properties[&quot;WebAppKey&quot;] = null;
            myWebApplication.Properties.Remove(&quot;WebAppKey&quot;);
            myWebApplication.Update();
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p>There is no facility to store properties in <strong>SPSite </strong>object similar to <strong>SPWeb </strong>object, if you want to store the settings in site collection level we have to use <strong>SPSite.RootWeb</strong></p>
<p><strong>Add/retrieve SPSite property</strong></p>
<pre class="brush: csharp; title: ; notranslate">

static void Main(string[] args)
        {
            SPSite siteCollection = new SPSite(&quot;http://servername:port&quot;);
            SPWeb site = siteCollection.RootWeb;
            //Addning SPSite Property
            site.Properties.Add(&quot;SPSiteKey&quot;, &quot;SPSiteValue&quot;);
            site.Properties.Update();

            //Reading SPSite Property
            Console.WriteLine(site.Properties[&quot;SPSiteKey&quot;]);
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Add/retrieve SPWeb property</strong></p>
<pre class="brush: csharp; title: ; notranslate">
static void Main(string[] args)
        {
            SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
            SPWeb myWeb = mySite.OpenWeb(&quot;Your Web Name.....&quot;);
            //Adding SPWeb Property
            myWeb.Properties.Add(&quot;SPWebKey&quot;, &quot;SPWebValue&quot;);
            myWeb.Properties.Update();

            //Reading SPWeb Property
            Console.WriteLine(myWeb.Properties[&quot;SPWebKey&quot;]);
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/understanding-sharepoint-property-bag-settings/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A quick look on Sharepoint object model programs &#8211; Part 3</title>
		<link>http://www.fivenumber.com/a-quick-look-on-sharepoint-object-model-programs-part-3/</link>
		<comments>http://www.fivenumber.com/a-quick-look-on-sharepoint-object-model-programs-part-3/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 13:55:02 +0000</pubDate>
		<dc:creator>G Vijai Kumar</dc:creator>
				<category><![CDATA[MOSS - Object Model]]></category>
		<category><![CDATA[object model]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://www.fivenumber.com/?p=770</guid>
		<description><![CDATA[I have got the chance to post useful Sharepoint object model programs (part 3) with bare minimum lines of code and really handy even. Please follow the link for a quick look on Sharepoint object model programs Part 1 and Part 2 Creating a Folder in a Document Library: Add fields to list: Creating a [...]]]></description>
			<content:encoded><![CDATA[<p>I have got the chance to post useful Sharepoint object model programs (part 3) with bare minimum lines of code and really handy even.<br />
Please follow the link for a quick look on Sharepoint object model programs <a title="A quick look on Sharepoint object model programs - Part 1" href="http://www.fivenumber.com/a-quick-look-on-sharepoint-object-model-programs/" target="_blank">Part 1</a> and <a title="A quick look on Sharepoint object model programs - Part 2" href="http://www.fivenumber.com/a-quick-look-on-sharepoint-object-model-programs-part-2/" target="_blank">Part 2</a></p>
<p><strong>Creating a Folder in a Document Library:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            try
            {
                SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
                SPWeb myWeb = mySite.OpenWeb();
                SPList MyLibrary = myWeb.Lists[&quot;Your Document Library Name.....&quot;];
                SPFolder myFolder = MyLibrary.RootFolder;
                SPFolder myChildFolder = myFolder.SubFolders.Add(&quot;Your Folder Name.....&quot;);
                myFolder.Update();
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Add fields to list:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            try
            {
                SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
                SPWeb myWeb = mySite.OpenWeb();
                SPList myList = myWeb.Lists[&quot;Your List Name.....&quot;];
                Guid listId = myList.ID;
                myList.Fields.Add(&quot;Employee ID&quot;, SPFieldType.Number, true);
                myList.Fields.Add(&quot;Employee Name&quot;, SPFieldType.Text, false);
                myList.Fields.Add(&quot;Designation&quot;, SPFieldType.Text, false);
                myList.Update();
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Creating a new view in a list:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            try
            {
                SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
                SPWeb myWeb = mySite.OpenWeb();
                SPList mylist = myWeb.Lists[&quot;Your List Name.....&quot;];
                StringCollection myFields = new StringCollection();
                myFields.Add(&quot;Employee Name&quot;);
                myFields.Add(&quot;Designation&quot;);
                SPView myView= mylist.Views.Add(&quot;Your View Name.....&quot;, myFields, null, 100, false, false, SPViewCollection.SPViewType.Html, false);
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Creating a new Content Type:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            try
            {
                SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
                SPWeb myWeb = mySite.OpenWeb();
                SPContentTypeCollection myContentTypeCollection = myWeb.ContentTypes;
                SPContentType myContentType= new SPContentType(myContentTypeCollection[SPBuiltInContentTypeId.Item], myContentTypeCollection, &quot;Content Type Name.....&quot;);
                myContentTypeCollection.Add(myContentType);
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Adding the existing Site Columns to existing Content Type:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            try
            {
                SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
                SPWeb myWeb = mySite.OpenWeb();
                SPFieldCollection myFieldCollection = myWeb.Fields;
                SPContentType myContentType=myWeb.ContentTypes[&quot;Content Type Name&quot;];
                myContentType.FieldLinks.Add(new SPFieldLink(myFieldCollection[&quot;Employee Name&quot;]));
                myContentType.FieldLinks.Add(new SPFieldLink(myFieldCollection[&quot;Designation&quot;]));
                myContentType.Update();
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Save site as template:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            try
            {
                SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
                SPWeb myWeb = mySite.OpenWeb();
                myWeb.SaveAsTemplate(&quot;FiveNumber.stp&quot;, &quot;FiveNumber&quot;, &quot;Its All About SharePoint&quot;, true);
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
<p><strong>Delete Recycle Bin Items:</strong></p>
<pre class="brush: csharp; title: ; notranslate">static void Main(string[] args)
        {
            SPSite mySite = new SPSite(&quot;http://servername:port&quot;);
            SPWeb myWeb = mySite.OpenWeb();
            SPRecycleBinItemCollection myRecycleBinCollection = mySite.RecycleBin;
            for (int i = 0; i &lt; myRecycleBinCollection.Count; i++)
            {
                myRecycleBinCollection[i].Delete();
                i--;
            }
            Console.WriteLine(&quot;Press any key to continue.....&quot;);
            Console.ReadLine();
        }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fivenumber.com/a-quick-look-on-sharepoint-object-model-programs-part-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

