<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>The Sprage Page!</title>
    <link>http://thesprage.com/DasBlog/</link>
    <description>My Quest for Knowledge</description>
    <language>en-us</language>
    <copyright>Aaron Sprague</copyright>
    <lastBuildDate>Thu, 21 May 2009 17:29:45 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>Aaron@TheSprague.com</managingEditor>
    <webMaster>Aaron@TheSprague.com</webMaster>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=16925099-bd8b-4885-bc8b-52b4d5507bcf</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,16925099-bd8b-4885-bc8b-52b4d5507bcf.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,16925099-bd8b-4885-bc8b-52b4d5507bcf.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=16925099-bd8b-4885-bc8b-52b4d5507bcf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font face="Arial">Its always scary working with live data I found that I feel more
confident when I take the following measures.</font>
        </p>
        <p>
          <span class="Arial" fnotmisspelledcache="true">
            <font face="Arial">Do a Select first
to check the where clause:</font>
          </span>
        </p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span> * <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> Foo <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> FooID
= 1000</span>
        </pre>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Arial" size="2">Wrap
your changes in a Transaction and roll it back if you did not get the expected result.</font>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <pre>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
              <pre>
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Begin</span>
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Transaction</span>
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DELETE</span>
                  <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> Foo <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span> FooID
= 1000 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">IF</span><span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">@@RowCount</span> &lt;&gt;
1 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BEGIN</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Rollback</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Transaction</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">END</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ELSE</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Commit</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Transaction</span></span>
              </pre>
            </span>
          </pre>
          <p>
          </p>
        </span>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"> 
</span>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=16925099-bd8b-4885-bc8b-52b4d5507bcf" />
      </body>
      <title>Safer Deletes and Updates on Live DataBase</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,16925099-bd8b-4885-bc8b-52b4d5507bcf.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/05/21/SaferDeletesAndUpdatesOnLiveDataBase.aspx</link>
      <pubDate>Thu, 21 May 2009 17:29:45 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font face=Arial&gt;Its always scary working with live data I found that I feel more
confident when I take the following measures.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span class=Arial fnotmisspelledcache="true"&gt;&lt;font face=Arial&gt;Do a Select first to
check the where clause:&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; * &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; Foo &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHERE&lt;/span&gt; FooID
= 1000&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Arial size=2&gt;Wrap
your changes in a Transaction and roll it back if you did not get the expected result.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Begin&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Transaction&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DELETE&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; Foo &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHERE&lt;/span&gt; FooID
= 1000 &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;IF&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;@@RowCount&lt;/span&gt; &amp;lt;&amp;gt;
1 &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BEGIN&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Rollback&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Transaction&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;END&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ELSE&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Commit&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Transaction&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;nbsp;&gt;
&lt;/span&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=16925099-bd8b-4885-bc8b-52b4d5507bcf" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,16925099-bd8b-4885-bc8b-52b4d5507bcf.aspx</comments>
      <category>Education</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=7fd5a503-9b67-46ff-a539-4dfe46f1de1d</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,7fd5a503-9b67-46ff-a539-4dfe46f1de1d.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,7fd5a503-9b67-46ff-a539-4dfe46f1de1d.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=7fd5a503-9b67-46ff-a539-4dfe46f1de1d</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Problem: </strong>You try to open a .mdf file in visual studio and you get
one of the following errors.
</p>
        <p>
          <em>Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function
properly.  Please verify the installation of the component or download from the
URL:  </em>
          <a href="http://go.microsoft.com/fwlink/?LinkId=49251">
            <em>http://go.microsoft.com/fwlink/?LinkId=49251</em>
          </a>
        </p>
        <p>
          <em>Failed to generate a user instance of SQL Server due to a failure in starting
the process for the user instance. The connection will be closed.</em>
        </p>
        <p>
          <strong>Solution: </strong>Open Server Explorer add Data Connection. Make sure the
Data Source = Microsoft SQL Server Database File (SqlClient) and browse to the .mdf
file located in your source directory(There maybe on located in the bin directory
but this will get copied over by what is in src on a build). Click the Advance button.
In order to work I needed to switch the Data Source to .\SQLEXPRESS2005 (<font color="#ff0000">This
will be different for each computer</font>). 
</p>
        <p>
Final connection string should look something like this:
</p>
        <font size="2">
          <p>
            <em>Data Source=.\SQLEXPRESS2005;AttachDbFilename=|DataDirectory|\NerdDinner.mdf;Integrated
