<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SUPERNOVA &#187; Lee Kohn</title>
	<atom:link href="http://blog.metrostarsystems.com/author/lkohn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.metrostarsystems.com</link>
	<description>Stellar Social Media &#38; Technology Solutions</description>
	<lastBuildDate>Thu, 26 Apr 2012 17:31:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ReaderWriterLock vs. ReaderWriterLockSlim Performance</title>
		<link>http://blog.metrostarsystems.com/2012/02/13/readerwriterlock-vs-readerwriterlockslim-performance/</link>
		<comments>http://blog.metrostarsystems.com/2012/02/13/readerwriterlock-vs-readerwriterlockslim-performance/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 16:45:11 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[locking]]></category>
		<category><![CDATA[ReaderWriterLock]]></category>
		<category><![CDATA[ReaderWriterLockSlim]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5604</guid>
		<description><![CDATA[Here is handy comparison of the performance ReaderWriterLock and ReaderWriterLockSlim: ReaderWriterLock ReadLock -&#62; Release Lock = 0.00014 ms WriteLock -&#62; ReleaseLock = 0.00012 ms ReadLock -&#62; UpgradeToWriteLock -&#62; ReleaseLock = 0.00021 ms &#160; ReaderWriterLockSlim ReadLock -&#62; ExitReadLock = 0.00005 ms WriteLock -&#62; ExitWriteLock= 0.00004 ms ReadLockUpgradeable -&#62; WriteLock -&#62; ExitWriteLock -&#62; ExitReadLock  = 0.00009 ms &#160; So<em> ... </em>]]></description>
			<content:encoded><![CDATA[<p>Here is handy comparison of the performance ReaderWriterLock and ReaderWriterLockSlim:</p>
<p><strong>ReaderWriterLock</strong></p>
<p>ReadLock -&gt; Release Lock = 0.00014 ms</p>
<p>WriteLock -&gt; ReleaseLock = 0.00012 ms</p>
<p>ReadLock -&gt; UpgradeToWriteLock -&gt; ReleaseLock = 0.00021 ms</p>
<p>&nbsp;</p>
<p><strong>ReaderWriterLockSlim</strong></p>
<p>ReadLock -&gt; ExitReadLock = 0.00005 ms</p>
<p>WriteLock -&gt; ExitWriteLock= 0.00004 ms</p>
<p>ReadLockUpgradeable -&gt; WriteLock -&gt; ExitWriteLock -&gt; ExitReadLock  = 0.00009 ms</p>
<p>&nbsp;</p>
<p>So it appears that the ReaderWriterLockSlim is approximately ~3 times faster in most cases.</p>
<p><strong>Note</strong>: I came up with these number by writing a c# console App (.net 4.0) which aquired/released locks in a for loop 1,000,000 times with a StopWatch measuring the time taken.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2012/02/13/readerwriterlock-vs-readerwriterlockslim-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IRequiresSessionState and long running Asynchronous HTTP Handlers</title>
		<link>http://blog.metrostarsystems.com/2012/02/04/irequiressessionstate-and-long-running-asynchronous-http-handlers/</link>
		<comments>http://blog.metrostarsystems.com/2012/02/04/irequiressessionstate-and-long-running-asynchronous-http-handlers/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 13:59:46 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5600</guid>
		<description><![CDATA[The other day I learned something interesting about the inner workings of ASP .Nets session state management.  One of the nice features it provides is automatically making usage of the session state thread safe between the various threads which may be handling requests from the same user (with the same sessionId). Apparently the way it<em> ... </em>]]></description>
			<content:encoded><![CDATA[<p>The other day I learned something interesting about the inner workings of ASP .Nets session state management.  One of the nice features it provides is automatically making usage of the session state thread safe between the various threads which may be handling requests from the same user (with the same sessionId).</p>
<p>Apparently the way it goes about doing this is by locking the session state object for a user for the lifetime of any handler that requires the session state (anything that implements IRequiresSessionState).  Normally this is a handy feature making it so that developers don&#8217;t have to worry about the thread safety issues that would normally come with sharing the same objects between threads.  However in some instances this can lead some some unexpected behavior if you&#8217;re not aware of this.</p>
<p>So the other day I was implementing an asynchronous HTTP handler in which I needed to access a user&#8217;s session state.  To do this you simply make the handler class inherit from IRequiresSessionState.  However in doing so the users session state becomes locked for the duration of the Async request (in this particular case it could be several minutes before the response was sent).  This caused any subsequent requests which required the session state to hang while they waited for the lock to be released.</p>
<p>So after all of this I can say I learned something interesting and have added a new best practice to my repertoire; don&#8217;t use the session state within long running handlers!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2012/02/04/irequiressessionstate-and-long-running-asynchronous-http-handlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up SSL on a Microsoft Azure application</title>
		<link>http://blog.metrostarsystems.com/2012/01/24/setting-up-ssl-on-a-microsoft-azure-application/</link>
		<comments>http://blog.metrostarsystems.com/2012/01/24/setting-up-ssl-on-a-microsoft-azure-application/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 16:58:41 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5583</guid>
		<description><![CDATA[Recently I as involved with adding SSL to a site which is hosted within Microsft&#8217;s Aure platform.  Overall the process went pretty smoothly having used the guide from MSDN: http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx &#160; The one thing it forgets to mention is that along with server certificate you also need all of the certificates along the chain of trust back<em> ... </em>]]></description>
			<content:encoded><![CDATA[<p>Recently I as involved with adding SSL to a site which is hosted within Microsft&#8217;s Aure platform.  Overall the process went pretty smoothly having used the guide from MSDN:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx">http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx</a></p>
<p>&nbsp;</p>
<p>The one thing it forgets to mention is that along with server certificate you also need all of the certificates along the chain of trust back to the root CA which people&#8217;s browser trust.  There are multiple ways to do this but the way I found simplest was to import the certificate into a local IIS instance and then use the certificates MMC to export the certificate per this guide:</p>
<p><a href="https://support.comodo.com/index.php?_m=knowledgebase&amp;_a=viewarticle&amp;kbarticleid=1244">https://support.comodo.com/index.php?_m=knowledgebase&amp;_a=viewarticle&amp;kbarticleid=1244</a></p>
<p>Note: Make sure to check the box for &#8216;Include all certificates in the certificate path&#8217;</p>
<p>You&#8217;ll also need to reference these certificates in the XML files mentioned in the MSDN article and then you&#8217;re all done!</p>
<p>P.S. If you get an error about the certificates&#8217; thumbprint not matching make sure you&#8217;re copying the full thumbprint from Azure, the field is longer than what the screen shows, so there is some &#8216;scrolling&#8217; when highlighting it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2012/01/24/setting-up-ssl-on-a-microsoft-azure-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating large quantities of data in SQL Azure</title>
		<link>http://blog.metrostarsystems.com/2012/01/06/updating-large-quantities-of-data-in-sql-azure/</link>
		<comments>http://blog.metrostarsystems.com/2012/01/06/updating-large-quantities-of-data-in-sql-azure/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 16:53:36 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5570</guid>
		<description><![CDATA[Recently I ran into a scenario where I had a production database which contained a table with 1.4 million records in which I wanted to convert a varchar column containing numbers to a bigint column. I used a backup of the database to try out a few different methods; at first I tried simply running<em> ... </em>]]></description>
			<content:encoded><![CDATA[<p>Recently I ran into a scenario where I had a production database which contained a table with 1.4 million records in which I wanted to convert a varchar column containing numbers to a bigint column. I used a backup of the database to try out a few different methods; at first I tried simply running an ALTER TABLE statement to change the columns data type (the parsing of the varchar to a bigint is automatic).  However with the large amount of data in the table this kept timing out and would never complete.</p>
<p>So after some researching I came up with a solution in which I would create a new column of type bigint and then in small batches of 1000 I would update the rows with the converted bigint (I wrote a small C# console app with ADO .NET).  After doing this to every row I deleted the old varchar column and renamed the new column to the old varchar column&#8217;s name.</p>
<p>VIOLA!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2012/01/06/updating-large-quantities-of-data-in-sql-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handy String Parsing Extension Methods</title>
		<link>http://blog.metrostarsystems.com/2011/11/04/handy-string-parsing-extension-methods/</link>
		<comments>http://blog.metrostarsystems.com/2011/11/04/handy-string-parsing-extension-methods/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 15:26:45 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[bool]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[TryParse]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5557</guid>
		<description><![CDATA[Since I&#8217;ve never particularly liked the feel of C#&#8217;s int.TryParse and bool.TryParse methods I decided to create some extension methods for strings which I feel like make the code using them much more readable: &#160; /// &#60;summary&#62; /// Converts a string to an int, if the string cant be parsed then null is returned /// &#60;/summary&#62; ///<em> ... </em>]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://blog.metrostarsystems.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>Since I&#8217;ve never particularly liked the feel of C#&#8217;s int.TryParse and bool.TryParse methods I decided to create some extension methods for strings which I feel like make the code using them much more readable:<br />
&nbsp;<br />
<pre class="brush: csharp">/// &lt;summary&gt;
/// Converts a string to an int, if the string cant be parsed then null is returned
/// &lt;/summary&gt;
/// &lt;param name=&quot;txt&quot;&gt;The string to convert&lt;/param&gt;
/// &lt;returns&gt;&lt;/returns&gt;
public static int? ToInt(this string txt)
{
     int x = 0;
     if (int.TryParse(txt, out x))
         return x;
     else
         return null;
 }

/// &lt;summary&gt;
/// Converts a string to a boolean, if the string cannot be parsed then null is returned
/// &lt;/summary&gt;
/// &lt;param name=&quot;txt&quot;&gt;&lt;/param&gt;
/// &lt;returns&gt;&lt;/returns&gt;
public static bool? ToBool(this string txt)
{
     bool x = false
     if (bool.TryParse(txt, out x))
         return x;
     else
         return null;
}</pre></p>
<p>Usage:<br />
&nbsp;<br />
<pre class="brush: csharp">int imgID = Request.QueryString[&quot;Id&quot;].ToInt().Value;
int? height = Request.QueryString[&quot;height&quot;].ToInt();
bool? width = Request.QueryString[&quot;width&quot;].ToBool();</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2011/11/04/handy-string-parsing-extension-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linq to SharePoint vs. CAML vs. SQL Performance</title>
		<link>http://blog.metrostarsystems.com/2011/10/25/linq-to-sharepoint-vs-caml-vs-sql-performance/</link>
		<comments>http://blog.metrostarsystems.com/2011/10/25/linq-to-sharepoint-vs-caml-vs-sql-performance/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 13:59:26 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[CAML]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Preformance]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[SPQuery]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[WFE]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5492</guid>
		<description><![CDATA[On a project I&#8217;ve just recently started I was tasked to create some SharePoint web services which would serve up data stored in lists.  Having learned recently about a new tool for SharePoint 2010 called Linq to SharePoint I decided I would give it a try rather than taking my normal approach of using CAML<em> ... </em>]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://blog.metrostarsystems.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>On a project I&#8217;ve just recently started I was tasked to create some SharePoint web services which would serve up data stored in lists.  Having learned recently about a new tool for SharePoint 2010 called Linq to SharePoint I decided I would give it a try rather than taking my normal approach of using CAML inside of SPQuery objects.  Linq to SharePoint is supposed to speed up the development process by creating a DAL for you based on the structure of your SharePoint lists with type safety on all of the lists and the relationships within.  Also making use of Linq to write queries means there would no need for the fairly cumbersome CAML queries which all SharePoint developers have come to know and love.</p>
<p>After a day or so of development with this new tool the one thing that became immediately obvious to me was how limited the actual queries could be.  Perhaps it was because of the data model/relationships of the lists but the majority of the queries I needed to run could not be done with pure Linq since Linq to SharePoint can only run queries which span across no more than two lists which was a huge problem for me since many of my queries needed to span upwards of four lists. (I probably should have noticed that in the documentation).</p>
<p>Query limitations aside I was able to get my code working and decided to do some due diligence and fire up a load tester to see what kind of performance these web services would provide.  What I found was pretty shocking.</p>
<p><a href="http://blog.metrostarsystems.com/2011/10/25/linq-to-sharepoint-vs-caml-vs-sql-performance/linq/" rel="attachment wp-att-5493"><img class="alignnone size-medium wp-image-5493" title="Linq to SharePoint Perf" src="http://blog.metrostarsystems.com/wp-content/uploads/2011/10/linq-300x217.png" alt="" width="300" height="217" /></a></p>
<p>After reaching around six requests per second the CPU of the WFE (web front end) would become maxed out with page response times hitting nearly 2 seconds.  This seemed like a surprisingly low amount of performance since the server it was running on had four CPUs and four GB of ram (albeit it is a VM) so I decided to see where all of that CPU time was being spent so I hooked up the Visual Studio profiler and noticed that over 80% of the time was being spent in the inner workings of the Linq to SharePoint code.</p>
<p>At this point I decided to see what would happen if I replaced all of the Linq to SharePoint queries with plain old CAML queries running against the SPList.GetDataTable method.  The load tester was then run and came up with these numbers:</p>
<p><a href="http://blog.metrostarsystems.com/2011/10/25/linq-to-sharepoint-vs-caml-vs-sql-performance/caml2/" rel="attachment wp-att-5501"><img class="alignnone size-medium wp-image-5501" title="CAML Query" src="http://blog.metrostarsystems.com/wp-content/uploads/2011/10/caml2-300x217.png" alt="" width="300" height="217" /></a></p>
<p>By using CAML queries the WFE was able to handle around 20 requests per second until its CPU maxed out, quite an improvement!</p>
<p>Then per my bosses request I created the same data model with a plain old relational database (SQL 2008r2) to see what the performance for the web service would be like with SQL as opposed to SharePoint.</p>
<p><a href="http://blog.metrostarsystems.com/2011/10/25/linq-to-sharepoint-vs-caml-vs-sql-performance/sql/" rel="attachment wp-att-5502"><img class="alignnone size-medium wp-image-5502" title="SQL Query" src="http://blog.metrostarsystems.com/wp-content/uploads/2011/10/sql-300x217.png" alt="" width="300" height="217" /></a></p>
<p>As most people would suspect this preformed by far the best with the WFE being able to handle around 50 requests per second!</p>
<p>&nbsp;</p>
<p>Although this may not have been the most scientific test in the world it definitely shows the overhead which Linq to SharePoint introduces as well as the overhead which SharePoint lists have over plain old SQL.  The lesson I&#8217;ve taken away from this is that Linq to SharePoint is okay for smaller/simpler projects where performance is not as important as getting the development done quickly however I will be staying away from it in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2011/10/25/linq-to-sharepoint-vs-caml-vs-sql-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updated GAC DLLs not showing updates in ASP.Net Applications</title>
		<link>http://blog.metrostarsystems.com/2011/07/28/updated-gac-dlls-not-showing-updates-in-asp-net-applications/</link>
		<comments>http://blog.metrostarsystems.com/2011/07/28/updated-gac-dlls-not-showing-updates-in-asp-net-applications/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 14:22:22 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[ASP .Net]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[Compilation Error]]></category>
		<category><![CDATA[DLL]]></category>
		<category><![CDATA[dynamic-link library]]></category>
		<category><![CDATA[GAC]]></category>
		<category><![CDATA[global assembly cache]]></category>
		<category><![CDATA[just-in time compilation]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=5119</guid>
		<description><![CDATA[I recently ran into an issue on one of my development <strong>ASP.Net</strong> servers where I would deploy an updated <strong>DLL</strong> (<a href="http://en.wikipedia.org/wiki/Dynamic-link_library" target="_blank">Dynamic-link library</a>) to the <strong>GAC</strong> (<a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache" target="_blank">global assembly cache</a>) but the ASP.Net applications which referenced the DLL would throw compilation errors at run-time saying that newly added fields/methods were not present in the assembly.  I tried uninstalling and re-installing the assembly, adding the new DLL to the bin, and referencing it from there and so on, but nothing seemed to work.

As it turns out, ASP.Net keeps a cached version of the <a href="http://en.wikipedia.org/wiki/Just-in-time_compilation" target="_blank"><strong>JIT</strong></a> compiled DLL in the <em>C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files</em> directory that was being used instead of the new DLL which was in the GAC.  To fix it, I simply deleted the contents of this folder and everything was right as rain!

-Lee]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://blog.metrostarsystems.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>I recently ran into an issue on one of my development <strong>ASP.Net</strong> servers where I would deploy an updated <strong>DLL</strong> (<a href="http://en.wikipedia.org/wiki/Dynamic-link_library" target="_blank">Dynamic-link library</a>) to the <strong>GAC</strong> (<a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache" target="_blank">global assembly cache</a>) but the ASP.Net applications which referenced the DLL would throw compilation errors at run-time saying that newly added fields/methods were not present in the assembly.  I tried uninstalling and re-installing the assembly, adding the new DLL to the bin, and referencing it from there and so on, but nothing seemed to work.</p>
<p>As it turns out, ASP.Net keeps a cached version of the <a href="http://en.wikipedia.org/wiki/Just-in-time_compilation" target="_blank"><strong>JIT</strong></a> compiled DLL in the <em>C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files</em> directory that was being used instead of the new DLL which was in the GAC.  To fix it, I simply deleted the contents of this folder and everything was right as rain!</p>
<p>-Lee</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2011/07/28/updated-gac-dlls-not-showing-updates-in-asp-net-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paging within list views in SharePoint 2010 using SPListItemCollectionPosition</title>
		<link>http://blog.metrostarsystems.com/2011/03/16/paging-within-list-views-in-sharepoint-2010-using-splistitemcollectionposition/</link>
		<comments>http://blog.metrostarsystems.com/2011/03/16/paging-within-list-views-in-sharepoint-2010-using-splistitemcollectionposition/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 20:51:51 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[Next]]></category>
		<category><![CDATA[Pagination]]></category>
		<category><![CDATA[Paging]]></category>
		<category><![CDATA[Previous]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Sort]]></category>
		<category><![CDATA[SPListItemCollectionPosition]]></category>
		<category><![CDATA[View]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=4616</guid>
		<description><![CDATA[If you ever have had the need to create your own pagination for SharePoint 2010 lists/views you will undoubtedly have run into a class called SPListItemCollectionPosition which is supposed to handle going forwards and backwards in the paging.  Unfortunately as of this post the documentation on this little gem is non-existent.  So after doing some googling and experimentation<em> ... </em>]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://blog.metrostarsystems.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>If you ever have had the need to create your own pagination for SharePoint 2010 lists/views you will undoubtedly have run into a class called SPListItemCollectionPosition which is supposed to handle going forwards and backwards in the paging.  Unfortunately as of this post the documentation on this little gem is non-existent.  So after doing some googling and experimentation here are some things I have learned which can hopefully save some of you some time trying to figure this stuff out.</p>
<ul>
<li>All of the data this class encapsulates is really stored in a string with various parameters encoded like a query string</li>
<li>The parameters which you need to concerned with are:
<ul>
<li><strong>Paged=True</strong> This parameter tells SharePoint that you&#8217;re trying to paginate the data</li>
<li>﻿<strong>p_ID </strong>Is used in two different ways
<ul>
<li>When paging <em>forward </em>this should equal the ID of the <em>last </em>item on the current page</li>
<li>When paging <em>backward</em> this should equal the ID of the <em>first </em>item on the page</li>
</ul>
</li>
<li><strong>PagedPrev </strong>should be se to TRUE when paging backwards
<ul>
<li>Can be omitted when paging forwards</li>
</ul>
</li>
<li><strong>p_</strong>[ColumnName] When using sorting this functions in the same way the p_ID field works except the value should come from the column being sorted on, not the ID of the item.
<ul>
<li>[ColumnName] is replaced with the name of the column being sorted on</li>
<li>EX) If your sorting on the Title column the parameter should be called p_Title
<ul>
<li>If paging <em>forward </em>it should be set equal to the Title value of the <em>last</em> item on the page</li>
<li>If paging <em>backward </em>it should be set equal to the Title of the <em>first </em>item on the page</li>
</ul>
</li>
</ul>
</li>
<li><strong>PageLastRow </strong>is used when paging backwards.  It should be set to the index of the last item on the current page</li>
<li><strong>PageFirstRow </strong>is used when paging forwards.  It should be set to the ID the first item on the current page</li>
</ul>
</li>
</ul>
<p>If you&#8217;re looking for more information on how this works one good place to look is in the query string for the out of the box list views.  As you sort and page through the data you&#8217;ll see these parameters in the query string of the page which provides a nice place to do some experimentation.  Also please note a few gotchas which I encountered while working with this:</p>
<ul>
<li>If sorting is being done on a DateTime column then the value for the p_[ColumnName] attribute needs to be in <strong>UTC </strong>not local time</li>
<li>The API only allows for going from the current page to the next or previous page.  You can&#8217;t jump arbitrarily between pages</li>
<li>If filtering is being done on the view then there is no real &#8216;good&#8217; way to determine if you are at the beginning or end of the pagination.  This is something you&#8217;ll have to figure out how to handle on your own</li>
</ul>
<p>For more information take a look at the following links which helped me out a lot:</p>
<ul>
<li><a href="http://charliedigital.com/2010/02/05/paging-with-splistitemcollectionposition/">http://charliedigital.com/2010/02/05/paging-with-splistitemcollectionposition/</a></li>
<li><a href="http://blogs.msdn.com/b/colbyafrica/archive/2009/02/19/learning-sharepoint-part-vi-list-pagination.aspx">http://blogs.msdn.com/b/colbyafrica/archive/2009/02/19/learning-sharepoint-part-vi-list-pagination.aspx</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2011/03/16/paging-within-list-views-in-sharepoint-2010-using-splistitemcollectionposition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 Forms Based Authentication</title>
		<link>http://blog.metrostarsystems.com/2011/02/24/sharepoint-2010-forms-based-authentication/</link>
		<comments>http://blog.metrostarsystems.com/2011/02/24/sharepoint-2010-forms-based-authentication/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 15:59:46 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ASP .Net]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[FBA]]></category>
		<category><![CDATA[Forms based authentication]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Membership]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[provider]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[SharePont]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Authentication]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=4577</guid>
		<description><![CDATA[For the past couple of days I&#8217;ve been tasked with testing out and learning about SharePoint&#8217;s FBA (Forms Based Authentication).  Traditionally SharePoint makes use of Windows Authentication for authenticating users which uses mechanisms built into browers and IIS but limits the UI/UX for logging in to whatever the browser prompts when it receives a 401 from the server.<em> ... </em>]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://blog.metrostarsystems.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>For the past couple of days I&#8217;ve been tasked with testing out and learning about SharePoint&#8217;s FBA (Forms Based Authentication).  Traditionally SharePoint makes use of Windows Authentication for authenticating users which uses mechanisms built into browers and IIS but limits the UI/UX for logging in to whatever the browser prompts when it receives a 401 from the server.  If you have the need to display an actual login page with username and password text boxes you have to use FBA.</p>
<p>FBA within SharePoint is done using ASP.Net membership and role providers which can pull information from just about anywhere including a SQL databases and AD with the built in providers.  (Note that you can create your own providers <a href="http://msdn.microsoft.com/en-us/library/f1kyba5e(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/f1kyba5e(v=VS.85).aspx</a>).  Setting these up is a fairly straightforward process involving some Central Administration settings as well as modifying a few web.config files which is described in detail in the following links:</p>
<ul>
<li><a href="http://blogs.technet.com/b/mahesm/archive/2010/04/07/configure-forms-based-authentication-fba-with-sharepoint-2010.aspx">http://blogs.technet.com/b/mahesm/archive/2010/04/07/configure-forms-based-authentication-fba-with-sharepoint-2010.aspx</a></li>
<li><a href="http://blogs.msdn.com/b/alimaz/archive/2009/10/30/configuring-fba-in-sharepoint-server-2010-beta-2.aspx">http://blogs.msdn.com/b/alimaz/archive/2009/10/30/configuring-fba-in-sharepoint-server-2010-beta-2.aspx</a></li>
<li><a href="http://www.sharepointchick.com/archive/2010/05/06/configuring-claims-and-forms-based-authentication-for-use-with-an.aspx">http://www.sharepointchick.com/archive/2010/05/06/configuring-claims-and-forms-based-authentication-for-use-with-an.aspx</a></li>
</ul>
<p>After setting up FBA for SharePoint you will probobly come across a few caveats in which SharePoint does not act as expected:</p>
<ul>
<li>The People Picker does not do partial searches anymore.
<ul>
<li>Using an LDAP memberhsip provider searching for users required knowing the beginning of their username.
<ul>
<li>Can&#8217;t search by display name</li>
<li>Searching for &#8216;doe&#8217; would not yield &#8216;jdoe&#8217; as a result, however searching for &#8216;jdo&#8217; would</li>
</ul>
</li>
<li>Using the SQL membership provider only exact matches to the username would work, defeating the purpose of the search</li>
</ul>
</li>
<li>The name of the users in the system (Created by fields etc&#8230;) only shows their username, not their display name</li>
</ul>
<p>The problem seems to be that SharePoint handles authentication and user profiles in two different systems.  (IIS/ASP.Net  is used for authentication, whereas profiles and handled by SharePoint specific systems)  So getting the authentication to work is fairly simple but getting the other parts to work is a bit more complicated.  Knowing this now I&#8217;ll probably recommend sticking with Windows Authentication unless there is need to authenticate against something other than AD!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2011/02/24/sharepoint-2010-forms-based-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running out of hard drive space on a SharePoint Dev VM?</title>
		<link>http://blog.metrostarsystems.com/2011/02/22/running-out-of-hard-drive-space-on-a-sharepoint-dev-vm/</link>
		<comments>http://blog.metrostarsystems.com/2011/02/22/running-out-of-hard-drive-space-on-a-sharepoint-dev-vm/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 14:24:37 +0000</pubDate>
		<dc:creator>Lee Kohn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[GB]]></category>
		<category><![CDATA[Hard Drive]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Space]]></category>
		<category><![CDATA[WinDirStat]]></category>

		<guid isPermaLink="false">http://blog.metrostarsystems.com/?p=4573</guid>
		<description><![CDATA[Recently I noticed that my SharePoint (2007) development VM was running low on hard drive space.  The VM has a 60+ GB C drive so I was little shocked to see that I only had a few hundred MB left.  After poking around in the file system looking for whatever was taking up all of<em> ... </em>]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://blog.metrostarsystems.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushCSharp.js"></script>
<p>Recently I noticed that my SharePoint (2007) development VM was running low on hard drive space.  The VM has a 60+ GB C drive so I was little shocked to see that I only had a few hundred MB left.  After poking around in the file system looking for whatever was taking up all of that space and coming up empty I installed a handy utility called <a href="http://windirstat.info/">WinDirStat</a> which tells you where all of the space is being used.</p>
<p>Lo and behold the culprits where SharePoint&#8217;s log files which over time had grown to over 30 GB!  Since it was my development VM  I simply deleted the logs and freed up half the drive.  Problem solved!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.metrostarsystems.com/2011/02/22/running-out-of-hard-drive-space-on-a-sharepoint-dev-vm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

