<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-95658545740848122</id><updated>2012-02-07T23:19:33.528-08:00</updated><category term='search'/><category term='crawl'/><category term='forms authentication'/><category term='search forms authentication pdf search'/><title type='text'>Lots-with-sharepoint</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-7643493131584539489</id><published>2009-08-12T05:19:00.000-07:00</published><updated>2009-08-15T03:14:41.552-07:00</updated><title type='text'>Serach only word documents in sharepoint 2007 search.</title><content type='html'>&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;Serach only word documents in sharepoint 2007 search.&lt;br /&gt;There are two ways to search only word documents in sharepoint site&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;1. Creating Search Scope&lt;br /&gt;2. Property search&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;1. Creating Search Scope:Navigate to "Search Settings" in Search Category.&lt;br /&gt;Click on "Metadata Property Mappings" and check for "FileExtension" has check for 'Allow this property to be used in scopes' as below.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_riApJGtuVMg/SoaKbcNOfpI/AAAAAAAAAsU/afIv3hyHgLE/s1600-h/search.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5370131809718664850" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 320px; CURSOR: hand; HEIGHT: 318px" alt="" src="http://4.bp.blogspot.com/_riApJGtuVMg/SoaKbcNOfpI/AAAAAAAAAsU/afIv3hyHgLE/s320/search.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now click on "View scopes" in Scopes category. Click on "New Scope" provide the following detailsTitle as "word docs" and select "Use the default Search Results Page" radio button and click on "ok"click on "Add rules" against to newly created "word docs" and provide following informationselect "Property Query (Author = John Doe)"select "FileExtension" from Add Property restrictions dropdown.provide "doc" value in the subsequent textbox.select "Require" radio button.click on "ok"Go back to search settings, click on 'Content sources and crawl schedules' select 'Start Incremental crawl' from'Content sources and crawl schedules'.&lt;br /&gt;That's it. Go back to sharepoint site. Navigate to 'Advanced Search'.provide the keyword that you want to search in "All of these words:" and select "Word docs" from 'Result type'and click on 'Search' button to get the expected result.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. For example if you are looking for "title" keyword in word documents.provide the information as 'title filetype:doc' in search box which yields the same results as above for this no need to set the search scope&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-7643493131584539489?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/7643493131584539489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=7643493131584539489' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/7643493131584539489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/7643493131584539489'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/08/serach-only-word-documents-in.html' title='Serach only word documents in sharepoint 2007 search.'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_riApJGtuVMg/SoaKbcNOfpI/AAAAAAAAAsU/afIv3hyHgLE/s72-c/search.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-1591736454281443806</id><published>2009-05-20T10:37:00.000-07:00</published><updated>2009-05-20T10:43:03.833-07:00</updated><title type='text'>Creating Content Types using Features</title><content type='html'>Content Type is a logical collection of site columns.(refere my last post to know more about site columns).&lt;br /&gt;Any page layout you create as a template for pages on your site must be associated with a content type. Generally each column in the content type will be matched to a field control on the page layout, allowing the author to enter content to be stored in each column.&lt;br /&gt;&lt;br /&gt;Fortunately creating content types as features is fairly simple - CAML only, no need for a feature receiver (code). Alas VSeWSS can't help us much here but don't forget to use the CAML schema intellisense in VS by ensuring the XML file we're about to write is linked to the schema at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd.&lt;br /&gt;&lt;br /&gt;Initially, the part that can seem complex is the ID structure for a content type. Having been happily using GuidGen in Visual Studio every time we need an ID for something in a feature (though never trusting the first one ;-)), it comes as a surprise to have to read documentation just about IDs. As explained in Content Type IDs, the structure reflects the ancestry/parentage of a content type, meaning the parent content types can be determined very efficiently since simple string/byte matching can be used thus reducing database lookups.&lt;br /&gt;&lt;br /&gt;The basics are:&lt;br /&gt;&lt;br /&gt;find the ID of the content type you are deriving from. This can be done by either examining the content type in the SharePoint UI (Site Settings &gt; Manage Content Types) and copying the ID from the URL querystring. Alternatively, search the feature files which the MS developers used to deploy the out-of-the-box content types. The former is probably simpler but the latter gives more scope for learning. &lt;br /&gt;Add '00' and then a GUID you have generated (i.e. with GuidGen) to the end (suffix). You now have a valid content type ID. Note that you'll get a meaningful exception on feature activation if it's not. &lt;br /&gt;For any child content types, to generate their IDs you can now add a simple ID such as '01' or '02' to the ID generated in the previous step. It's not necessary to suffix the ID with '00' and another GUID now since your unique ID is in the string. This means any ID's you generate will be different from anyone else's, so you can use the simple option and use a 2 digit number rather than another GUID. This means your content type IDs shouldn't grow too long.&lt;br /&gt;The rest is fairly simple. Just add a FieldRef element for each site column the content type uses, specifying it's ID and name. Note that the approach we used to create our site columns meant that we got to specify the ID for them in CAML. We just need to dig out the IDs we specified there. So in both features, the IDs are in easily edited XML rather than being in any compiled code or similar so they are fairly loosely-coupled. Of course in many cases you'd choose to have both artifacts in the same feature, and in the future I'll post about factoring with relation to features.&lt;br /&gt;&lt;br /&gt;You should end up with something like for each content type you are deploying:-&lt;br /&gt;&lt;br /&gt;&lt;!-- this content type is derived from the 'Page' content type from the 'Publishing' feature --&gt;&lt;ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900CF38CCD7FC6E8247AA124F3EE5796C20"   Name="COBArticle"   Group="COB demo content types"   Description="Base content type for articles."   Version="0"&gt;   &lt;FieldRefs&gt;      &lt;FieldRef ID="{ae8e6ab8-b151-4fa4-8694-3cd24ad3b1bc}" Name="Locations" /&gt;      &lt;FieldRef ID="{A4983A93-4B14-4a61-AE08-09108A718628}" Name="Sectors" /&gt;      &lt;FieldRef ID="{6F26090A-C2AE-44d7-8F70-EE1663FE29F1}" Name="Disciplines" /&gt;      &lt;FieldRef ID="{71316CEA-40A0-49f3-8659-F0CEFDBDBD4F}" Name="Article Date" /&gt;   &lt;/FieldRefs&gt;&lt;/ContentType&gt;&lt;br /&gt;&lt;br /&gt;Note that it's not necessary to repeat the fields declared in parent content types, though I notice some of the Microsoft features do this.&lt;br /&gt;&lt;br /&gt;So now you have your content types deployed, they can now be used in document libraries/lists or associated with any page layouts you have. So next time is deploying master pages/page layouts/CSS etc. as a feature, including having the layouts automatically bound to the content types.&lt;br /&gt;Reference:http://www.sharepointnutsandbolts.com/2007/04/deploying-content-types-as-feature.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-1591736454281443806?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/1591736454281443806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=1591736454281443806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/1591736454281443806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/1591736454281443806'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/05/creating-content-types-using-features.html' title='Creating Content Types using Features'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-5011375238640880996</id><published>2009-04-14T10:24:00.000-07:00</published><updated>2009-05-20T10:43:42.732-07:00</updated><title type='text'>Creation of Site Columns using features</title><content type='html'>We can add a custom column to the sharepoint list or document library. Suppose if we have column called "Department", and if this need to be present in each and every list or document library. Instead of creating custom column for each and every list/document library, we create site column once and which can be used across all the lists/document libraries. This new feature available only in Moss 2007.&lt;br /&gt;&lt;br /&gt;The simplest way of creating site column is navigate to SiteActions-&gt;Site Settings-&gt;Modify all site settings-&gt;click on Site columns under Galleries section, shows the list of all available site columns. &lt;br /&gt;&lt;br /&gt;We can create a column with list of available data types.&lt;br /&gt;&lt;br /&gt;Creating Site column with feature.&lt;br /&gt;&lt;br /&gt;We can create the Site columns with feature.xml.&lt;br /&gt;Create a folder called Moss.Features.SiteColumn&lt;br /&gt;Create two xml files feature.xml and Element.xml as follows.&lt;br /&gt;copy the below code in feature.xml&lt;br /&gt;&lt;br /&gt;&lt;Feature&lt;br /&gt;  Id="{8C41689F-F45F-4b28-85B8-44C4B5197D02}"&lt;br /&gt;  Title="Moss.Features.SiteColumns"&lt;br /&gt;  Description="Custom MySite Columns"&lt;br /&gt;  Version="1.0.0.0"&lt;br /&gt;  Scope="Site"&lt;br /&gt;  Hidden="false"&lt;br /&gt;  xmlns="http://schemas.microsoft.com/sharepoint/"&gt;&lt;br /&gt;  &lt;ElementManifests&gt;&lt;br /&gt;    &lt;ElementManifest&lt;br /&gt;      Location="Elements.xml" /&gt;&lt;br /&gt;  &lt;/ElementManifests&gt;&lt;br /&gt;&lt;/Feature&gt;&lt;br /&gt;&lt;br /&gt;Copy the below code in Elements.xml&lt;br /&gt;&lt;br /&gt;&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;&lt;br /&gt;&lt;br /&gt;  &lt;Field &lt;br /&gt;ID="{4C67267C-B950-4cd4-8038-DEACA9EC2F74}" &lt;br /&gt;Name="MyTitle" &lt;br /&gt;Group="MyColumns" &lt;br /&gt;DisplayName="MyTitle" &lt;br /&gt;Type="Text" &lt;br /&gt;Required="FALSE" &lt;br /&gt;Sealed="TRUE"&lt;br /&gt;MaxLength="250"&gt;&lt;/Field&gt;&lt;br /&gt;&lt;/Elements&gt;&lt;br /&gt;&lt;br /&gt;Note: here "Type" data type. You can mention any available datatypes.&lt;br /&gt;&lt;br /&gt;Move this folder to 12hive feature folder, and install the feature as&lt;br /&gt;&lt;br /&gt;stsadm -o installfeature -name Moss.Features.SiteColumns&lt;br /&gt;&lt;br /&gt;Activate the feature as&lt;br /&gt;&lt;br /&gt;stsadm -o activatefeature -name Moss.Features.SiteColumns -url http://servername:portno&lt;br /&gt;&lt;br /&gt;This creates new site column called "MyTitle". &lt;br /&gt;You can reuse this site columns for lists/document libraries.&lt;br /&gt;&lt;br /&gt;stay glued for content types, Page Layouts, Master pages in my next posts.&lt;br /&gt;&lt;br /&gt;Get back to me if you have any queries.&lt;br /&gt;shreecanth@gmail.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-5011375238640880996?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/5011375238640880996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=5011375238640880996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/5011375238640880996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/5011375238640880996'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/04/creation-of-site-columns-with-features.html' title='Creation of Site Columns using features'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-6274592347931330336</id><published>2009-04-05T04:46:00.000-07:00</published><updated>2009-04-05T05:17:21.779-07:00</updated><title type='text'>Increasing the performance of Publishing site of Moss 2007 in Mobile Devices</title><content type='html'>Have you ever been get a chance to look at how much size each page (empty moss pages or custom webpart with no data- pages hosted on moss) takes loading in moss 2007?&lt;br /&gt;It takes nearly 500kb for each page load in moss 2007 site collection.&lt;br /&gt;&lt;br /&gt;For each request to the Moss 2007 publishing page loads following basic files&lt;br /&gt;&lt;br /&gt;Core.css&lt;br /&gt;Controls.css&lt;br /&gt;Core.js&lt;br /&gt;Init.js&lt;br /&gt;Ie55us.js&lt;br /&gt;Editingmenu.js&lt;br /&gt;Spellcheck.js&lt;br /&gt;&lt;br /&gt;and lot more...&lt;br /&gt;&lt;br /&gt;The Read access users doesn't require of loading all these files.&lt;br /&gt;These files loaded into the in page, even though if we define our custom master page without any links to the above files.&lt;br /&gt;&lt;br /&gt;But this can be a performance problem when the moss 2007 site is requested from the Mobile PDA applications.&lt;br /&gt;We need to make our master page and conent pages lighter weight so that it can be easily accessed in the mobile devices.&lt;br /&gt;To remove these files we need to create one HttpModule, which does the clean up of unneccesary files.&lt;br /&gt;&lt;br /&gt;There is a great article available for removing of these files&lt;br /&gt;http://www.ie-soft.de/blog/PermaLink,guid,968b0588-f306-467b-be51-54f7a8f2079d.aspx&lt;br /&gt;&lt;br /&gt;Happy coding...&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Shreecanth&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-6274592347931330336?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/6274592347931330336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=6274592347931330336' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/6274592347931330336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/6274592347931330336'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/04/increasing-performance-of-publishing.html' title='Increasing the performance of Publishing site of Moss 2007 in Mobile Devices'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-4374506812407852715</id><published>2009-03-29T10:32:00.000-07:00</published><updated>2009-03-29T10:45:02.413-07:00</updated><title type='text'>Power  of web.config changes in Asp.net 1.1</title><content type='html'>To inherit my asp.net page from our custom developed page.&lt;br /&gt;All asp.net pages are inherit from System.Web.UI.Page class&lt;br /&gt;for example&lt;br /&gt;namespace Myproject.web&lt;br /&gt;{&lt;br /&gt;public class MyCustomPage: System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class Login: MyCustomPage&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;Instead of this we have a better workaround for this process.&lt;br /&gt;Add the following tag in our web.config entry, by doing this whenever we add aspx page to our solution it automactically inherits from "MyCustomPage"&lt;br /&gt;&lt;br /&gt;its really works wonder....&lt;br /&gt;Reference article:http://ryanfarley.com/blog/archive/2004/06/08/766.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-4374506812407852715?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/4374506812407852715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=4374506812407852715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/4374506812407852715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/4374506812407852715'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/03/power-of-webconfig-changes-in-aspnet-20.html' title='Power  of web.config changes in Asp.net 1.1'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-6735797724337727008</id><published>2009-02-07T08:08:00.000-08:00</published><updated>2009-02-07T08:09:03.100-08:00</updated><title type='text'>Differnce between Asp.net and Sharepoint safe mode parser</title><content type='html'>When a request is comes for an .aspx page Sharepoint ISAPI takes care about who will serve the request. Asp.net or Safemode parser(sharepoint).Before this you should know the concept of sharepoint ghosted and unghosted pages.In sharepoint some pages are lie in physical folder of server i.e, _layouts or _vti_bin folder. These pages are accessible for all applications.These pages are call ghosted pages.If we edit these pages through designer or through front page 2003 the pages become unghosted and a copy of each page is stored in the application content database. To make it clearghosted pages are those rows in the docs table which have null values for the Content column and a non-null value for the SetupPath column which points to a file on the file system itself. The referenced file essentially serves as a template and content source.Any webpart page or normal pages are ghosted by default.&lt;br /&gt;The main difference between Asp.net and sharepoint pareser is, in asp.net for each first request of the page is compiled into assembly, and next request onwards the compliled page gets executed. In sharepoints safe mode parser is not compiled. They are interpretative pages. Remember its not possible to make unghosted page to its original ghosted pageSo if there is any inline server code in aspx page the safe mode parser will not allow the page to load&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-6735797724337727008?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/6735797724337727008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=6735797724337727008' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/6735797724337727008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/6735797724337727008'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/02/differnce-between-aspnet-and-sharepoint.html' title='Differnce between Asp.net and Sharepoint safe mode parser'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-4672267614473294521</id><published>2009-02-07T06:57:00.000-08:00</published><updated>2009-02-07T07:33:08.057-08:00</updated><title type='text'>Limitation of enabling session state</title><content type='html'>By default in Sharepoint session state is disabled. when you open any site collection web.config file you will see below line commented in http module&lt;br /&gt;&lt;span style="color:#000099;"&gt;'add name="Session" type="System.Web.SessionState.SessionStateModule" '&lt;/span&gt;&lt;br /&gt;The difference between session state in sharepoint and .net&lt;br /&gt;In .net session can be enabled at page level. So the pages which doen't have the session can avoid the performance hit associated with it.But in sharepoint once the sessionstate is enabled for the application, all the the unghosted(customized) page forced to use sessionstate whether or not controls on that page require session state.&lt;br /&gt;For ex: Assume your SharePoint server contains mostly unghosted pages. Let’s say there are 1000 unghosted pages on the site. You create a web part that requires session state. Let’s say that web part is only used on a few select pages (i.e. 2-3 pages). Enabling session state so that 2-3 pages can use the web part suddenly slows down the performance of the 998 other pages.SSo it is advisable not to use session state in sharepoint which degrades the performance of the application&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-4672267614473294521?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/4672267614473294521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=4672267614473294521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/4672267614473294521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/4672267614473294521'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/02/limitation-of-enabling-session-state.html' title='Limitation of enabling session state'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-7095167792409749181</id><published>2009-01-31T06:00:00.000-08:00</published><updated>2009-01-31T06:09:17.387-08:00</updated><title type='text'>SPDisposeCheck v1.3.1 is released</title><content type='html'>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;SPDisposeCheck is a tool to help SharePoint Developers follow memory management best practices when using the SharePoint API with IDisposable objects including SPSite and SPWeb.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;This tool Can be downloadable at &lt;a href="http://code.msdn.microsoft.com/SPDisposeCheck"&gt;http://code.msdn.microsoft.com/SPDisposeCheck&lt;/a&gt;&lt;/p&gt;&lt;span style="text-decoration: underline; font-weight: bold;"&gt;&lt;/span&gt;&lt;p&gt;Go through below site for more information.&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(102, 0, 204);"&gt;Source:http://blogs.msdn.com/pandrew/archive/2009/01/29/spdisposecheck-v1-3-1-is-released.aspx&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-7095167792409749181?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/7095167792409749181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=7095167792409749181' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/7095167792409749181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/7095167792409749181'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/01/spdisposecheck-v131-is-released.html' title='SPDisposeCheck v1.3.1 is released'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-3392940321466332469</id><published>2009-01-24T23:23:00.000-08:00</published><updated>2009-01-24T23:48:27.977-08:00</updated><title type='text'>Setting custom property to the webpart - usercontrol</title><content type='html'>There are occasions when it may be necessary to provide web part users with a richer interface for setting custom properties than SharePoint provides out-of-the-Box&lt;br /&gt;&lt;br /&gt;Setting up the custom properties for a webpart is very easy and straight&lt;br /&gt;farward approach.&lt;br /&gt;&lt;br /&gt;Recently i came acorss requirement in one of my webpart i need to set the custom property.&lt;br /&gt;we usually go for usercontrol for better look and easily maintainable instead of writing entire code in webpart itself.&lt;br /&gt;In my scenario i have one usercontrol form which has a cancel button, on clicking on cancel the redirection happens basing on the configurable property.&lt;br /&gt;So for this usercontrol i need to pass the custom property value, i am getting the value in webpart but had very tough time trying to pass the value to the usercontrol.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But after tweaking my head at last got succeded by doing&lt;br /&gt;&lt;br /&gt;1. Not enabling the click event for the Cancel button in usercontrol itself, declare the click event for the usercontrol in webpart itself&lt;br /&gt;2. In the create child controls mehtod find the cancel button Id, and writing the event for the cancel button&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;publice string _navigateUrl=string.empty;&lt;br /&gt;&lt;br /&gt;public class CustomWebpartProperties :  System.Web.UI.WebControls.WebParts.WebPart&lt;br /&gt;    {&lt;br /&gt;UserControl       customUsercontrol ;&lt;br /&gt;        [WebBrowsable(true), WebDisplayName("Navigate Url"),&lt;br /&gt;        WebDescription("set the path")]&lt;br /&gt;        public string CustomURL&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return _navigateUrl;&lt;br /&gt;            }&lt;br /&gt;            set&lt;br /&gt;            {&lt;br /&gt;                _navigateUrl = value;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        Button btnCancel;&lt;br /&gt;        public override ToolPart[] GetToolParts()&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            ToolPart[] allToolParts = new ToolPart[3];&lt;br /&gt;            WebPartToolPart standardToolParts = new WebPartToolPart();&lt;br /&gt;            CustomPropertyToolPart customToolParts = new CustomPropertyToolPart();&lt;br /&gt;&lt;br /&gt;            allToolParts[0] = standardToolParts;&lt;br /&gt;            allToolParts[1] = customToolParts;&lt;br /&gt;            allToolParts[2] = new CustomToolPart();&lt;br /&gt;&lt;br /&gt;            return allToolParts;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;        protected override void CreateChildControls()&lt;br /&gt;        {&lt;br /&gt;            customUsercontrol = (UserControl)Page.LoadControl(@"/wpresources/TesUsercontrol.ascx");&lt;br /&gt;&lt;br /&gt;            btnCancel = (Button)UserControlContactUsByEmail.FindControl("btnCancel");&lt;br /&gt;            btnCancel.Click += new EventHandler(btnCancel_Click);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            base.Controls.Add(customUsercontrol);&lt;br /&gt;            base.CreateChildControls();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected override void Render(HtmlTextWriter writer)&lt;br /&gt;        {&lt;br /&gt;            writer.Write(NavigateUrl);&lt;br /&gt;            customUsercontrol.RenderControl(writer);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void btnCancel_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            //redirection code&lt;br /&gt;                    SPUtility.Redirect(NavigateUrl, SPRedirectFlags.UseSource, HttpContext.Current);&lt;br /&gt;          }&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;This class is used to set the new custom tool part and provides the user to enter the&lt;br /&gt;value for url.&lt;br /&gt;  public class CustomToolPart : Microsoft.SharePoint.WebPartPages.ToolPart&lt;br /&gt;    {&lt;br /&gt;        Label lbl;&lt;br /&gt;        Panel customToolPart;&lt;br /&gt;        TextBox txt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        protected override void CreateChildControls()&lt;br /&gt;        {&lt;br /&gt;            customToolPart = new Panel();&lt;br /&gt;            txt = new TextBox();&lt;br /&gt;            txt.ID = "tb";&lt;br /&gt;&lt;br /&gt;            lbl = new Label();&lt;br /&gt;            lbl.ID = "lbl";&lt;br /&gt;            lbl.Text = "Navigate Url";&lt;br /&gt;&lt;br /&gt;            customToolPart.Controls.Add(lbl);&lt;br /&gt;            customToolPart.Controls.Add(new LiteralControl("&lt;br /&gt;"));&lt;br /&gt;            customToolPart.Controls.Add(txt);&lt;br /&gt;            Controls.Add(customToolPart);&lt;br /&gt;            base.CreateChildControls();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override void ApplyChanges()&lt;br /&gt;        {&lt;br /&gt;            ContactUsByEmail wp = (ContactUsByEmail)this.ParentToolPane.SelectedWebPart;&lt;br /&gt;            wp.NavigateUrl = txt.Text;&lt;br /&gt;            //Button btnClick = (Button)wp.FindControl("btnCancel");&lt;br /&gt;            //btnClick.Click += new EventHandler(btnClick_Click);&lt;br /&gt;        }&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;shoot a mail to shreecanth@gmail.com if you need any further assistance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-3392940321466332469?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/3392940321466332469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=3392940321466332469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/3392940321466332469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/3392940321466332469'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/01/setting-custom-property-to-webpart.html' title='Setting custom property to the webpart - usercontrol'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-242958523864150354</id><published>2009-01-18T05:59:00.000-08:00</published><updated>2009-01-18T06:02:12.055-08:00</updated><title type='text'>Best Practices: SharePoint Object Model for Performance Tuning</title><content type='html'>&lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;While working with SharePoint object model, most of developers will use SPWeb, SPSite, SPList objects intensively. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Some of developers who reported performance issues in their production environment after their project deployment. Their code works well in most of the scenarios but whenever the data get increases then there might be potential performance hits because of not handling the APIs properly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;In this post I will give information about some common methods that we are using in most of the scenarios and very important points that we need to remember in perspective of application’s performance. We do have two cool MSDN articles gives information about the best practices with SharePoint object model and I will recommend you all to go through those articles as well. Also we do have an excellent blog by Roget Lamb by giving the detailed information of Dispose Patterns with examples.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a class="" href="http://msdn.microsoft.com/en-us/library/bb687949.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/bb687949.aspx"&gt;Best Practices&lt;/a&gt;: Common Coding Issues When Using the SharePoint Object Model&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a class="" href="http://msdn.microsoft.com/en-us/library/aa973248.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/library/aa973248.aspx"&gt;Best Practices&lt;/a&gt;: Using Disposable Windows SharePoint Services Objects&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;a class="" href="http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx" target="_blank" mce_href="http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx"&gt;Roger Lamb’s&lt;/a&gt; cool post about SharePoint 2007 and WSS 3.0 Dispose Patterns by Example&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Lots of situations where we will use APIs for retrieving information about Lists and List Items. In SharePoint, lists are the objects storing large amount of data. So we need to be little cautious while working with those APIs, because internally those APIs are calling some SQL queries to pull the data which has been stored the SharePoint Content DBs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;The performance issues may happen in some cases if numbers of lists are very high or in some cases total number of lists will be less but the items will be very large. &lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;First we can take a look at different approaches of getting SPList instance and we can choose the best method to increase the performance. &lt;span style=""&gt; &lt;/span&gt;We have more than one method or property which will return the same result. For Eg: SPList.Item.Count &amp;amp; SPList.ItemCount will return the number of items, so here we need to decide which one need to opt in our code implementation to enhance the performance. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Scenario 1 : Retrieve SPList instance &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPWeb.Lists (“name”) – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Not Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(strSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = &lt;b style=""&gt;&lt;span style="color: red;"&gt;web.Lists&lt;/span&gt;&lt;/b&gt; ["&lt;span style="color: maroon;"&gt;MyList&lt;/span&gt;"]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;             &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, it loads the &lt;b style=""&gt;metadata&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;*&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt; of the all lists in that specific &lt;b style=""&gt;SPWeb&lt;/b&gt; object. Then it does &lt;b style=""&gt;SPList.Title&lt;/b&gt; comparison with metadata of all the lists returned and then it returns the matching list from the SPWeb.Lists collection.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; color: blue; line-height: 115%; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPWeb.GetList (string strUrl) – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(strSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;      &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = &lt;b style=""&gt;&lt;span style="color: red;"&gt;web.GetList&lt;/span&gt;&lt;/b&gt;(&lt;span style="color: maroon;"&gt;"http://Site/list/AllItem.aspx"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, first retrieves the list &lt;b style=""&gt;GUID&lt;/b&gt; from the &lt;b style=""&gt;url&lt;/b&gt; (database hit), then it loads the &lt;b style=""&gt;metadata&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;*&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt; for that specific list.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; color: blue; line-height: 115%; font-family: 'Courier New';"&gt;metadata&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt; * = list of all information of List like its schema, fields info, content type info, column and items count.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Consider a scenario of a SharePoint site which contains 1000 lists. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;If we use&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; line-height: 115%; font-family: 'Courier New';"&gt;SPWeb.GetList()&lt;/span&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;, it will load the SPList by finding out the exact GUID of that SPList from the SharePoint content DB and loads the metadata.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;But if that is the scenario with &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; line-height: 115%; font-family: 'Courier New';"&gt;SPWeb.Lists&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;[“&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; line-height: 115%; font-family: 'Courier New';"&gt;MyList&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;”] &lt;span style="color: rgb(31, 73, 125);"&gt;then, SPWeb.Lists will load the metadata of&lt;span style=""&gt;  &lt;/span&gt;all the 1000 lists in memory and then it does SPList.Title&lt;span style=""&gt;  &lt;/span&gt;( here it is “MyList”) comparison with metadata of all the lists returned and then it returns the matching list from the SPWeb.Lists collection. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;If you debug the code in &lt;a class="" href="http://www.codeproject.com/KB/debug/windbg_part1.aspx" target="_blank" mce_href="http://www.codeproject.com/KB/debug/windbg_part1.aspx"&gt;winDbg&lt;/a&gt; then you can find out the GC Heap size and then you can realize how badly it is affecting the performance of your application, sometimes for each SPList it will take some MB's.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;So now we can consider this matter while writing code and use&lt;/span&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; color: red; line-height: 115%; font-family: 'Courier New';"&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: red; line-height: 115%; font-family: 'Courier New';"&gt;SPWeb.GetList&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;() &lt;span style="color: rgb(31, 73, 125);"&gt;instead of using&lt;/span&gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: red; line-height: 115%; font-family: 'Courier New';"&gt;SPWeb.Lists&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;[“&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; line-height: 115%; font-family: 'Courier New';"&gt;MyList&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;”].&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;Scenario 2 : Retrieve SPListItem &lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPList.Items[int idx] – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Not Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(strSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                  &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = web.GetList(&lt;span style="color: maroon;"&gt;"http://Site/list/AllItem.aspx"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; idx =0; idx&lt;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; strLstItemName = oList.Items[idx].Name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, for each iteration oList.Item[idx] will load a &lt;b style=""&gt;SPListItemCollection&lt;/b&gt;. Eg: consider a list has 1000 list items. So whenever this code executes, for each iteration it will create a separate SPListItemCollection and it will create a huge memory consumption in the GC Heap by creating &lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;1000&lt;/span&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt; SPListItemCollection&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt; instances&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPListItemCollection[int idx] -&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(strSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                   &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = web.GetList(&lt;span style="color: maroon;"&gt;"http://Site/list/AllItem.aspx"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;b style=""&gt;&lt;span style="color: red;"&gt;                    SPListItemCollection oListItems = oList.Items;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; idx =0; idx&lt;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; strLstItemName = oListItems[idx].Name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;span style=""&gt;               &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, we can see the the only code change between this one and the not good one is, here we are first taking all the items from the list and populating it in a SPListItemCollection. And then we are iterating only that SPListeItemCollection and finding out the specific list item. Here the advantage is that, in the memory this code will load &lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;only one&lt;/span&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt; SPListItemCollection&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Scenario 3 : Retrieve SPListItem in Event Handlers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;  &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPListItem – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Not Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; ItemAdded(&lt;span style="color: teal;"&gt;SPItemEventProperties&lt;/span&gt; properties)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; oSite = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(properties.WebUrl))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;   &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; oWeb = oSite.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = oWeb.Lists[properties.ListId];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;span style=""&gt;     &lt;/span&gt;SPListItem&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; oListItem = oList.GetItemByUniqueId(properties.ListItemId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;   &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, we are unnecessarily giving extra load to the memory by adding so many memory consuming APIs.&lt;span style=""&gt;  &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;For each iteration, oList.Item[idx] will load a &lt;b style=""&gt;SPListItemCollection&lt;/b&gt;. Please see the Good method below. &lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPListItem – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; ItemAdded(&lt;span style="color: teal;"&gt;SPItemEventProperties&lt;/span&gt; properties)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span style="color: teal;"&gt;SPListItem&lt;/span&gt; oItem = properties.ListItem;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, we have reduced lots of code and it will return the current ListItem by using this single line of code. Avoid creation of SPWeb &amp;amp; SPSite instances, because in an event handler those are directly accessble through the SPItemEventProperties.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt; &lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Scenario 4 : Retrieve SPListItem Count&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPList.Item.Count – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Not Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(strSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;      &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = web.GetList(&lt;span style="color: maroon;"&gt;"http://Site/list/AllItem.aspx"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt; iCount = &lt;span style="color: red;"&gt;oList.Items.Count;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, oList.Items.Count, first it will load all the SPListItems in the memory and then it will find out the total count. For eg: Consider a list with 1000 list items. Then in this scenario the above code will load all the &lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;1000 SPListItems&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt; and then return the total count, which will really create some performance hit.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPList.Item.ItemCount – &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; (&lt;span style="color: teal;"&gt;SPSite&lt;/span&gt; site = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPSite&lt;/span&gt;(strSite))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;      &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: teal;"&gt;SPWeb&lt;/span&gt; web = site.OpenWeb())&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style="color: teal;"&gt;SPList&lt;/span&gt; oList = web.GetList(&lt;span style="color: maroon;"&gt;"http://Site/list/AllItem.aspx"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt; iCount = &lt;span style="color: red;"&gt;oList.ItemsCount;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span style=""&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;In this case, ItemCount is a part of metadata of the SPList object and this will get generated whenver we create a SPList instance. So there is no any overburden to the list to find out its total number of list items.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;o:p&gt;&lt;span style="text-decoration: none;"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Scenario 5 : A list of recommended&lt;span style=""&gt;  &lt;/span&gt;properties and methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Not Good (replace this by the Good one)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td class="" style="border-style: solid solid solid none; border-color: black black black rgb(240, 240, 240); border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;&lt;span style="font-family:Calibri;"&gt;Good  &lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Items.Count&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td class="" style="border-style: none solid solid none; border-color: rgb(240, 240, 240) black black rgb(240, 240, 240); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;ItemsCount&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Items[Guid]&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td class="" style="border-style: none solid solid none; border-color: rgb(240, 240, 240) black black rgb(240, 240, 240); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;GetItemByUniqueId(Guid)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Items[Int32]&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td class="" style="border-style: none solid solid none; border-color: rgb(240, 240, 240) black black rgb(240, 240, 240); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;GetItemById(Int32)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Items.GetItemById(Int32)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td class="" style="border-style: none solid solid none; border-color: rgb(240, 240, 240) black black rgb(240, 240, 240); border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 239.4pt; background-color: transparent;" valign="top" width="319"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPList.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;GetItemById(Int32)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="color: rgb(112, 48, 160);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Scenario 5 : Specify the RowLimit Property while using SPQuery Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt; &lt;table style="border: medium none ; border-collapse: collapse;" class="MsoTableGrid" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr style=""&gt; &lt;td class="" style="border: 1pt solid black; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;SPQuery.RowLimit&lt;span style=""&gt;  &lt;/span&gt;– &lt;/span&gt;&lt;span style="color: rgb(217, 149, 148);"&gt;Good &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="color: rgb(217, 149, 148); font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;SPQuery&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt; oQuery = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: teal;"&gt;SPQuery&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;oQuery.RowLimit = 2000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style=""&gt; &lt;td class="" style="border-style: none solid solid; border-color: rgb(240, 240, 240) black black; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 6.65in; background-color: transparent;" valign="top" width="638"&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;Performing an SPQuery without setting RowLimit will perform purely and will be fail on large lists. Thus it will be always recommend to specify the RowLimit between 1 and 2000. Because if we didn’t mention it, in SQL server it ill return the resullt by using “select top x from table”, here the x will be a very large number. So it would give a very good performance if we limit the row by explicilty setting the RowLimit.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; text-align: justify;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;Also, the query must use an indexed field or it will cause a complete table scan and WSS will block it on a large list.&lt;/span&gt;&lt;span style="color: rgb(152, 72, 6);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;I hope all these information will help the developers while writing the code in their custom SharePoint applications. Since in SharePoint most of the data are storing in the lists, the &lt;a class="" href="http://blogs.msdn.com/sharepoint/archive/2008/02/28/database-maintenance-for-sharepoint-whitepaper.aspx" target="_blank" mce_href="http://blogs.msdn.com/sharepoint/archive/2008/02/28/database-maintenance-for-sharepoint-whitepaper.aspx"&gt;maintenance of those tables in DB&lt;/a&gt; as well through code (by querying through SharePoint APIs) will be always be a best practice. Also everybody can consider these points while reviewing the code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;Using Visual Studio TFS 2008, we can do the performance testing of methods by profiling the methods and we can do a load runner test by simulating the requests from users and the time. It is really a great facility in &lt;a class="" href="http://msdn.microsoft.com/en-us/vstudio/products/default.aspx" target="_blank" mce_href="http://msdn.microsoft.com/en-us/vstudio/products/default.aspx"&gt;VS 2008.&lt;o:p&gt;&lt;/o:p&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Happy coding&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt; text-align: justify;"&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;span style="font-family:Calibri;font-size:100%;"&gt;Srikanth Sapelly&lt;br /&gt;&lt;span style="font-size: 11pt; color: rgb(31, 73, 125); line-height: 115%; font-family: Wingdings;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-242958523864150354?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/242958523864150354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=242958523864150354' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/242958523864150354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/242958523864150354'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2009/01/best-practices-sharepoint-object-model_6154.html' title='Best Practices: SharePoint Object Model for Performance Tuning'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-2893566282645482404</id><published>2008-09-25T03:28:00.000-07:00</published><updated>2008-11-08T21:45:49.907-08:00</updated><title type='text'>Very rare Sharepoint Interview questions from top MNC's Part - I</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;1. What is connectable webparts and how to deploy them using custom webparts.&lt;br /&gt;2. What is webpart from which class you will import the webpart, what are the methods of it, how to add controls to webpart&lt;br /&gt;3. Differences b/w sps 2003 and Moss 2007&lt;br /&gt;4. what is search? how do you configure it.&lt;br /&gt;5. Have to implement custom development with the search.&lt;br /&gt;6. what is the content type?&lt;br /&gt;7. explain about master pages, page layouts&lt;br /&gt;8. what is the code you write to access/insert document in doc library&lt;br /&gt;9. By default sharepoint site is public or private&lt;br /&gt;10.Is it possible for sharepoint to connect to other datasources apart from SQLServer, how you can do that.&lt;br /&gt;11.How to expose sharepoint site to internet.&lt;br /&gt;12.what is infopath farm, how you create, deploy infopath farm?&lt;br /&gt;13.what is infopath farm, how you create, deploy infopath farm?&lt;br /&gt;14.If the customized page is revert back(ghosting) does this page is served from the Cache?&lt;br /&gt;15.If there are Site collection and if there is a subsite under the site collection, if the user modifies subsite then the new copy will be created only for subsite or entire site collection&lt;br /&gt;Stay glued for more qn's&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-2893566282645482404?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/2893566282645482404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=2893566282645482404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/2893566282645482404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/2893566282645482404'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2008/09/very-rare-sharepoint-interview.html' title='Very rare Sharepoint Interview questions from top MNC&apos;s Part - I'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-4439338601172311389</id><published>2008-07-23T17:01:00.000-07:00</published><updated>2008-07-23T17:42:34.418-07:00</updated><title type='text'>Differences between site definition and site templates</title><content type='html'>&lt;strong&gt;Site Template&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The first option for getting the SharePoint Designer changes beyond the current site is to take the site you've modified with SharePoint designer and save it as a template. Then when you need a new site you create it from the site template you've created. This approach works but it means that you either have to create a new site template for each of the built in site definitions -- or you have to live with just the one site template that you've created. It also means that you can't go back and apply the changes after they've been created.&lt;br /&gt;Finally, to add insult to injury, if you ever change the work that you did on the original site those changes won't be reflected across the other SharePoint sites that were created from the template because each page exists separately in the database. So site templates solve the problem of getting SharePoint Designer changes into multiple sites but without the ability to adapt to changes in the future.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Site Definitions&lt;/strong&gt;&lt;br /&gt;solve the problem of site templates in that changes can be affected to them after they've been created -- but at the cost of additional work. Site definitions exist on the file system of each of the front end web server unlike site templates which exist in the content database. Each site which is created from the site definition doesn't make a copy of the page in the database, instead it stores a pointer to the site definition file. The good news is that when the page on the file system changes it changes all of the references in the database -- thus solving the problem of making changes to existing branding.&lt;br /&gt;In order to do a site definition, you'll first have to get the changes to the files that you want into files. You can do this from SharePoint Designer by selecting Save As and pointing to a directory. From there you have to create the support files for the site definition including the ONET.XML file which drives how the site definition is used, and the WEBTEMP*.XML file which makes the site definition show up as an option. In most cases you'll copy the STS site definition that comes with SharePoint and make your changes there rather than starting from scratch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-4439338601172311389?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/4439338601172311389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=4439338601172311389' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/4439338601172311389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/4439338601172311389'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2008/07/differences-between-site-definition-and.html' title='Differences between site definition and site templates'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-8927411671019845593</id><published>2007-07-16T10:25:00.000-07:00</published><updated>2008-01-29T02:17:37.162-08:00</updated><title type='text'>Creating a site using object model in forms authentication</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;Recently we had new requirement to create a blog in share point site from Asp.net Application.&lt;br /&gt;The Share Point site is in Forms authentication. To Create the blog site&lt;br /&gt;public void CreateSite(string strSiteURL,string strSiteTitle)&lt;br /&gt;{&lt;br /&gt;//Create a new SPSite object corresponding to your top level site&lt;br /&gt;SPSite newSite = new SPSite(“http://moss/site”);&lt;br /&gt;//Create a new SPWeb object from the newSite object&lt;br /&gt;SPWeb newWeb = newSite.OpenWeb();&lt;br /&gt;//Return the collection of sub sites&lt;br /&gt;SPWebCollection subSites = newWeb.Webs;&lt;br /&gt;If the site is blog site the template id is "Blog#0"&lt;br /&gt;SPWeb newSubWeb = subSites.Add(“newsite”, “New Site”, “This is the description for my new site.”, 1033, “Blog#0”, true, false);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#cc33cc;"&gt;Remember it works in windows authentication, but it fails in forms authentication.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Because forms authentication doesn't have the enough authentication to create a site. It should be Impersonated with windwos credentials.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;go to central administration -&gt;application management -&gt;Create or Extend Web Application&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;click on 'Extend an existing Web application' select the web application for which you enabled forms authentication.create a new IIS Website with zone as Intranet. for ex: &lt;/span&gt;&lt;a href="http://systemname:1234/"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://systemname:1234/&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;create an Asp.net webservice(for ex: myService) project and map it to the virtualdirectory of the above port.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://systemname:1234/myService"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://systemname:1234/myService&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;In the webservice Paste the above method.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;Add this webservice from asp.net application/webpart as below&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;If the webreference is CustdomSite then the code as follows&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:trebuchet ms;"&gt;The code in asp.net application&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="left"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Public void CreateSite()&lt;br /&gt;{&lt;br /&gt;CustdomSite obj=new CustdomSite ();&lt;br /&gt;System.Net.NetworkCredential cred = new NetworkCredential(UserName,Password,Domain); [Import system.Net namespace]&lt;br /&gt;obj.Credentials=System.Net.CredentialCache.DefaultNetworkCredentials;&lt;br /&gt;obj.CreateSite(txtsiteUrl.Text,txtSiteName.Text);&lt;br /&gt;}&lt;br /&gt;Assuming the user knows the Creation,deployement of custom webparts&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="left"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color:#cc33cc;"&gt;Important Note&lt;/span&gt;: Most of the Object model functionalities in Forms authentication one needs to follow the above process.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-8927411671019845593?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/8927411671019845593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=8927411671019845593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/8927411671019845593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/8927411671019845593'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2007/07/creating-site-in-object-model-on-forms.html' title='Creating a site using object model in forms authentication'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-783389766485755833</id><published>2007-07-16T10:06:00.000-07:00</published><updated>2007-07-22T06:53:05.378-07:00</updated><title type='text'>Separate css file for each individual site</title><content type='html'>&lt;span style="font-family: trebuchet ms;"&gt;By Default each site takes the default style as Core.css file  (Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES\core.css).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;If we included our custdom classes in core.css that would applied to all sites available in the system. Bcoz its global for all sites in the system.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;To apply Site specific Css style&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Site Actions  -&gt;   Site Settings -&gt; Master Page&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;by default "Use Windows SharePoint Services default styles" is selected. select "Specify a CSS file to be used by this publishing site and all sites that inherit from it" and specify the location of the Css file.  Here the changes that you made will be applicable to that particular site only.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-783389766485755833?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/783389766485755833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=783389766485755833' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/783389766485755833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/783389766485755833'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2007/07/separate-css-file-for-each-individual.html' title='Separate css file for each individual site'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-207320525861915030</id><published>2007-07-14T08:27:00.000-07:00</published><updated>2007-07-14T10:15:22.383-07:00</updated><title type='text'>How Forms Authentication is differ from Windows Authentication in adding users to the Group in object model</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;When you have forms authentication enabled for your site and adding users to Group is not as simple as you do with windows authentication in object model. In windows authentication to add the users to the group(assumption: the current domain user has the permission to add the user to group) we have In-built webservice &lt;a href="http://server/site/_vti_bin/UserGroup.asmx"&gt;http://server/site/_vti_bin/UserGroup.asmx&lt;/a&gt; and using AddUserToGroup method from it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Trebuchet MS;color:#cc33cc;"&gt;note: here the site should be any windows authentication site.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;. But in forms authentication its not going to be work. The reason is that the forms tries to access the &lt;a href="http://server/site/_vti_bin/UserGroup.asmx"&gt;http://server/site/_vti_bin/UserGroup.asmx&lt;/a&gt; service it will redirect to the login page of the current working site. Bcoz the user is not windows impersonated so he doesn't has the permission to access. The work around is to impersonate webservice with user windows domain credentials. If the webreference name is "GroupUser" follow below steps:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:Trebuchet MS;"&gt;GroupUser obj=new GroupUser();&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Trebuchet MS;"&gt;System.Net.NetworkCredential cred = new NetworkCredential(UserName,Password,Domain); [Import system.Net namespace]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Trebuchet MS;"&gt;obj.Credentials=System.Net.CredentialCache.DefaultNetworkCredentials;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Trebuchet MS;"&gt;Now call the method as obj.AddUserToGroup(groupName As String,userName As String,userLoginName As String,userEmail As String,userNotes As String)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Trebuchet MS;"&gt;This will work out.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-207320525861915030?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/207320525861915030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=207320525861915030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/207320525861915030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/207320525861915030'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2007/07/how-forms-authentication-is-differ-from.html' title='How Forms Authentication is differ from Windows Authentication in adding users to the Group in object model'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-394666787148571333</id><published>2007-07-08T07:00:00.000-07:00</published><updated>2007-07-14T08:27:24.602-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search'/><category scheme='http://www.blogger.com/atom/ns#' term='crawl'/><category scheme='http://www.blogger.com/atom/ns#' term='forms authentication'/><title type='text'>Moss 2007 Search in Forms Authentication Mode</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;The out of box feature of Moss 2007 search doesn't works in Forms authentication mode.&lt;br /&gt;To get rid of this problem&lt;br /&gt;go to central administration -&gt;application management -&gt;Create or Extend Web Application&lt;br /&gt;click on 'Extend an existing Web application' select the web application for which you enabled forms authentication.&lt;br /&gt;create a new IIS Website with zone as &lt;span style="color:#6600cc;"&gt;Intranet&lt;/span&gt;. for ex: &lt;/span&gt;&lt;a href="http://systemname:1234/"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://systemname:1234/&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;now go to shared service administration, create new &lt;span style="color:#6600cc;"&gt;shared service provider(SSP).&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;go to SSP-&gt;search settings click on Content sources and crawl schedules, click on link &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6600cc;"&gt;Local Office SharePoint Server sites. &lt;/span&gt;&lt;span style="color:#000000;"&gt;In the site addresses box add Intranet site(&lt;a href="http://systemname:1234/"&gt;http://systemname:1234/&lt;/a&gt;) &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;check &lt;span style="color:#6600cc;"&gt;start full crawl of this content source&lt;/span&gt; checkbox and click on ok. It take few minutes to crawl all content of your Site.&lt;/span&gt;&lt;br /&gt;That's it now you can search forms word in your forms authentication site.....&lt;br /&gt;To crawl the new content of the site you can set the incremental crawl duration in Local Office SharePoint Server sites.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-394666787148571333?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/394666787148571333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=394666787148571333' title='51 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/394666787148571333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/394666787148571333'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2007/07/moss-2007-search-in-forms.html' title='Moss 2007 Search in Forms Authentication Mode'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>51</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-828185304669593546</id><published>2007-07-07T03:51:00.000-07:00</published><updated>2008-12-10T02:37:59.964-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search forms authentication pdf search'/><title type='text'>Moss 2007 Forms authentication</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_riApJGtuVMg/Ro-MmKmaSOI/AAAAAAAAABE/5UOCWNqazY8/s1600-h/con+string2.bmp"&gt;&lt;/a&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;As we know that by default Share point picks the users list from the ActiveDirectory(Windows Authentication). we dont have forms authentication concept in sps3 it was introduced in Moss 2007. To enable forms authentication follow the below steps.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Create aspnetdb database to store all our roles and users. You will find this database installed at 'c:\windows\microsoft.net\framework\v2.0.50727' if you have Visual Studio 2005 installed in your machine. go there and run aspnet_regsql. To Create your roles and membership data on the sql server you need to edit web.config for the site.we need to supply the connection string details for our aspnetdb. Just outside the system.web &lt;sytem.web&gt;&lt;system.web&gt;tag put:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;connectionstrings&gt;&lt;remove name="LocalSqlServer"&gt;&lt;add name="LocalSqlServer" providername="System.Data.SqlClient" connectionstring="Server=yourserver;Database=aspnetdb;uid=sa;pwd=*******;"&gt;&lt;/connectionstrings&gt;&lt;a href="http://3.bp.blogspot.com/_riApJGtuVMg/Ro-LZ6maSNI/AAAAAAAAAA8/kJlNRQ88q5w/s1600-h/con+string.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5084435781667932370" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_riApJGtuVMg/Ro-LZ6maSNI/AAAAAAAAAA8/kJlNRQ88q5w/s320/con+string.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;connectionstrings&gt;&lt;remove name="LocalSqlServer"&gt;&lt;add name="LocalSqlServer" providername="System.Data.SqlClient" connectionstring="Server=yourserver;Database=aspnetdb;uid=sa;pwd=*******;"&gt;&lt;/connectionstrings&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;and inside the system.web put the following code&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_riApJGtuVMg/Ro-M9qmaSPI/AAAAAAAAABM/oj9HqJ03I80/s1600-h/con+string2.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5084437495359883506" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_riApJGtuVMg/Ro-M9qmaSPI/AAAAAAAAABM/oj9HqJ03I80/s320/con+string2.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Once you’ve edited both web.config’s go to a command prompt and do an iisreset.&lt;br /&gt;Now we need to add some users to our database. The easiest way to do this is to create an ASP.NET 2.0 website using Visual Studio 2005 (or Visual Web Dev). Add a web.config to the project and then add exactly the same connection string as you did above for your new SharePoint site. Build the project.&lt;/span&gt;&lt;br /&gt;Back in Visual Studio, under the website menu, select the option for ASP.NET Configuration. This opens up the ASP.NET web site administration tool where we can add the users and roles we want.&lt;br /&gt;Select the Security link, create a role (something like administrators), and then go and add a user.&lt;br /&gt;&lt;br /&gt;Now go to Application Management page in Central Admin and click on Authentication Providers. select the site you wish to change the authentication provider to Forms for. Once you've selected it you'll see Windows as the MemberShipProviderName.&lt;br /&gt;Set the authentication type to Forms and enter the Member Ship Provider Name to AspNetSqlMembershipProvider. If anonymous access isn't ticked, tick that now.&lt;br /&gt;Goto Central Administration -&gt; Application Management -&gt; site collection administrators – and enter the username created by the asp.net application. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Trebuchet MS;"&gt;Now when you try login into the site will redirect to the login page, where you need to provide the credentials of the user that you have created.&lt;/span&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-828185304669593546?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/828185304669593546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=828185304669593546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/828185304669593546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/828185304669593546'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2007/07/moss-2007-forms-authentication.html' title='Moss 2007 Forms authentication'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_riApJGtuVMg/Ro-LZ6maSNI/AAAAAAAAAA8/kJlNRQ88q5w/s72-c/con+string.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-95658545740848122.post-6466780577628935143</id><published>2007-06-23T04:06:00.000-07:00</published><updated>2007-07-08T08:41:44.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search forms authentication pdf search'/><title type='text'>Moss 2007 PDF search</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;Moss 2007 out box feature doesn't supports the searching of pdf documents. The search is works fare enough in case of word documents and html, aspx pages and blah blah.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;search the pdf files one need to install &lt;span style="color:#3333ff;"&gt;PDF IFilters 6.0&lt;/span&gt; version. But which works only with &lt;span style="color:#3333ff;"&gt;x32 &lt;/span&gt;&lt;span style="color:#3333ff;"&gt;bit&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;I had really tough time with my production machine when i came to know that PDF search is not working. I cracked my head even though i had PDF IFilter is in place in Production machine. Its working fine in Development and Testing boxes. I googled a lot and finally i found a solution. &lt;span style="color:#6600cc;"&gt;&lt;a href="http://www.foxitsoftware.com/foxitreader/Foxit_PDF_IFilter_X64.msi"&gt;Foxit PDF IFilter x64 bit &lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;which acts as a plug-in for full-text search engines. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;Before intalling make sure that you have done with the following steps. 1. Goto Central Administration 2. Click on shared services and goto Search settings 3. Click on File Types and add new File Type as PDF&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;&lt;span style="color:#6600cc;"&gt;&lt;span style="color:#3333ff;"&gt;Lets see how it works........&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Step 1, the search engine go through a designate place, e.g. a file folder or a database, and indexes all documents or newly modified documents, including PDF documents, in the background and create internal data to store indexing result.&lt;br /&gt;Step 2, a user specify some keyword he would like to search and the search engine answer the query immediately by looking up the indexing result and respond to the user with all the documents that contains the keyword.&lt;br /&gt;During Step 1, the search engine itself doesn't understand format of a PDF document. Therefore, it looks in windows registry for an appropriate PDF IFilter and finds the Foxit PDF IFilter. Foxit PDF IFilter understand PDF format. It filters out embedded formatting and extracts text from the document and return text back to the search engine.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color:#6600cc;"&gt;Key benefits:&lt;br /&gt;&lt;/span&gt;Integrates with existing operating systems and tools within your company&lt;br /&gt;Provides an easy solution to search within PDF documents located on local computer, local network and intranet&lt;br /&gt;Greatly increases your ability to accurately locate information&lt;br /&gt;Much smaller and faster than IFilter offered by other vendors&lt;br /&gt;Support Chinese/Japanese/Korean PDF documents .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color:#6600cc;"&gt;Please note&lt;/span&gt; that this installer does not register with MOSS 2007 by default. That means that after you install it, MOSS will not use it to index pdf files. This could be fixed manually with some registry tweaking:&lt;br /&gt;After you install the Foxit, add a pdf extension in MOSS search settings Open regedit, locate [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf] Change the default value to {987f8d1a-26e6-4554-b007-6b20e2680632} . (You can get this handler addin value using Citeknet ifilter explorer)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Cmdline: net stop osearch&lt;br /&gt;Cmdline: net start osearch &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Do a full crawl.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Trebuchet MS;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/95658545740848122-6466780577628935143?l=lots-with-sharepoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lots-with-sharepoint.blogspot.com/feeds/6466780577628935143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=95658545740848122&amp;postID=6466780577628935143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/6466780577628935143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/95658545740848122/posts/default/6466780577628935143'/><link rel='alternate' type='text/html' href='http://lots-with-sharepoint.blogspot.com/2007/06/moss-2007-pdf-search.html' title='Moss 2007 PDF search'/><author><name>srikanth sapelly</name><uri>http://www.blogger.com/profile/09914005114156438299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_riApJGtuVMg/SX122g_8MXI/AAAAAAAAAmo/I-XlGLsfFFU/S220/USA+Snow+anna+home+051.jpg'/></author><thr:total>0</thr:total></entry></feed>