Security=True;Connect Timeout=30;User Instance=True</em>
          </p>
        </font>
        <img src="http://thesprage.com/DasBlog/content/binary/AddConnection.png" border="0" />
        <img src="http://thesprage.com/DasBlog/content/binary/Advanced.png" border="0" />
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=7fd5a503-9b67-46ff-a539-4dfe46f1de1d" />
      </body>
      <title>Visual Studio Throws an Error When Trying to Connect/Open an .mdf File</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,7fd5a503-9b67-46ff-a539-4dfe46f1de1d.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/04/11/VisualStudioThrowsAnErrorWhenTryingToConnectOpenAnMdfFile.aspx</link>
      <pubDate>Sat, 11 Apr 2009 18:15:20 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Problem: &lt;/strong&gt;You try to open a .mdf file in visual studio and you get
one of the following errors.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function
properly.&amp;nbsp; Please verify the installation of the component or download from the
URL:&amp;nbsp; &lt;/em&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=49251"&gt;&lt;em&gt;http://go.microsoft.com/fwlink/?LinkId=49251&lt;/em&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Failed to generate a user instance of SQL Server due to a failure in starting
the process for the user instance. The connection will be closed.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Solution: &lt;/strong&gt;Open Server Explorer add Data Connection. Make sure the
Data Source = Microsoft SQL Server Database File (SqlClient) and browse to the .mdf
file located in your source directory(There maybe on located in the bin directory
but this will get copied over by what is in src on a build). Click the Advance button.
In order to work I needed to switch the Data Source to .\SQLEXPRESS2005 (&lt;font color=#ff0000&gt;This
will be different for each computer&lt;/font&gt;). 
&lt;/p&gt;
&lt;p&gt;
Final connection string should look something like this:
&lt;/p&gt;
&lt;font size=2&gt; 
&lt;p&gt;
&lt;em&gt;Data Source=.\SQLEXPRESS2005;AttachDbFilename=|DataDirectory|\NerdDinner.mdf;Integrated
Security=True;Connect Timeout=30;User Instance=True&lt;/em&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;img src="http://thesprage.com/DasBlog/content/binary/AddConnection.png" border=0&gt;&lt;img src="http://thesprage.com/DasBlog/content/binary/Advanced.png" border=0&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=7fd5a503-9b67-46ff-a539-4dfe46f1de1d" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,7fd5a503-9b67-46ff-a539-4dfe46f1de1d.aspx</comments>
      <category>Education</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=bc271aac-f54c-4179-8748-9ecbc0c9bdbd</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,bc271aac-f54c-4179-8748-9ecbc0c9bdbd.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,bc271aac-f54c-4179-8748-9ecbc0c9bdbd.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=bc271aac-f54c-4179-8748-9ecbc0c9bdbd</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Problem: </strong>You want to be able use the Ninject frame work with the
new and shiny ASP.Net MVC framework.
</p>
        <p>
          <strong>Solution:</strong> Assembly: Ninject.Framework.MVC Contains an Abstract Base
class you can Inherit from to do most of your heavy lifting.
</p>
        <p>
 
</p>
        <p>
Some Code 
</p>
        <p>
