<?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>Bill Rowell &#187; Web Development</title>
	<atom:link href="http://www.billrowell.com/category/development/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.billrowell.com</link>
	<description>Rumblings of Code,  and Then Some...</description>
	<lastBuildDate>Thu, 02 Feb 2012 00:08:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SqlCacheDependency and Query Notifications</title>
		<link>http://www.billrowell.com/2011/11/19/sqlcachedependency-and-query-notifications/</link>
		<comments>http://www.billrowell.com/2011/11/19/sqlcachedependency-and-query-notifications/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 21:22:20 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=1007</guid>
		<description><![CDATA[There&#8217;s a lot of scattered information out there on how to configure ASP.NET applications to leverage Microsoft SQL Server&#8217;s Query Notification and Service Broker services for caching in ASP.NET applications. The two best step by step tutorials I&#8217;ve found online are: http://www.simple-talk.com/sql/t-sql-programming/using-and-monitoring-sql-2005-query-notification/ http://dimarzionist.wordpress.com/2009/04/01/how-to-make-sql-server-notifications-work/ Both of those articles should get you started for sure. I ran [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a lot of scattered information out there on how to configure ASP.NET applications to leverage Microsoft SQL Server&#8217;s Query Notification and Service Broker services for caching in ASP.NET applications.  The two best step by step tutorials I&#8217;ve found online are:</p>
<p><a href="http://www.simple-talk.com/sql/t-sql-programming/using-and-monitoring-sql-2005-query-notification/">http://www.simple-talk.com/sql/t-sql-programming/using-and-monitoring-sql-2005-query-notification/</a></p>
<p><a href="http://dimarzionist.wordpress.com/2009/04/01/how-to-make-sql-server-notifications-work/">http://dimarzionist.wordpress.com/2009/04/01/how-to-make-sql-server-notifications-work/</a></p>
<p>Both of those articles should get you started for sure.  I ran into issues keeping our application from crashing after a period of time though while leveraging Query Notifications for caching in a few of my sites.  The biggest issue I found was that I would see the following exception in our logs:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp charp">
When using SqlDependency without providing an options value, SqlDependency.Start() <br/>must be called prior to execution of a command added to the SqlDependency instance.</pre>
</div>
</div>
<p>Never did quite get a handle on what was going on here.  I did figure out though that I could always find this in my Application log around the time that exception was thrown:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp charp">
The query notification dialog on conversation handle '{A1FB449B-DEB3-E011-B6D2-002590198D55}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
</pre>
</div>
</div>
<p>So, does this mean that I called SqlDependency.Stop() and now queued notifications aren&#8217;t going to be delivered.  Are these critical errors that keep the application from coming back?  I&#8217;ve read that a lot of the Query Notification messages you see in the log aren&#8217;t critical errors and can be ignored.  I can&#8217;t ignore the timing of this error and the exception being thrown above though.</p>
<p>Anyway, I finally decided to pull this stuff out of our application until I get a better handle on what&#8217;s going on.  The last straw was that I was trying to sync some database changes during a maintenance period and I couldn&#8217;t get them to sync because of a bunch of these SQL Query Notification issues.  As I write this, I can&#8217;t even get my database back online as I&#8217;m waiting for ALTER DATABASE SET SINGLE_USER to complete (approaching 3 hours!!!).  As I keep waiting, my Application log keeps filling up with the following Query Notification messages:</p>
<p><strong>Query notification delivery could not send message on dialog &#8216;{FE161F6A-D6B3-E011-B6D2-002590198D55}.&#8217;. Delivery failed for notification &#8216;﻿<qn:QueryNotification xmlns:qn="http://schemas.microsoft.com/SQL/Notifications/QueryNotification" id="1530017" type="change" source="database" info="restart" database_id="5" sid="0x1F59122ACF8727448DA988D041A1D484"><qn:Message>85addbaa-ce66-431d-870f-d91580a7480a;d527d584-9fd4-4b13-85bc-87cb6c2e166f</qn:Message></qn:QueryNotification>&#8216; because of the following error in service broker: &#8216;The conversation handle &#8220;FE161F6A-D6B3-E011-B6D2-002590198D55&#8243; is not found.&#8217;.<br/><br />
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.</strong></p>
<p>I had a response to a post I made on the ASP.NET Forum and it was suggested that with all the cached items in the system, that SQL Server really could not catch up.  This is a problem because not only does it slow the entire system down, but when you have to cycle the SQL Server service itself, it takes forever for the system to come back up because all of the notifications get requeued or something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2011/11/19/sqlcachedependency-and-query-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Twitter Means for Your Google SEO</title>
		<link>http://www.billrowell.com/2011/04/12/what-twitter-means-for-your-google-seo/</link>
		<comments>http://www.billrowell.com/2011/04/12/what-twitter-means-for-your-google-seo/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 21:12:23 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=946</guid>
		<description><![CDATA[The &#8220;intertubes&#8221; was abuzz recently with news that Google was going to add social media to its algorithm, meaning that tweets could be of more importance in the future. But exactly how important? I&#8217;m not sure anyone really knows, but a few things I would assume out of the gate: Massive tweeting on your part [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8220;intertubes&#8221; was abuzz recently with news that Google was going to add social media to its algorithm, meaning that tweets could be of more importance in the future.  But exactly how important?  I&#8217;m not sure anyone really knows, but a few things I would assume out of the gate:</p>
<ol>
<li>Massive tweeting on your part probably won&#8217;t have much effect on any traffic sent your way on Google&#8217;s part.  I honestly don&#8217;t think Google will take the text from a tweet just on face value.  I believe they&#8217;ll use that in conjunction with other metrics when placing a value on the importance of a tweet.</li>
<li>Your followers will probably play an important role in the effect of tweets.  Just like how similar web sites linking to your site help with your ranking (based on keywords, linking, etc.), the same will probably be said for your Twitter followers.  For instance, if you&#8217;re into Ford Mustangs and you promote your Ford Mustang site on Twitter, other Ford Mustang related Twitter accounts will be more valuable to you than a Twitter follower who&#8217;s all about Britney Spears.  Makes sense.</li>
<li>The depth of your tweets will mean the most.  What I mean is, how many times does your tweet get re-tweeted?  By having a tweet re-tweeted a ton of times basically means whatever you had to say started to really catch on and people thought it was important.  More value would be placed on a tweet Google could tell the social network found important.</li>
<li>A combination of all of the above.  I&#8217;m not sure anyone has any solid idea on how Google is going to use Twitter data.  My guess is they&#8217;ll use a combination of my assumptions above when placing a value on anything it gleams from Twitter.</li>
</ol>
<p>What&#8217;s almost certain is Google appears to be applying more metrics to its algorithm.  Whereas domain names, inbound links, domain age, etc. was of utmost importance several years ago, Google is going to look into more metrics when applying your search rankings.  In my opinion, this is a good thing.  At the end of the day, it puts more relevant topics first based on how people are using the information across the web.  Only time will tell what the importance of these changes will be though.  What does everyone else think?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2011/04/12/what-twitter-means-for-your-google-seo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Page Speed Plugin vs. Page Speed Online</title>
		<link>http://www.billrowell.com/2011/03/31/google-page-speed-plugin-vs-page-speed-online/</link>
		<comments>http://www.billrowell.com/2011/03/31/google-page-speed-plugin-vs-page-speed-online/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 00:07:10 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=900</guid>
		<description><![CDATA[Today, I took a look at Google Labs&#8217; Page Speed Online app to check the score of one of my sites. I was shocked to find out it was scoring really low at 59/100. Pathetic in my opinion since I consider site speed a huge priority (and so does Google in fact). I had just [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I took a look at Google Labs&#8217; Page Speed Online app to check the score of one of my sites.  I was shocked to find out it was scoring really low at 59/100.  Pathetic in my opinion since I consider site speed a huge priority (and so does Google in fact).  I had just done a site update earlier in the week, so I was thinking that I had broken something.  I checked the Page Speed Plugin for Firefox (part of Firebug), and just like I remembered, we were scoring really high at 94/100.  I decided to take a look at the Page Speed for Chrome to see where that plugin would score us.  It wasn&#8217;t as high as Firefox, but not nearly as low as the Online version; scoring at 81/100.</p>
<p>So my question to Google is this:  Why the difference?  Aren&#8217;t they running the same rules?  Which score means more to Google?  Between the browsers I would assume the rules being run in Firebug instead of straight through Chrome could cause a slight difference.  Also perhaps the rendering engines for the browsers could account for some difference too.  If anyone knows the answer for sure and which score I should really believe, I&#8217;d love to know!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2011/03/31/google-page-speed-plugin-vs-page-speed-online/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Close jQuery ColorBox on an Action</title>
		<link>http://www.billrowell.com/2011/03/22/close-jquery-colorbox-on-an-action/</link>
		<comments>http://www.billrowell.com/2011/03/22/close-jquery-colorbox-on-an-action/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 20:24:17 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=877</guid>
		<description><![CDATA[jQuery is awesome. If you use Javascript on your website, you should use jQuery. If you don&#8217;t, you don&#8217;t know what you&#8217;re missing. Recently, on a new site I&#8217;m about to launch, I was looking for some better ways to use jQuery and ColorBox when estimating shipping charges for customers. Previously, I called out to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jquery.com/">jQuery</a> is awesome.  If you use Javascript on your website, you should use jQuery.  If you don&#8217;t, you don&#8217;t know what you&#8217;re missing.</p>
<p>Recently, on a new site I&#8217;m about to launch, I was looking for some better ways to use jQuery and <a href="http://colorpowered.com/colorbox/">ColorBox</a> when estimating shipping charges for customers.  Previously, I called out to an internal web service to do some calculations and then do a redirect with the values to display to the user.  I was thinking, meh, a redirect?  You really need to do that?</p>
<p>So I ripped it all out and started over.  I basically decided I could use jQuery and element IDs to do the same thing.  Hide some controls, set the html or text values of others where I wanted calculated values to show up.  But the kicker was, I could easily do that from my ColorBox modal window, but I wanted it to close after hitting the submit button.  Turns out this is <i>stupid simple</i>.  From the ColorBox documentation, you can manually close the ColorBox window:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp charp">
</pre>
<p>$.colorbox.close();
</p></div>
</div>
<p>The key to making it work is to find the element that actually opened the ColorBox window.  I managed to only get this to work by finding the form that owned the element that opened the window first, then get the element in question, i.e.</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp charp">
var myForm = $("#myForm ");
var myElement= shoppingCartForm.find('#myElement');
if (myElement!= null) {
    myElement.colorbox.close();
}
</pre>
</div>
</div>
<p>For some reason, just doing this didn&#8217;t work:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp charp">
$('#myElement').colorbox.close();
</pre>
</div>
</div>
<p>That would have been simpler, but I got it to work and that&#8217;s all that I really cared about.  Anyway, hopefully this will be useful to someone else!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2011/03/22/close-jquery-colorbox-on-an-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Speed &amp; Performance Tuning with GTmetrix</title>
		<link>http://www.billrowell.com/2011/03/21/website-speed-performance-tuning-with-gtmetrix/</link>
		<comments>http://www.billrowell.com/2011/03/21/website-speed-performance-tuning-with-gtmetrix/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 04:48:45 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=875</guid>
		<description><![CDATA[I stumbled upon a little gem today while searching for a few more techniques to improve the performance of my ASP.NET web applications. I use YSlow and Google Page Speed almost daily, and it was great to find this website that combines the both of them called GTmetrix. GTmetrix combines both Google Page Speed and [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon a little gem today while searching for a few more techniques to improve the performance of my ASP.NET web applications.  I use YSlow and Google Page Speed almost daily, and it was great to find this website that combines the both of them called <a href="http://gtmetrix.com/">GTmetrix</a>.  GTmetrix combines both Google Page Speed and YSlow into an easy to read, tabbed, table of recommendations.  Each recommendation, once expanded, offers you a list of tasks that you can complete to improve the performance of your test.  What&#8217;s more, is it ranks the grouping of recommendations from Low to High so that you know what to get after first.  If you&#8217;re serious about your web site&#8217;s performance, definitely check this one out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2011/03/21/website-speed-performance-tuning-with-gtmetrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading Content to Amazon S3 with CloudBerry Labs&#8217; S3 Explorer</title>
		<link>http://www.billrowell.com/2011/01/20/uploading-content-to-amazon-s3-with-cloudberry-labs-s3-explorer/</link>
		<comments>http://www.billrowell.com/2011/01/20/uploading-content-to-amazon-s3-with-cloudberry-labs-s3-explorer/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 20:05:10 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=858</guid>
		<description><![CDATA[I recently made the move to Amazon S3 and CloudFront to store and server static content, in particular images, for some of my e-commerce web sites. We have thousands of images to serve to our visitors, in all different sizes. To get started, I went to Google to do some searching for some quality tools. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently made the move to Amazon S3 and CloudFront to store and server static content, in particular images, for some of my e-commerce web sites.  We have thousands of images to serve to our visitors, in all different sizes.  To get started, I went to Google to do some searching for some quality tools.  I stumbled upon <a href="http://cloudberrylab.com/default.aspx?id=1">CloudBerry Labs</a>&#8216; application <a href="http://cloudberrylab.com/default.aspx?page=cloudberry-explorer-amazon-s3">S3 Explorer</a> and downloaded it to give it a try.  Installation was a snap and fairly quickly, I was configuring my Amazon S3 account in S3 Explorer.  What&#8217;s very cool about this is that you can store as many S3 accounts that you might have, storing them for use later on.  To configure an S3 connection, you will need your Amazon Access Key and your Amazon Secret Key.  Now it was time to upload!</p>
<p>Like I mentioned earlier, we have thousands of images.  In fact, we have over 27,000 images.  And that&#8217;s just in one image dimension size!  We have 6 sizes, so that&#8217;s well over 160,000 images.  That would be a bear to do through Amazon&#8217;s S3 web interface.  Especially if I needed to set headers and permissions.  <a href="http://cloudberrylab.com/default.aspx?page=cloudberry-explorer-amazon-s3">CloudBerry S3 Explorer</a> came in handy for this.  I selected one set of images and before I started the upload, it allowed me to set any HTTP Headers I needed on my images.  After that, up they went.  I&#8217;d say with my connection, it took an hour or so to get all of them up to S3, depending on the file sizes.  After uploading, I needed to set permissions, which I was able to do by just selecting all of the S3 objects and setting the proper permissions.  This was kind of slow because CloudBerry S3 Explorer needed to get information on all of the objects I had selected, which was over 27,000.</p>
<p>All in all, I think it took me a couple of days to sporadically upload and set up all of our images.  The beauty is now we&#8217;re serving them from CloudFront, which makes our sites quite a bit faster.  A total win win for us.</p>
<p>A few notes about this wonderful application:</p>
<ul>
<li>It&#8217;s incredible easy to set permissions on objects.  They have a check box if you want to open the objects up for the world to download, which was nice for us.  It would have been nice to be able to do this before upload like HTTP Headers, but I didn&#8217;t see how.</li>
<li>Very easy to set HTTP Headers and any meta data you need on your objects.  And you can do it before the upload starts!</p>
<li>One thing that confused me a little was on Windows 7, when I minimized S3 Explorer, it went into my task bar and not with other minimized applications.  It took me a little while to figure out where it was hiding.  At first I just thought the application had crashed on me.</li>
<li>Overwriting object preserved HTTP Headers and permissions, something I was a little concerned about.</li>
<li>Moving data between S3 folders and buckets was really easy.  Again, preserves HTTP Headers and permissions.</li>
</ul>
<p>So, all in all, my impressions of this application are really good, and I was only using the Freeware version.  The pro version, for only $39.99, offers the unlimited S3 accounts and multi-threading which speeds up your uploads.  Other features available in the Pro version are:</p>
<ul>
<li>Compression</li>
<li>Encryption</li>
<li>Search</li>
<li>Chunking</li>
<li>FTP Support</li>
<li>Sync</li>
</ul>
<p>For more information on CloudBerry Labs&#8217; S3 Explorer, check out their <a href="http://cloudberrylab.com/default.aspx?page=s3-explorer-pro">product page for S3 Explorer</a>.  Hopefully you&#8217;ll find this nifty little application as useful as I did!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2011/01/20/uploading-content-to-amazon-s3-with-cloudberry-labs-s3-explorer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>E-Commerce Checkout Usability Issues</title>
		<link>http://www.billrowell.com/2010/12/13/e-commerce-checkout-usability-issues/</link>
		<comments>http://www.billrowell.com/2010/12/13/e-commerce-checkout-usability-issues/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 19:12:12 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=746</guid>
		<description><![CDATA[I develop e-commerce applications for a living and I love what I do. The best part about my job is that it gives me the chance to continue to develop software, but also be involved in actual business decisions that yield real results. During the busy holiday season leading up to Christmas mean that e-commerce [...]]]></description>
			<content:encoded><![CDATA[<p>I develop e-commerce applications for a living and I love what I do.  The best part about my job is that it gives me the chance to continue to develop software, but also be involved in actual business decisions that yield real results.  During the busy holiday season leading up to Christmas mean that e-commerce web sites are some of the busiest sites on the Internet.  This means that e-businesses are relying on the month between Thanksgiving and Christmas to really add to their yearly bottom line.  Since its the time of year where thousands of people hit the Internet to do their Christmas shopping, and I&#8217;m no different, I thought I&#8217;d bring up an issue I ran into while doing some of my online Christmas shopping.  I&#8217;m going to keep my examples really vague until after Christmas in case my wife or other family members read my blog.</p>
<p>The handful of websites (high profile websites actually) I visited were all fairly well designed and responded rather quickly.  That&#8217;s key during a busy e-tail season.  I ran into issues on most of them during checkout.  One site asked me to register during checkout, which I typically do, but took me back to my cart after registration instead of letting me continue my purchase.  I was sort of confused because the cart details at the top of the page were really small, so I didn&#8217;t really know what to do next.  If people expect to make their purchase when they click checkout, let them continue to do so.  Don&#8217;t hinder the process.</p>
<p>Another website I visited, like most out there, allowed me to enter an offer code during checkout.  Much to my delight, they let you stack coupons.  So I scoured the Internet for some coupons and entered them into their offer code page during checkout.  Much to my chagrin, none of them went through.  However, I didn&#8217;t get a notification that the coupon was invalid.  It just removed it from the offer code section and didn&#8217;t tell me anything about what might be wrong.  In the end, I couldn&#8217;t use ANY of the offers I had and actually make it through checkout.  All it would have taken was to tell me the offer code was invalid.  What would have been better would have been to process them all at once and tell me which codes were valid and which weren&#8217;t.</p>
<p>I find its really important to keep your e-commerce website as usable as possible.  The checkout process is the most important part of the site and you want people in and out as quickly as possible so you can capture that conversion.  If you make things difficult or don&#8217;t provide usable feedback, you may lose a customer.  That can have a real impact on your bottom line.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2010/12/13/e-commerce-checkout-usability-issues/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ASP.NET SQLCacheDependency with SQL Query Notifications</title>
		<link>http://www.billrowell.com/2010/09/23/asp-net-sqlcachedependency-with-sql-query-notifications/</link>
		<comments>http://www.billrowell.com/2010/09/23/asp-net-sqlcachedependency-with-sql-query-notifications/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 13:28:11 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=659</guid>
		<description><![CDATA[I&#8217;m going to make this quick and dirty. I&#8217;ve set up my ASP.NET web applications to leverage SQLCacheDependency with SQL Server 2005 Query Notifications. The setup process takes a some time and debugging can be tricky. But the payoff can be enormous. The bottom line is that the performance increase on page load times is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to make this quick and dirty.  I&#8217;ve set up my ASP.NET web applications to leverage SQLCacheDependency with SQL Server 2005 Query Notifications.  The setup process takes a some time and debugging can be tricky.  But the payoff can be enormous.  The bottom line is that the performance increase on page load times is well worth the effort, especially for data that doesn&#8217;t change all that often.  I found it really useful for caching product data on my eCommerce sites, especially as the number of products in the system grew to over 5,000.  However, I always seem to miss a step when when configuring my SQL Server 2005 databases; so this post is for my own reference, but if it helps someone else out there, even better.</p>
<p>The original article I used as a basis for configuring my applications is at the url below:</p>
<p><a href="http://www.simple-talk.com/sql/t-sql-programming/using-and-monitoring-sql-2005-query-notification/">http://www.simple-talk.com/sql/t-sql-programming/using-and-monitoring-sql-2005-query-notification/</a></p>
<p>Follow the steps there and you&#8217;re good to go.  Especially use the SQL Profiler debug steps at the bottom of the article if you get tripped up.  One thing that I always had to do with my databases to get everything to work properly was execute the following query:</p>
<div class="wp_syntax">
<div class="code">
</div>
<pre class="csharp csharp">
use &lt;dbname&gt;
EXEC dbo.sp_changedbowner @loginame = N'&lt;dbuser&gt;', @map = false
</pre>
</div>
<p>Make sure you use this caching technique responsible though.  The Query Notifications can use up processing power so only cache data that you know will give your application a performance bump.  Also beware of memory usage as you cache more and more data.  You could end up caching so much data your application needs to restart often and that could cause slow page load times.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2010/09/23/asp-net-sqlcachedependency-with-sql-query-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily Cause StackOverflow Exception in ASP.NET Web Application</title>
		<link>http://www.billrowell.com/2010/03/19/easily-cause-stackoverflow-exception-in-asp-net-web-application/</link>
		<comments>http://www.billrowell.com/2010/03/19/easily-cause-stackoverflow-exception-in-asp-net-web-application/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 18:27:44 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=657</guid>
		<description><![CDATA[This is a short one, but since I can&#8217;t believe I&#8217;ve never managed to do this before, I thought I&#8217;d post a little tidbit on it. I threw a StackOverflow in one of my ASP.NET C# web applications today. Watching the request keep going for about 5 minutes, I checked the Event Log on the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short one, but since I can&#8217;t believe I&#8217;ve never managed to do this before, I thought I&#8217;d post a little tidbit on it.  I threw a StackOverflow in one of my ASP.NET C# web applications today.  Watching the request keep going for about 5 minutes, I checked the Event Log on the server.  There it was, StackOverflow exception.  Say, what?</p>
<p>How did I manage it?  Recursively add a control to its own control collection.  The .NET framework just freaks and the application pool just gets restarted after each exception kills the app.  Glad it didn&#8217;t take long to figure it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2010/03/19/easily-cause-stackoverflow-exception-in-asp-net-web-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove ViewState From ASP.NET Page to Improve Performance</title>
		<link>http://www.billrowell.com/2009/06/17/remove-viewstate-from-asp-net-page-to-improve-performance/</link>
		<comments>http://www.billrowell.com/2009/06/17/remove-viewstate-from-asp-net-page-to-improve-performance/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 00:21:41 +0000</pubDate>
		<dc:creator>Bill</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.billrowell.com/?p=526</guid>
		<description><![CDATA[In a previous post, I eluded to the fact that I remove the ViewState from our ASP.NET pages to improve performance. I can&#8217;t take credit for coming up with the idea though. Originally, I got the idea and solution I wanted to implement by reading this article at EggHead Cafe. The solution I chose was [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post, I eluded to the fact that I remove the ViewState from our ASP.NET pages to improve performance.  I can&#8217;t take credit for coming up with the idea though.  Originally, I got the idea and solution I wanted to implement by reading <a href="http://www.eggheadcafe.com/articles/20040613.asp">this article at EggHead Cafe</a>.  The solution I chose was to store the ViewState on the web server&#8217;s file system and reference the file in the page sent back to the client.  I&#8217;ll outline how I did that below.</p>
<p>The first thing you&#8217;ll want to do is create a new Page base class that inherits from System.Web.UI.Page so you can override some of its methods, namely SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium.  This will allow you to save the page&#8217;s ViewState to the file system and then re-load it on a post back.  Let&#8217;s start with saving the ViewState to the file system.</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp csharp">
protected override void protectedSavePageStateToPersistenceMedium(object viewState)
{
	// Serialize the view state into a base-64 encoded string
        LosFormatter los = new LosFormatter();
	StringWriter writer = new StringWriter();
	los.Serialize(writer, viewState);

	string guid = NewGuid();
	string vsp = ViewStateFilePath(guid);

	// Save the string to disk
	StreamWriter sw = File.CreateText(vsp);
	sw.Write(writer.ToString());
	sw.Close();

	// Save the guid in a form field
	ClientScript.RegisterHiddenField("__VIEWSTATE_GUID", guid);
}
</pre>
</div>
</div>
<p>So, let&#8217;s step through what we&#8217;re doing here.  The first few lines of code, we&#8217;re serializing the view state.  Next, where we call</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp csharp">
string uid = NewGuid();
</pre>
</div>
</div>
<p>We&#8217;re creating a new guid that we will use in creating the file name on the server for the actual value of the current view state.  NewGuid() just returns a new guid value from the System.Guid class.</p>
<p>Next, we need to create a path to where we&#8217;re going to store the file as well as its file name.  Now, you can do this any way you want as long as all of your files end up being unique.  You can&#8217;t go overwriting one guy&#8217;s view state with someone else&#8217;s.  Now I based mine on basically the guid appended with the current request path minus the extension and replacing the slashes with dashes.  So, my filename looks like:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp csharp">
string fileName = guid + "-" + Path.GetFileNameWithoutExtension(Request.Path).Replace(
    "/", "-") + ".vs";
</pre>
</div>
</div>
<p>Where the guid was passed in to the function that I called to create the view state file path.</p>
<p>So now that we have a path to where we can write the file, we can go ahead and do so using the StreamWriter that we created.  Now, the last thing to do is spit out where we can find the view state to the client.  This is done by registering a hidden field with the client:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp csharp">
ClientScript.RegisterHiddenField("__VIEWSTATE_GUID", guid);
</pre>
</div>
</div>
<p>That GUID allows you to recall the proper file for the client when you need to access the ViewState.</p>
<p>So now you&#8217;ve persisted the view state to the file system.  Now all that&#8217;s left is to load it up when needed, which is done with LoadPageStateFromPersistenceMedium(), which is below.</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp csharp">
protected override object LoadPageStateFromPersistenceMedium()
{
	string guid = Request.Form["__VIEWSTATE_GUID"];
	if (guid == "")
		return null;
		// determine the file to access
	if (!File.Exists(ViewStateFilePath(guid)))
	{
		return null;
	}
	else
	{
		// open the file
		StreamReader sr = File.OpenText(ViewStateFilePath(guid));
		string viewStateString = sr.ReadToEnd();
		sr.Close();
		// deserialize the string
		LosFormatter los = new LosFormatter();
		return los.Deserialize(viewStateString);
	}
}
</pre>
</div>
</div>
<p>This approach gives you the ability to minimize the amount of data that you have to send over the wire to a client browser.  There are other solutions to this like storing the ViewState in memory, but I felt that it was a waste of resources if a ViewState might only be used once and then abandoned.  The one thing you&#8217;ll want to do is manage your saved ViewState files on your disk.  These files can get out of control, especially when you get a lot of visitor&#8217;s.  So what I did was just set up a Scheduled Task in Windows to clean up stored ViewState&#8217;s every three hours.  This works out pretty good since a ViewState really won&#8217;t be needed beyond that timeframe.</p>
<p>Anyway, I hope this solution helps some other C# ASP.NET developers out there.  It sure worked out great for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.billrowell.com/2009/06/17/remove-viewstate-from-asp-net-page-to-improve-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

