<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>{get; set;} : CODE! &#187; Uncategorized</title>
	<atom:link href="http://daveswersky.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://daveswersky.com</link>
	<description>Dave Swersky&#039;s {mis}Adventures in .NET Programming</description>
	<lastBuildDate>Mon, 30 Jan 2012 14:05:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='daveswersky.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/194cabc2fcba5c79c24715cf0d22aaa2?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>{get; set;} : CODE! &#187; Uncategorized</title>
		<link>http://daveswersky.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://daveswersky.com/osd.xml" title="{get; set;} : CODE!" />
	<atom:link rel='hub' href='http://daveswersky.com/?pushpress=hub'/>
		<item>
		<title>Bizarre Errors When Using Telerik Controls</title>
		<link>http://daveswersky.com/2010/12/15/bizarre-errors-when-using-telerik-controls/</link>
		<comments>http://daveswersky.com/2010/12/15/bizarre-errors-when-using-telerik-controls/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 21:43:50 +0000</pubDate>
		<dc:creator>Dave Swersky</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[silverlight telerik]]></category>

		<guid isPermaLink="false">http://daveswersky.com/?p=604</guid>
		<description><![CDATA[I&#8217;m in the process of developing a complete line-of-business application in Silverlight.  I have a Telerik Premium license and most of the controls I use are Telerik controls. At one point in my development process, I innocently added an &#8220;Up/Down&#8221; control to a UserControl, using Blend 4.  Suddenly and for no apparent reason, I could [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daveswersky.com&amp;blog=9388197&amp;post=604&amp;subd=daveswersky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of developing a complete line-of-business application in Silverlight.  I have a Telerik Premium license and most of the controls I use are Telerik controls.</p>
<p>At one point in my development process, I innocently added an &#8220;Up/Down&#8221; control to a UserControl, using Blend 4.  Suddenly and for no apparent reason, I could no longer see the UserControl in Visual Studio 2010.  I would get a very odd looking blank page.  I could still edit it in Blend, however, and I&#8217;m under a time crunch so I carried on.</p>
<p>Today, Blend started crashing when trying to open the UserControl.  I now had no design surface and I&#8217;m struggling with other issues.  Among other strange issues, this error appeared in the VS designer:</p>
<p><em>An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.</em></p>
<p>If I reloaded the designer I would go back to the blank page.  After much gnashing of teeth, I tried copying this control to another project in my solution.   After commenting out a few lines, Voila!  Design surface!</p>
<p><strong>The Solution: </strong>When I used Blend to add the &#8220;up/down&#8221; control, it added a reference to a <em>prior version </em>of the Telerik.Windows.Controls.Input assembly to my project.  I had several other Telerik assemblies referenced, all Q3 2010 version.  The mismatched versions played hell with the designer and I was stuck.  I removed the offending prior versions and replaced them with the correct ones, and life was good.  Hope this saves you some time and gray hairs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daveswersky.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daveswersky.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/daveswersky.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/daveswersky.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daveswersky.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daveswersky.wordpress.com/604/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daveswersky.wordpress.com/604/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daveswersky.wordpress.com/604/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daveswersky.com&amp;blog=9388197&amp;post=604&amp;subd=daveswersky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://daveswersky.com/2010/12/15/bizarre-errors-when-using-telerik-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e9420fd2a6d39a3779e1d9119834bff?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daveswersky</media:title>
		</media:content>
	</item>
		<item>
		<title>I Don&#8217;t Miss ViewState</title>
		<link>http://daveswersky.com/2010/05/16/i-dont-miss-viewstate/</link>
		<comments>http://daveswersky.com/2010/05/16/i-dont-miss-viewstate/#comments</comments>
		<pubDate>Sun, 16 May 2010 16:49:48 +0000</pubDate>
		<dc:creator>Dave Swersky</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net asp.net-mvc viewstate]]></category>

		<guid isPermaLink="false">http://daveswersky.com/?p=421</guid>
		<description><![CDATA[I’ve been working with ASP.NET MVC for the last year and I don’t miss webforms.  The one thing about webforms I miss the least is ViewState. It’s a Hack Hidden HTML fields were never intended to hold so much data.  Persisting data in the page this way is Ugly, Expensive, Confusing, and Hard to Test. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daveswersky.com&amp;blog=9388197&amp;post=421&amp;subd=daveswersky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="WordSection1">
<p class="MsoNormal">I’ve been working with ASP.NET MVC for the last year and I don’t miss webforms.  The one thing about webforms I miss the least is ViewState.</p>
<p class="MsoNormal"><strong>It’s a Hack</strong></p>
<p class="MsoNormal" style="padding-left:30px;">Hidden HTML fields were never intended to hold so much data.  Persisting data in the page this way is Ugly, Expensive, Confusing, and Hard to Test.</p>
<p class="MsoNormal"><strong>It’s Ugly</strong></p>
<p class="MsoNormal" style="padding-left:30px;">ViewState is this ugly blob of Base-64 encoded data:</p>
<pre class="MsoNormal" style="padding-left:30px;"><span style="font-family:&amp;"> &lt;input type=”hidden” name=”__VIEWSTATE”
  value=”</span>aHR0cDovL3d3dy5jb2Rlcm9zZXR0YS5jb20vYmFsbHB1enpsZQ==<span style="font-family:&amp;">” /&gt;</span></pre>
<p class="MsoNormal"><strong>It’s Expensive</strong></p>
<p class="MsoNormal" style="padding-left:30px;">ViewState is processed <em>on every postback. </em>This means it has to be sent, parsed, processed, updated, and re-sent with every request.  Not good for performance!</p>
<p class="MsoNormal"><strong>It’s Confusing</strong></p>
<p class="MsoNormal" style="padding-left:30px;">I can’t tell you how many StackOverflow and forums posts I’ve seen about dynamic controls and ViewState.  If you don’t add dynamic controls at just the right point in the page lifecycle, ViewState breaks.</p>
<p class="MsoNormal"><strong>It Uses Magic Strings (So It’s Hard to Test)</strong></p>
<p class="MsoNormal" style="padding-left:30px;"><span style="font-family:courier;">ViewState["MyMagicString"]</span> is a typo-prone way to address data.  Strongly-typed Views in ASP.NET MVC are so much easier to work with and much more testable.</p>
<p class="MsoNormal"><strong><span style="text-decoration:underline;">The MVC Way</span></strong></p>
<p class="MsoNormal" style="padding-left:30px;">MVC doesn’t even try to match ViewState as a feature.  ViewState is a stateful paradigm layered on top of a fundamentally stateless protocol: HTTP.  Rather than the hybridized hack of packing a huge encoded graph into a hidden field, MVC says:</p>
<p class="MsoNormal" style="text-indent:.5in;padding-left:30px;"><strong>“If you want to persist state, do it on the server using a Model.&#8221;</strong></p>
<p style="padding-left:30px;">You can use Session state or TempData on the server and javascript or cookies at the client to store <em>pointers</em>, but actual data should be persisted by one thing- the Model.  The MVC rendering pipeline relies on Models (or ViewModels) to retain and provide the data that populate Views.  If you change the state of a control, the data is updated in and persisted through the Model, preferably by a loosely-coupled persistence implementation.  This is a much cleaner, architecturally sound method for dealing with state over a stateless delivery protocol.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daveswersky.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daveswersky.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/daveswersky.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/daveswersky.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daveswersky.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daveswersky.wordpress.com/421/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daveswersky.wordpress.com/421/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daveswersky.wordpress.com/421/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daveswersky.com&amp;blog=9388197&amp;post=421&amp;subd=daveswersky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://daveswersky.com/2010/05/16/i-dont-miss-viewstate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e9420fd2a6d39a3779e1d9119834bff?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daveswersky</media:title>
		</media:content>
	</item>
		<item>
		<title>LINQ Aggregate Queries: Multiple Group By Columns</title>
		<link>http://daveswersky.com/2009/11/12/linq-aggregate-queries-multiple-group-by-columns/</link>
		<comments>http://daveswersky.com/2009/11/12/linq-aggregate-queries-multiple-group-by-columns/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:51:04 +0000</pubDate>
		<dc:creator>Dave Swersky</dc:creator>
				<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aggregate]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://daveswersky.com/?p=338</guid>
		<description><![CDATA[I recently had the need to SUM a column grouped by two other columns. Here&#8217;s the view: I needed this: Here&#8217;s the LINQ: The magic is in line 2: You can group by as many columns as you need with that little nugget. Using the anonymous type feature in C# 3.0 you can group on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daveswersky.com&amp;blog=9388197&amp;post=338&amp;subd=daveswersky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had the need to SUM a column grouped by two other columns.  Here&#8217;s the view:</p>
<p><pre class="brush: sql;">
SELECT SolutionID, EventName, EventDuration
FROM Events
</pre></p>
<p>I needed this:</p>
<p><pre class="brush: sql;">
SELECT SolutionID, EventName, SUM(EventDuration) EventTotal
FROM Events
GROUP BY SolutionID, EventName
</pre></p>
<p>Here&#8217;s the LINQ:<br />
<pre class="brush: csharp;">
var events = from e in summary
   group e by new { e.SolutionID, e.EventDetail } into g
   let TotalMinutes = g.Sum(x =&gt; x.EventDuration)
   orderby TotalMinutes descending
   select new EventSummary
     {
          SolutionID = g.Key.SolutionID,
          Name = g.Key.EventDetail,
          Seconds = TotalMinutes,
          Minutes = TotalMinutes / 60.0,
          Hours = (TotalMinutes / 60.0) / 60.0                           
     };
</pre></p>
<p>The magic is in line 2:<br />
<pre class="brush: csharp;">   group e by new { e.SolutionID, e.EventDetail } into g</pre><br />
You can group by as many columns as you need with that little nugget.  Using the anonymous type feature in C# 3.0 you can group on as many columns as you need.  Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daveswersky.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daveswersky.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/daveswersky.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/daveswersky.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daveswersky.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daveswersky.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daveswersky.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daveswersky.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daveswersky.com&amp;blog=9388197&amp;post=338&amp;subd=daveswersky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://daveswersky.com/2009/11/12/linq-aggregate-queries-multiple-group-by-columns/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e9420fd2a6d39a3779e1d9119834bff?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daveswersky</media:title>
		</media:content>
	</item>
	</channel>
</rss>