Global.asax.cs
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> MvcApplication
: NinjectHttpApplication { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> IKernel
_kernal; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">protected</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">override</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> RegisterRoutes(RouteCollection
routes) { routes.IgnoreRoute(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"{resource}.axd/{*pathInfo}"</span>);
routes.MapRoute( <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Default"</span>, <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Route name</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"{controller}/{action}/{id}"</span>, <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
URL with parameters</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> {
controller <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Home"</span>,
action <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Index"</span>,
id <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">""</span> } <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
Parameter defaults</span> ); } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">protected</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">override</span> IKernel
CreateKernel() { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (_kernal
== <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>)
{ var modules <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> IModule[]
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> AutoControllerModule(Assembly.GetExecutingAssembly()), <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> DemoModual()
}; _kernal <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> StandardKernel(modules);
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> _kernal;
} }</span>
        </pre>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=bc271aac-f54c-4179-8748-9ecbc0c9bdbd" />
      </body>
      <title>ASP.Net MVC And Ninject</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,bc271aac-f54c-4179-8748-9ecbc0c9bdbd.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/04/10/ASPNetMVCAndNinject.aspx</link>
      <pubDate>Fri, 10 Apr 2009 23:58:03 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Problem: &lt;/strong&gt;You want to be able use the Ninject frame work with the
new and shiny ASP.Net MVC framework.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; Assembly: Ninject.Framework.MVC Contains an Abstract Base
class you can Inherit from to do most of your heavy lifting.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Some Code 
&lt;/p&gt;
&lt;p&gt;
Global.asax.cs
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/span&gt; MvcApplication
: NinjectHttpApplication { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;private&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;static&lt;/span&gt; IKernel
_kernal; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt; RegisterRoutes(RouteCollection
routes) { routes.IgnoreRoute(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"{resource}.axd/{*pathInfo}"&lt;/span&gt;);
routes.MapRoute( &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Default"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Route name&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"{controller}/{action}/{id}"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
URL with parameters&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; {
controller &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Home"&lt;/span&gt;,
action &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Index"&lt;/span&gt;,
id &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;""&lt;/span&gt; } &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
Parameter defaults&lt;/span&gt; ); } &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;protected&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/span&gt; IKernel
CreateKernel() { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (_kernal
== &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;)
{ var modules &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; IModule[]
{ &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; AutoControllerModule(Assembly.GetExecutingAssembly()), &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; DemoModual()
}; _kernal &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; StandardKernel(modules);
} &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; _kernal;
} }&lt;/span&gt;&lt;/pre&gt;
&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=bc271aac-f54c-4179-8748-9ecbc0c9bdbd" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,bc271aac-f54c-4179-8748-9ecbc0c9bdbd.aspx</comments>
      <category>C#</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=834e33c9-0488-48bb-9656-4d830a19ef7e</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,834e33c9-0488-48bb-9656-4d830a19ef7e.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,834e33c9-0488-48bb-9656-4d830a19ef7e.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=834e33c9-0488-48bb-9656-4d830a19ef7e</wfw:commentRss>
      <title>Inversion of Control vs Dependency Injection vs Strategy Pattern</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,834e33c9-0488-48bb-9656-4d830a19ef7e.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/02/18/InversionOfControlVsDependencyInjectionVsStrategyPattern.aspx</link>
      <pubDate>Wed, 18 Feb 2009 21:23:32 GMT</pubDate>
      <description>&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;&lt;strong&gt;Warning&lt;/strong&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; this
my understanding as of today, who knows what tomorrow will bring.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;I
often hear the terms Inversion of Control(IOC), Dependency Injection(DI) and the Strategy
Pattern thrown around in the same context, this was getting really confusing for me.
So, I spent a couple of hours trying to clarify the differences.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;IOC
vs DI: &lt;/span&gt;&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;Basically
DI is a type of IOC. IOC is a broad abstract principle that covers not only DI but
Event-Driven programming and numerous others.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;So
What is DI? &lt;/span&gt;&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;DI
is the way you provide the implementation for a&amp;nbsp;dependent service. There are
a number of DI frameworks out there I have recently been playing with &lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt;&amp;nbsp;mostly
because I like ninjas... and the flow syntax for wiring up the dependencies looks
nice.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;DI
vs Strategy Pattern&lt;/span&gt;&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: 'Verdana','sans-serif'"&gt;:
For a while now I have been using&amp;nbsp;the Strategy pattern&amp;nbsp;thinking it was the
same as DI. I know, "Gosh such an idiot :P", but DI assembles the appropriate algorithms
for the calling class. Strategy is just one of the patterns that lends itself well
to DI.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;More Info:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://en.wikipedia.org/wiki/Dependency_injection"&gt;Dependency injection&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control"&gt;Inversion of control&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://martinfowler.com/articles/injection.html"&gt;Inversion of Control Containers
and the Dependency Injection pattern by Martin Fowler&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://ke-jin.blogspot.com/2008/03/inversion-of-control-vs-strategy.html"&gt;Inversion
of Control vs Strategy Pattern&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://ke-jin.blogspot.com/2009/02/ioc-containers-are-not-about-design.html"&gt;IoC
containers are not about a design pattern&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Thank you, &lt;a href=" http://ang3lfir3.wordpress.com" temp_href=" http://ang3lfir3.wordpress.com"&gt;Eric
Ridgeway&lt;/a&gt; for answering my 200 questions.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=834e33c9-0488-48bb-9656-4d830a19ef7e" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,834e33c9-0488-48bb-9656-4d830a19ef7e.aspx</comments>
      <category>C#</category>
      <category>Education</category>
      <category>VB.NET</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=3aa10295-c710-4d6f-9250-ded5d7c0517c</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,3aa10295-c710-4d6f-9250-ded5d7c0517c.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,3aa10295-c710-4d6f-9250-ded5d7c0517c.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=3aa10295-c710-4d6f-9250-ded5d7c0517c</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Problem: </strong>After deploying your silverlight application to your Web
server you get the following error.
</p>
        <address>Error: Unhandled Error in Silverlight 2 Application 
</address>
        <address>Code: 2104    
</address>
        <address>Category: InitializeError
</address>
        <address>Message: Could not download the Silverlight application. Check web server
settings     
</address>
        <address>Source File: TestPage.html
</address>
        <address>Line: 53
</address>
        <address> 
</address>
        <p>
          <strong>Solution: </strong>The MIME types on your webserver are not setup correctly
to host your silver light application. The MIME types needed are:
</p>
        <p>
.xaml    application/xaml+xml 
<br />
.xap    application/x-silverlight-app 
<br />
.xbap    application/x-ms-xbap 
</p>
        <p>
          <strong>Hack: </strong>If you are like me and have your silverlight hosted on a shared
hosting enviroment like godaddy you cannot change your MIME types. Instead change
the .xap to .zip you must also change the source paramater value inside your page
to match.
</p>
        <font size="2">
          <address>
          </address>
        </font>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">object</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">data</font>
              </font>
              <font size="2">
                <font size="2">="data:application/x-silverlight,"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">type</font>
              </font>
              <font size="2">
                <font size="2">="application/x-silverlight-2"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">width</font>
              </font>
              <font size="2">
                <font size="2">="100%"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">height</font>
              </font>
              <font size="2">
                <font size="2">="100%"&gt;
</font>
              </font>
            </font>
            <p>
              <font size="3">
                <font size="2">
                  <strong>
                    <font color="#0000ff">
                      <font color="#0000ff">&lt;</font>
                    </font>
                    <font color="#a31515">
                      <font color="#a31515">param</font>
                    </font>
                    <font color="#ff0000">
                      <font color="#ff0000">name</font>
                    </font>
                    <font color="#0000ff">
                      <font color="#0000ff">="source"</font>
                    </font>
                    <font color="#ff0000">
                      <font color="#ff0000">value</font>
                    </font>
                    <font color="#0000ff">
                      <font color="#0000ff">="Microsoft.Windows.Controls.Samples.zip"/&gt;
</font>
                    </font>
                  </strong>
                </font>
              </font>
            </p>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">param</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">name</font>
              </font>
              <font size="2">
                <font size="2">="onerror"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">value</font>
              </font>
              <font size="2">
                <font size="2">="onSilverlightError"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">/&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">param</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">name</font>
              </font>
              <font size="2">
                <font size="2">="background"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">value</font>
              </font>
              <font size="2">
                <font size="2">="white"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">/&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">param</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">name</font>
              </font>
              <font size="2">
                <font size="2">="minRuntimeVersion"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">value</font>
              </font>
              <font size="2">
                <font size="2">="2.0.31005.0"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">/&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">param</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">name</font>
              </font>
              <font size="2">
                <font size="2">="autoUpgrade"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">value</font>
              </font>
              <font size="2">
                <font size="2">="true"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">/&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">a</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">href</font>
              </font>
              <font size="2">
                <font size="2">="http://go.microsoft.com/fwlink/?LinkID=124807"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">style</font>
              </font>
              <font size="2">
                <font size="2">="</font>
              </font>
              <font size="2">
                <font size="2">text-decoration</font>
              </font>
              <font size="2">: </font>
              <font size="2">
                <font size="2">none</font>
              </font>
              <font size="2">;</font>
              <font size="2">
                <font size="2">"&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;</font>
              </font>
              <font size="2">
                <font size="2">img</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">src</font>
              </font>
              <font size="2">
                <font size="2">="http://go.microsoft.com/fwlink/?LinkId=108181"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">alt</font>
              </font>
              <font size="2">
                <font size="2">="Get
Microsoft Silverlight"</font>
              </font>
              <font size="2">
              </font>
              <font size="2">
                <font size="2">style</font>
              </font>
              <font size="2">
                <font size="2">="</font>
              </font>
              <font size="2">
                <font size="2">border-style</font>
              </font>
              <font size="2">: </font>
              <font size="2">
                <font size="2">none"/&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;/</font>
              </font>
              <font size="2">
                <font size="2">a</font>
              </font>
              <font size="2">
                <font size="2">&gt;
</font>
              </font>
            </font>
            <font size="2">
              <p>
              </p>
            </font>
            <font color="#a9a9a9">
              <font size="2">
                <font size="2">&lt;/</font>
              </font>
              <font size="2">
                <font size="2">object</font>
              </font>
              <font color="#0000ff" size="2">
                <font color="#0000ff" size="2">&gt;
</font>
              </font>
            </font>
          </span>
        </pre>
        <font color="#d3d3d3">
          <font color="#a9a9a9">
            <font color="#0000ff" size="2">
              <font color="#0000ff" size="2">
              </font>
            </font>
          </font>
        </font>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=3aa10295-c710-4d6f-9250-ded5d7c0517c" />
      </body>
      <title>Unhandled Error in Silverlight 2 Application Code: 2104</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,3aa10295-c710-4d6f-9250-ded5d7c0517c.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/02/17/UnhandledErrorInSilverlight2ApplicationCode2104.aspx</link>
      <pubDate>Tue, 17 Feb 2009 07:11:02 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Problem: &lt;/strong&gt;After deploying your silverlight application to your Web
server you get the following error.
&lt;/p&gt;
&lt;address&gt;Error: Unhandled Error in Silverlight 2 Application 
&lt;/address&gt;
&lt;address&gt;Code: 2104&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/address&gt;
&lt;address&gt;Category: InitializeError
&lt;/address&gt;
&lt;address&gt;Message: Could not download the Silverlight application. Check web server
settings&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/address&gt;
&lt;address&gt;Source File: TestPage.html
&lt;/address&gt;
&lt;address&gt;Line: 53
&lt;/address&gt;
&lt;address&gt;&amp;nbsp;
&lt;/address&gt;
&lt;p&gt;
&lt;strong&gt;Solution: &lt;/strong&gt;The MIME types on your webserver are not setup correctly
to host your silver light application. The MIME types needed are:
&lt;/p&gt;
&lt;p&gt;
.xaml &amp;nbsp; &amp;nbsp;application/xaml+xml 
&lt;br&gt;
.xap &amp;nbsp; &amp;nbsp;application/x-silverlight-app 
&lt;br&gt;
.xbap &amp;nbsp; &amp;nbsp;application/x-ms-xbap 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Hack: &lt;/strong&gt;If you are like me and have your silverlight hosted on a shared
hosting enviroment like godaddy you cannot change your MIME types. Instead change
the .xap to .zip you must also change the source paramater value inside your page
to match.
&lt;/p&gt;
&lt;font size=2&gt; 
&lt;address&gt;
&lt;/font&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;data&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="data:application/x-silverlight,"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;type&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="application/x-silverlight-2"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;width&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="100%"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;height&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="100%"&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;
&lt;font size=3&gt;&lt;font size=2&gt;&lt;strong&gt;&lt;font color=#0000ff&gt;&lt;font color=#0000ff&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#a31515&gt;&lt;font color=#a31515&gt;param&lt;/font&gt;&lt;/font&gt; &lt;font color=#ff0000&gt;&lt;font color=#ff0000&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff&gt;&lt;font color=#0000ff&gt;="source"&lt;/font&gt;&lt;/font&gt; &lt;font color=#ff0000&gt;&lt;font color=#ff0000&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff&gt;&lt;font color=#0000ff&gt;="Microsoft.Windows.Controls.Samples.zip"/&amp;gt;
&lt;/p&gt;
&gt;&gt;&gt;&gt;&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;param&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="onerror"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="onSilverlightError"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;/&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;param&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="background"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="white"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;/&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;param&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="minRuntimeVersion"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="2.0.31005.0"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;/&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;param&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="autoUpgrade"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="true"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;/&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;a&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;href&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="http://go.microsoft.com/fwlink/?LinkID=124807"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;style&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;text-decoration&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;: &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;none&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;"&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;img&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;src&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="http://go.microsoft.com/fwlink/?LinkId=108181"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;alt&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="Get
Microsoft Silverlight"&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;style&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;="&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;border-style&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;: &lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;none"/&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;a&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;
&lt;p&gt;
&lt;/font&gt;&lt;font color=#a9a9a9&gt;&lt;font size=2&gt;&lt;font size=2&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font size=2&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;font color=#d3d3d3&gt;&lt;font color=#a9a9a9&gt;&lt;font color=#0000ff size=2&gt;&lt;font color=#0000ff size=2&gt;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=3aa10295-c710-4d6f-9250-ded5d7c0517c" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,3aa10295-c710-4d6f-9250-ded5d7c0517c.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just joined <a href="http://www.twitter.com">twitter</a> I have played around with
it before and never understood the appeal. Well I understand now you really need a
good client app, I use <a href="http://www.tweetdeck.com/beta/">TweetDeck</a>. After
that its all about the search, people use "hash codes" to assign categories to there
tweets(cool kid lingo for messages on twitter). e.g. #Seattle doing a search on this
hash forms a pseudo chat room then you just add #Seattle to any messages you want
to show up. Its a lot of fun.
</p>
        <p>
          <a href="http://www.hanselman.com/blog/">Scott</a> has a good <a href="http://www.hanselman.com/blog/HowToTwitterFirstStepsAndATwitterGlossary.aspx">guid
on twitter</a></p>
        <p>
          <a href="http://twitter.com/Aaronls79">My Twitter</a>
        </p>
        <p>
Search on a topic:
</p>
        <p>
          <img src="http://thesprage.com/DasBlog/content/binary/toolbar.png" border="0" />
        </p>
        <p>
          <img src="http://thesprage.com/DasBlog/content/binary/search.png" border="0" />
        </p>
        <p>
Send tweets on this topic:
</p>
        <p>
          <img src="http://thesprage.com/DasBlog/content/binary/msg.png" border="0" />
        </p>
        <p>
See whats going on:
</p>
        <img src="http://thesprage.com/DasBlog/content/binary/searchRoom.png" border="0" />
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5" />
      </body>
      <title>Twitter</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/02/05/Twitter.aspx</link>
      <pubDate>Thu, 05 Feb 2009 20:59:23 GMT</pubDate>
      <description>&lt;p&gt;
I just joined &lt;a href="http://www.twitter.com"&gt;twitter&lt;/a&gt; I have played around with
it before and never understood the appeal. Well I understand now you really need a
good client app, I use &lt;a href="http://www.tweetdeck.com/beta/"&gt;TweetDeck&lt;/a&gt;. After
that its all about the search, people use "hash codes" to assign categories to there
tweets(cool kid lingo for messages on twitter). e.g. #Seattle doing a search on this
hash forms a pseudo chat room then you just add #Seattle to any messages you want
to show up. Its a lot of fun.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.hanselman.com/blog/"&gt;Scott&lt;/a&gt; has a good &lt;a href="http://www.hanselman.com/blog/HowToTwitterFirstStepsAndATwitterGlossary.aspx"&gt;guid
on twitter&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://twitter.com/Aaronls79"&gt;My Twitter&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Search on a topic:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://thesprage.com/DasBlog/content/binary/toolbar.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://thesprage.com/DasBlog/content/binary/search.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
Send tweets on this topic:
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://thesprage.com/DasBlog/content/binary/msg.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
See whats going on:
&lt;/p&gt;
&lt;img src="http://thesprage.com/DasBlog/content/binary/searchRoom.png" border=0&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,ca0c1c12-97f7-49d7-8718-d7fa8f2c3ed5.aspx</comments>
      <category>Personal</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=45013709-6ffd-4d22-9078-9323ddb08a78</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,45013709-6ffd-4d22-9078-9323ddb08a78.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,45013709-6ffd-4d22-9078-9323ddb08a78.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=45013709-6ffd-4d22-9078-9323ddb08a78</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Problem</strong>: You need a quick and easy way to manipulate elements contained
in a list.
</p>
        <p>
          <strong>Solution</strong>: Lambda Expression, these expressions are used in the same
fashion you would use anonymous methods but are less wordy.
</p>
        <p>
Anonymous methods:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">employees.FindAll(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">delegate</span>(employee
e1) { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> e1.Name
== <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Dave"</span>;
})</span>
        </pre>
        <p>
Lambda Expression:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">employees.FindAll(e1
=&gt; e1.Name == <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Dave"</span>);</span>
        </pre>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">employees.Sort((e1,e2)
=&gt; e1.LastName.CompareTo(e2.LastName));</span>
            </pre>
          </span>
        </pre>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">For
more complex expressions use the syntax like (params) =&gt; {statment}.</font>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <font face="Verdana" color="#003300" size="2">
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">employees.Sort((e1,
e2) =&gt; { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (e1.LastName.CompareTo(e2.LastName)
== 0) { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> e1.FirstName.CompareTo(e2.FirstName);
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">else</span> { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> e1.LastName.CompareTo(e2.LastName);
} });</span>
            </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font face="Verdana" color="#003300" size="2">For
more Info:</font>
                </span>
              </span>
            </pre>
            <pre>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                  <font face="Verdana" color="#003300" size="2">
                    <a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx">MSDN</a>
                  </font>
                </span>
              </span>
            </pre>
          </font>
        </span>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=45013709-6ffd-4d22-9078-9323ddb08a78" />
      </body>
      <title>Generic List Operations</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,45013709-6ffd-4d22-9078-9323ddb08a78.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2009/02/04/GenericListOperations.aspx</link>
      <pubDate>Wed, 04 Feb 2009 19:53:46 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Problem&lt;/strong&gt;: You need a quick and easy way to manipulate elements contained
in a list.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Lambda Expression, these expressions are used in the same
fashion you would use anonymous methods but are less wordy.
&lt;/p&gt;
&lt;p&gt;
Anonymous methods:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;employees.FindAll(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;delegate&lt;/span&gt;(employee
e1) { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; e1.Name
== &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Dave"&lt;/span&gt;;
})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Lambda Expression:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;employees.FindAll(e1
=&amp;gt; e1.Name == &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"Dave"&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;employees.Sort((e1,e2)
=&amp;gt; e1.LastName.CompareTo(e2.LastName));&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;For
more complex expressions use the syntax like (params) =&amp;gt; {statment}.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;employees.Sort((e1,
e2) =&amp;gt; { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (e1.LastName.CompareTo(e2.LastName)
== 0) { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; e1.FirstName.CompareTo(e2.FirstName);
} &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;else&lt;/span&gt; { &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; e1.LastName.CompareTo(e2.LastName);
} });&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;For
more Info:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx"&gt;MSDN&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/font&gt;&lt;/span&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=45013709-6ffd-4d22-9078-9323ddb08a78" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,45013709-6ffd-4d22-9078-9323ddb08a78.aspx</comments>
      <category>C#</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=370974ca-194e-429e-b161-527eed275b4f</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,370974ca-194e-429e-b161-527eed275b4f.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,370974ca-194e-429e-b161-527eed275b4f.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=370974ca-194e-429e-b161-527eed275b4f</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I like and use <a href="http://www.jetbrains.com/resharper/">Resharper</a> because
it is cheaper than <a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/index.xml">CodeRush</a> and
I don't have to remember as many key commands most things are done with an alt + enter.
It also works well with Unit Testing and for more yummy goodness with testing download <a href="http://www.jpboodhoo.com/blog/default.aspx">JP's</a><a href="http://www.jpboodhoo.com/blog/CommentView,guid,484bdd76-0a28-47d4-a796-2220364073e7.aspx#commentstart">templates</a> for
Resharper.
</p>
        <p>
          <a href="http://thesprage.com/DasBlog/content/binary/livetemplates.xml">livetemplates.xml
(14.74 KB)</a>
        </p>
        <a href="http://thesprage.com/DasBlog/content/binary/filetemplates.xml">filetemplates.xml
(3.79 KB)</a>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=370974ca-194e-429e-b161-527eed275b4f" />
      </body>
      <title>Resharper Templates</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,370974ca-194e-429e-b161-527eed275b4f.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2008/06/12/ResharperTemplates.aspx</link>
      <pubDate>Thu, 12 Jun 2008 18:27:34 GMT</pubDate>
      <description>&lt;p&gt;
I like and use &lt;a href="http://www.jetbrains.com/resharper/"&gt;Resharper&lt;/a&gt; because
it is cheaper than &lt;a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/index.xml"&gt;CodeRush&lt;/a&gt; and
I don't have to remember as many key commands most things are done with an alt + enter.
It also works well with Unit Testing and for more yummy goodness with testing download &lt;a href="http://www.jpboodhoo.com/blog/default.aspx"&gt;JP's&lt;/a&gt; &lt;a href="http://www.jpboodhoo.com/blog/CommentView,guid,484bdd76-0a28-47d4-a796-2220364073e7.aspx#commentstart"&gt;templates&lt;/a&gt; for
Resharper.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://thesprage.com/DasBlog/content/binary/livetemplates.xml"&gt;livetemplates.xml
(14.74 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;a href="http://thesprage.com/DasBlog/content/binary/filetemplates.xml"&gt;filetemplates.xml
(3.79 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=370974ca-194e-429e-b161-527eed275b4f" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,370974ca-194e-429e-b161-527eed275b4f.aspx</comments>
      <category>C#</category>
      <category>Personal</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=7fc2c3fb-df88-4418-b325-0372f66a1cb8</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,7fc2c3fb-df88-4418-b325-0372f66a1cb8.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,7fc2c3fb-df88-4418-b325-0372f66a1cb8.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=7fc2c3fb-df88-4418-b325-0372f66a1cb8</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Just finished with a client’s website <a href="http://www.wildwoodcampsites.com">www.wildwoodcampsites.com</a>,
I am pretty happy with it and so are they. 
</p>
        <p>
Few things that where fun was implementing a "<a href="http://www.wildwoodcampsites.com/dotnetnuke/Directions/tabid/225/Default.aspx">Get
Directions</a>," Map with Microsoft Virtual Earth and a Silverlight <a href="http://www.wildwoodcampsites.com/dotnetnuke/Attractions/tabid/227/Default.aspx">picture
viewer</a>. I have worked with the Google maps api in the past it wasn't bad, but
I hate the registration it makes it a pain to move and reuse. I found virtual Earth
API far superior with great examples. I was able to get something cool up and working
with little Java Script experience. The picture viewer I did not code from scratch,
dnntemplet.com was offering it for free as a Beta version; although it didn't work
I was able to fix it by digging around in the source code. I am really excited
to see what the web will look like coming up with Flex.org and Silverlight 2.0
</p>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=7fc2c3fb-df88-4418-b325-0372f66a1cb8" />
      </body>
      <title>Wildwood Campsites</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,7fc2c3fb-df88-4418-b325-0372f66a1cb8.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2008/06/12/WildwoodCampsites.aspx</link>
      <pubDate>Thu, 12 Jun 2008 17:13:29 GMT</pubDate>
      <description>&lt;p&gt;
Just finished with a client’s website &lt;a href="http://www.wildwoodcampsites.com"&gt;www.wildwoodcampsites.com&lt;/a&gt;,
I am pretty happy with it and so are they. 
&lt;/p&gt;
&lt;p&gt;
Few things that where fun was implementing a "&lt;a href="http://www.wildwoodcampsites.com/dotnetnuke/Directions/tabid/225/Default.aspx"&gt;Get
Directions&lt;/a&gt;," Map with Microsoft Virtual Earth and a Silverlight &lt;a href="http://www.wildwoodcampsites.com/dotnetnuke/Attractions/tabid/227/Default.aspx"&gt;picture
viewer&lt;/a&gt;. I have worked with the Google maps api in the past it wasn't bad, but
I hate the registration it makes it a pain to move and reuse. I found virtual Earth
API far superior with great examples. I was able to get something cool up and working
with little Java Script experience. The picture viewer I did not code from scratch,
dnntemplet.com was offering it for free as a Beta version; although it didn't work
I was able to fix it by&amp;nbsp;digging around in the source code. I am really excited
to see what the web will look like coming up with Flex.org and Silverlight 2.0
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=7fc2c3fb-df88-4418-b325-0372f66a1cb8" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,7fc2c3fb-df88-4418-b325-0372f66a1cb8.aspx</comments>
      <category>Projects</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=c6c56940-e799-4989-977b-a1d9e35cef0b</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,c6c56940-e799-4989-977b-a1d9e35cef0b.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,c6c56940-e799-4989-977b-a1d9e35cef0b.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=c6c56940-e799-4989-977b-a1d9e35cef0b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I love my job it's the best <a href="http://money.cnn.com/magazines/moneymag/bestjobs/2006/top50/index.html">job
in the America</a>.
</p>
        <img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=c6c56940-e799-4989-977b-a1d9e35cef0b" />
      </body>
      <title>I love my job</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,c6c56940-e799-4989-977b-a1d9e35cef0b.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2008/06/11/ILoveMyJob.aspx</link>
      <pubDate>Wed, 11 Jun 2008 20:46:04 GMT</pubDate>
      <description>&lt;p&gt;
I love my job it's the best &lt;a href="http://money.cnn.com/magazines/moneymag/bestjobs/2006/top50/index.html"&gt;job
in the America&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=c6c56940-e799-4989-977b-a1d9e35cef0b" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,c6c56940-e799-4989-977b-a1d9e35cef0b.aspx</comments>
      <category>Personal</category>
    </item>
    <item>
      <trackback:ping>http://thesprage.com/DasBlog/Trackback.aspx?guid=a2987fec-6dee-474d-815a-71e38011612b</trackback:ping>
      <pingback:server>http://thesprage.com/DasBlog/pingback.aspx</pingback:server>
      <pingback:target>http://thesprage.com/DasBlog/PermaLink,guid,a2987fec-6dee-474d-815a-71e38011612b.aspx</pingback:target>
      <dc:creator>Aaron Sprague</dc:creator>
      <wfw:comment>http://thesprage.com/DasBlog/CommentView,guid,a2987fec-6dee-474d-815a-71e38011612b.aspx</wfw:comment>
      <wfw:commentRss>http://thesprage.com/DasBlog/SyndicationService.asmx/GetEntryCommentsRss?guid=a2987fec-6dee-474d-815a-71e38011612b</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <title>Configuration System Failed to Initialize</title>
      <guid isPermaLink="false">http://thesprage.com/DasBlog/PermaLink,guid,a2987fec-6dee-474d-815a-71e38011612b.aspx</guid>
      <link>http://TheSprage.com/DasBlog/2008/05/23/ConfigurationSystemFailedToInitialize.aspx</link>
      <pubDate>Fri, 23 May 2008 19:14:46 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Your application
contains User Scope Settings and you receive the exception,&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;em&gt;“Configuration system failed
to initialize” &lt;/em&gt;when attempting to retrieve these settings.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;strong&gt;Solution&lt;/strong&gt;: The settings
file has been corrupted and is unreadable. Close or stop your application and &lt;font color=#ff0000&gt;delete&lt;/font&gt; the &lt;font color=#ff0000&gt;user.config&lt;/font&gt; file.
The file is located at:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;C:\Documents and Settings\[UserName]\Local
Settings\Application Data\[AppCompany]\[AppName] \[AppVersion]\ &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If you are in Visual Studio you
can easily find the exact file that is causing the problem by viewing the details
and drilling down to the inner exception to find the file name.&lt;/font&gt;
&lt;/p&gt;
&lt;img src="http://thesprage.com/DasBlog/content/binary/exceptionDetails.png" border=0&gt;&lt;img src="http://thesprage.com/DasBlog/content/binary/viewDetail.png" border=0&gt;&lt;img width="0" height="0" src="http://thesprage.com/DasBlog/aggbug.ashx?id=a2987fec-6dee-474d-815a-71e38011612b" /&gt;</description>
      <comments>http://thesprage.com/DasBlog/CommentView,guid,a2987fec-6dee-474d-815a-71e38011612b.aspx</comments>
      <category>C#</category>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>