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

<channel>
	<title>Eric Fickes &#187; C#</title>
	<atom:link href="http://ericfickes.com/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericfickes.com</link>
	<description>Design minded Internet Programmer</description>
	<lastBuildDate>Fri, 28 Oct 2011 04:14:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Injecting javascript into asp.net via code</title>
		<link>http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/</link>
		<comments>http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 04:13:50 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[aspx]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[Literal]]></category>
		<category><![CDATA[msdn]]></category>
		<category><![CDATA[postback]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1903</guid>
		<description><![CDATA[Microsoft has a great MSDN article on using javascript along asp.net, but they didn&#8217;t mention a technique I like to use, put it in a Literal control.  While there are many ways to add javascript to a page, I find &#8230; <a href="http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Microsoft has a great MSDN article on <a title="Several other techniques for using javascript with asp.net" href="http://msdn.microsoft.com/en-us/library/aa479011.aspx" target="_blank">using javascript along asp.net</a>, but they didn&#8217;t mention a technique I like to use, put it in a <a title="ASP.NET Literal Class" href="http://msdn.microsoft.com/en-us/library/f0aw4d5w.aspx" target="_blank">Literal</a> control.  While there are many ways to add javascript to a page, I find putting the javascript in a literal much less stressful.  Using a Literal control placeholder is also a good way to add messaging to a page after postback, but we&#8217;re just going to look at adding javascript.</p>
<p>Let&#8217;s take a simple example.  Say you&#8217;ve got a comment form that you want to auto close, or reload after the form was posted.  Below is a simple single file style asp.net page with a simple javascript function that reloads this page.</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;%@ Page Language=&quot;C#&quot; %&gt;

&lt;script runat=&quot;server&quot;&gt;
/// &lt;summary&gt;
/// &lt;/summary&gt;
/// &lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;
/// &lt;param name=&quot;e&quot;&gt;&lt;/param&gt;
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {

    }
}

///////////////////////////////////////////////////////////////////////////////
/// Do stuff with the form data, then refresh page using javascript
protected void submitComments(object sender, EventArgs e)
{

    try
    {
	//
	// do stuff here
	//

	// set javascript timer to reload page afer 3 seconds
	js_target.Text = &quot;setTimeout('reload()', 3000);&quot;;

    }
    catch (Exception exc)
    {
        Response.Write( &quot;ERROR : &quot; + exc.Message );
    }
}
&lt;/script&gt;

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
	&lt;title&gt;Comments&lt;/title&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	// page reload helper
	function reload() {
		document.location.replace( document.location );
	}
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;form id=&quot;form1&quot; runat=&quot;server&quot; method=&quot;post&quot;&gt;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;asp:Literal runat=&quot;server&quot; id=&quot;js_target&quot; /&gt;&lt;/script&gt;

	Comments
	&lt;asp:TextBox runat=&quot;server&quot; ID=&quot;comment_box&quot; Width=&quot;200&quot; /&gt;
	&lt;br&gt;&lt;br&gt;

	Your name
	&lt;asp:TextBox runat=&quot;server&quot; ID=&quot;fullname&quot; Width=&quot;200&quot; /&gt;
	&lt;br&gt;&lt;br&gt;
	&lt;asp:Button runat=&quot;server&quot; ID=&quot;submit_btn&quot; onclick=&quot;submitComment&quot; Text=&quot;submit&quot; /&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>If you look just under the form tag you&#8217;ll see the key to this technique, an asp literal wrapped by an open and close script tag.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;&lt;asp:Literal runat=&quot;server&quot; id=&quot;js_target&quot; /&gt;&lt;/script&gt;
</pre>
<p>When you load your page and view the source you&#8217;ll just see an empty script tag, so it shouldn&#8217;t interfere with the execution or rendering of your page.</p>
<p>The last part of this technique is simple, in your server code just set your Literal control&#8217;s .Text value to your javascript code.  In this case when I post my comment form, after handling the input data I display a thank you message, then set some javascript to reload the page.</p>
<pre class="brush: csharp; title: ; notranslate">
ltl_js.Text = &quot;setTimeout('reload()', 3000);&quot;;
</pre>
<p>That&#8217;s all there is to it.  Drop a literal in an empty script block and BAM!, you have an easy way to add javascript to your asp.net page.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2011/02/injecting-javascript-into-asp-net-via-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Endless Mural wins FWA site of the day</title>
		<link>http://ericfickes.com/2010/11/endless-mural-wins-fwa-site-of-the-day/</link>
		<comments>http://ericfickes.com/2010/11/endless-mural-wins-fwa-site-of-the-day/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 06:55:25 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[award]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[beauty of the web]]></category>
		<category><![CDATA[branden hall]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[endlessmural]]></category>
		<category><![CDATA[FixDBLib]]></category>
		<category><![CDATA[generative art]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ie9]]></category>
		<category><![CDATA[joshua davis]]></category>
		<category><![CDATA[okapi]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1750</guid>
		<description><![CDATA[I&#8217;m ecstatic to announce the Endless Mural HTML5 project has won the prestigious FWA Site of the day award.  While this isn&#8217;t the first project I&#8217;ve worked on that has won the FWA, it is the first NON-Flash, HTML5 and &#8230; <a href="http://ericfickes.com/2010/11/endless-mural-wins-fwa-site-of-the-day/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_1822" class="wp-caption aligncenter" style="width: 610px"><a title="Endless Mural wins FWA SOTD, and we didn't even use Flash!" href="http://www.thefwa.com/site/the-endless-mural" target="_blank"><img class="size-full wp-image-1822 " style="border: 0px initial initial;" title="Endless Mural &gt; FWA site of the day" src="http://ericfickes.com/wp-content/uploads/2010/11/endlessmural-fwa.png" alt="FWA Site of the day &gt; Nov 22 2010" width="600" height="395" /></a><p class="wp-caption-text">Endless Mural wins FWA for HTML5</p></div>
<p>I&#8217;m ecstatic to announce the Endless Mural HTML5 project has won the prestigious <a title="Endless Mural wins the FWA Site of the day award" href="http://www.thefwa.com/site/the-endless-mural" target="_blank">FWA Site of the day award</a>.  While this isn&#8217;t the first project I&#8217;ve worked on that has <a title="Wiretree.com has kicked out a handful of FWAs.  Because they're that good" href="http://thefwa.com/profile/wiretree" target="_blank">won the FWA</a>, it is the first NON-Flash, HTML5 and ASP.NET project that has.  No Flash, and we still got the FWA site of the day, SWEET!.</p>
<h1>I need a SQL Ninja</h1>
<div>
<p>On Friday July 23rd I got the chance to skateboard with my good buddy and personal hero <a title="Joshua Davis Studios" href="http://joshuadavis.com" target="_blank">Joshua Davis</a>.  I feel lucky being able to say we&#8217;ve actually been skating together for a few years now, but this was certainly my favorite session we&#8217;ve had so far.  We started out at <a title="Broomfield Skatepark pictures on sk8colorado.blogspot.com" href="http://sk8colorado.blogspot.com/2010/07/broomfield-skatepark.html" target="_blank">Broomfield&#8217;s new park</a> because I had to show Josh the new mini bowl.</p>
<div id="attachment_1762" class="wp-caption aligncenter" style="width: 235px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/josh-eric-skate-checkin.jpg" rel="lightbox[1750]"><img class="size-medium wp-image-1762" title="Joshua Davis and Eric Fickes" src="http://ericfickes.com/wp-content/uploads/2010/11/josh-eric-skate-checkin-225x300.jpg" alt="skate or fry" width="225" height="300" /></a><p class="wp-caption-text">Two hot dogs ( http://yfrog.com/n3hs5j )</p></div>
<p>After Broomfield we made a quick stop for lunch, and then on to the Denver Skatepark in downtown.  It was great showing Josh the lines at my hometown skateparks, as well as a few radical maneuvers.</p>
<p>Now that Josh had seen my non-frontside airs, it was time to wrap things up.  As we were saying our goodbyes I decided to ask about work.  Normally I don&#8217;t talk about work at the skatepark, but I was thinking about going indie again, and figured what the heck.</p>
<p>Turns out Josh was about to start a project for <a title="Endless Mural &gt; Part of the IE9 launch project 'Beauty of the Web'" href="http://www.beautyoftheweb.com" target="_blank">Microsoft</a> ( WHAT?!?! ) and he need to &#8220;find a SQL Ninja&#8221; ( DOUBLE WHAT?!?! ).  I&#8217;ve been actively working with MS SQL Server since version 6.5, so I let him know he was looking at his sql ninja.  Josh was interested, but gave me the &#8220;just cause we&#8217;re bros, doesn&#8217;t put you on the team&#8221;.</p>
<h1>HTML5 drawing tool in one night</h1>
<p>Driving home from the skatepark I called my wife super giddy.  &#8221;Honey, I may be going indie sooner than we planned&#8221;.  I gave her the rundown of the potential project Josh and I just spoke about, and let her know I had some homework to do.  That night I went home and built out a distant cousin of the endless mural project.</p>
<div style="clear: both;">
<div id="attachment_1781" class="wp-caption alignleft" style="width: 243px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/efdraw-html5.png" rel="lightbox[1750]"><img class="size-medium wp-image-1781" title="EFDRAW" src="http://ericfickes.com/wp-content/uploads/2010/11/efdraw-html5-233x300.png" alt="You can draw with HTML5" width="233" height="300" /></a><p class="wp-caption-text">HTML5 drawing tool powered by ASPX and MySQL</p></div>
<div id="attachment_1782" class="wp-caption alignright" style="width: 244px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/efdraw-skull.png" rel="lightbox[1750]"><img class="size-medium wp-image-1782" title="draw save and share" src="http://ericfickes.com/wp-content/uploads/2010/11/efdraw-skull-234x300.png" alt="sloppy html5 drawing" width="234" height="300" /></a><p class="wp-caption-text">HTML5 drawing tool powered by ASPX and MySQL</p></div>
</div>
</div>
<p><a title="I built an HTML5 drawing tool overnight" href="http://fickii.com/efdraw/" target="_blank">EFDRAW</a> is a really simple HTML5 drawing tool powered by ASP.NET and MySQL.  It has most of the features of the mural ( draw, save, replay, share ), but this was only a proof of concept.  This was my first dive into HTML5 development, and it&#8217;s pretty sweet.</p>
<p><object id="stU0hSREFIR1FfQFVcU1tYV1dV" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://www.screentoaster.com/swf/STPlayer.swf" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="flashvars" value="video=stU0hSREFIR1FfQFVcU1tYV1dV" /><param name="src" value="http://www.screentoaster.com/swf/STPlayer.swf" /><param name="allowfullscreen" value="true" /><embed id="stU0hSREFIR1FfQFVcU1tYV1dV" type="application/x-shockwave-flash" width="425" height="344" src="http://www.screentoaster.com/swf/STPlayer.swf" flashvars="video=stU0hSREFIR1FfQFVcU1tYV1dV" allowscriptaccess="always" allowfullscreen="true" data="http://www.screentoaster.com/swf/STPlayer.swf"></embed></object></p>
<p>If you&#8217;re interested in HTML5 drawing tools, feel free to play around with <a title="I bult an HTML5 drawing tool overnight" href="http://fickii.com/efdraw/" target="_blank">EFDRAW</a>, view source, help yourself.</p>
<h1>There&#8217;s one thing&#8230;. Azure</h1>
<p>A few days after building EFDRAW my band <a href="http://twitter.com/#!/thecompilers/status/20575513102" target="_blank">The Compilers</a> played at Ignite Denver 7.  Right before starting our first set my phone rings and it&#8217;s Josh!  OMG I think, this is either the &#8220;you got it&#8221; or the &#8220;sorry bud, we&#8217;ll skate again&#8221; call.  I decide to take the call even though we were locked and loaded, standing on stage with our gear waiting for the house music to go down.  I answer and it&#8217;s Josh, but not the usual hyperactive Josh I&#8217;m accustomed to.  I ask about the gig and he says &#8220;Well, there&#8217;s one thing.  We have to use Azure&#8221;.</p>
<p>I let him know I&#8217;ve worked with other cloud platforms already, just not Microsoft&#8217;s.  So we talk a little more and Josh passes the phone to Branden so we can talk 0s and 1s.  After talking to Branden &#8220;mega brain&#8221; Hall for a few minutes he asks if I can do this.  I tell him yes, he says yes, I get excited, he gets excited.  Branden passed me back to Josh and I&#8217;m in shock at this point.</p>
<h1>Now the boring stuff</h1>
<p>So that&#8217;s the story of how I landed the Endless Mural gig, now the boring technical details.</p>
<p>The drawing portion of the mural was built by <a title="Branden Hall's personal website" href="http://waxpraxis.org" target="_blank">Branden Hall</a> of <a title="Automata Studios :: Branden Hall's software company" href="http://automatastudios.com" target="_blank">Automata Studios</a>.  I did the backend which is made up of ASP.NET ( C# ), SQL Azure, and Windows Azure.  We&#8217;re using Azure blob storage to save and serve up the PNGs created at the mural.  To access SQL server, I wrote a super lightweight data access library using all native .NET.</p>
<p>For the most part the backend was very much like every other .NET SQL Server project I build, but Azure did introduce a few gotchas.</p>
<ol>
<li>The publishing and management of your cloud site mainly goes through <a title="Windows Azure control panel" href="http://windows.azure.com/" target="_blank">http://windows.azure.com/</a>.</li>
<li>You can deploy your site from Visual Studio which proved to be immensely helpful after my Azure deploy package grew beyond 100 MB.</li>
<li>You can access SQL Azure directly from SQL 2008+ management tools.</li>
<li>You can not FTP single files up to the cloud, only the full ball of wax.</li>
<li>You can still use web.config for configuration storage, but Azure also has it&#8217;s own version of web.config.</li>
<li>If you need to edit your settings after deploying, store those settings in your Azure service config, not web.config</li>
<li>SQL Azure requires all tables to use clustered indexes</li>
<li>SQL Azure has it&#8217;s own TSQL restrictions ( not many, but be aware )</li>
<li>On average, doing a full republish of an Azure site took a full hour.</li>
</ol>
<p>I could probably ramble on and on about Azure, but I&#8217;ll cut it short.  If you happen to have any questions about Azure feel free to hit me up or leave a comment.  I would also like to say that I <em>know</em> Microsoft is and has been actively improving Azure by the day.  The state of Azure today is most likely even better than when we built the mural, so my experiences may not be your own.</p>
<h1 style="font-family: Georgia, 'Bitstream Charter', serif; color: #000000; line-height: 1.5em; font-size: 2.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; font-weight: normal;">The toolbox</h1>
<ul>
<li>Windows Azure SDK</li>
<li>Windows Azure Platform Kit June 2010</li>
<li>Windows Azure Tools for Visual Studio ( v1.2 )</li>
<li>Microsoft Seadragon Ajax library</li>
<li>Microsoft SQL Server 2008 R2</li>
<li>Microsoft SQL Azure</li>
<li>ASP.NET 4 ( C# )</li>
<li>Windows Azure</li>
<li>Azure Storage Explorer</li>
</ul>
<p>Here is the <a title="The Endless Mural toolbox" href="http://automatastudios.com/the-endless-mural-toolbox/" target="_blank">toolbox that Branden used on the client side</a>.</p>
<h1>Hotlinks from the server guy</h1>
<ul>
<li><a title="Developoing and Deploying with SQL Azure" href="http://social.technet.microsoft.com/wiki/contents/articles/developing-and-deploying-with-sql-azure.aspx" target="_blank">Developing and Deploying with SQL Azure</a></li>
<li><a title="SQL Azure T-SQL reference" href="http://msdn.microsoft.com/en-us/library/ee336281.aspx" target="_blank">SQL Azure DB T-SQL reference</a></li>
<li><a title="Azure w/Intellitrace" href="http://blogs.msdn.com/b/jnak/archive/2010/06/07/using-intellitrace-to-debug-windows-azure-cloud-services.aspx" target="_blank">Azure w/Intellitrace</a></li>
<li><a title="How to upload download Page Blobs ( Windows Azure )" href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/11/using-windows-azure-page-blobs-and-how-to-efficiently-upload-and-download-page-blobs.aspx" target="_blank">Using Windows Azure Page Blobs .. how to upload / download blobs</a></li>
<li><a title="Azure Deep Dive : Working with configuration" href="http://azure.snagy.name/blog/?p=176" target="_blank">Windows Azure Deep Dive: Working with Configuration</a></li>
<li><a title="Getting started with Seadragon AJAX" href="http://www.seadragon.com/developer/ajax/getting-started/" target="_blank">Seadragon Ajax &#8211; Getting Started</a></li>
<li><a title="Creating Deep Zoom content" href="http://www.silverlight.net/learn/whitepapers/deep-zoom-tools/" target="_blank">Creating Content : Deep Zoom Tools</a></li>
<li><a title="Deep Zoom Blog" href="http://blogs.msdn.com/b/lutzg/" target="_blank">Deep Zoom Blog</a></li>
<li><a title="How to create a Twitter TWEET button" href="http://dev.twitter.com/pages/tweet_button" target="_blank">Twitter TWEET Button</a></li>
</ul>
<h1>It&#8217;s a wrap</h1>
<p>This project was the most concentrated five weeks I&#8217;ve had in quite some time.  I still wonder if we were only given five weeks because this was an HTML5 project.  Either way, the mural team made some magic and now you can too.  If you&#8217;re like me and just want to doodle, <a href="http://endlessmural.com/" target="_blank">go make some art at the mural</a>.  If you&#8217;re a developer interested in HTML5 and Javascript programming, go check out <a title="OKAPI.js, the javascript behind endlessmural.com" href="http://www.okapijs.org/" target="_blank">the javascript library okapi.js</a> which Branden Hall recently open sourced.</p>
<p>Also be sure to visit the magicians, I mean artists, who made the amazing patterns you see when using the mural.  I&#8217;m a life long doodler, but can&#8217;t art myself out of a paper bag.</p>
<div>
<h2 style="text-align: center;"><a title="Evgeny Kiselev" href="http://www.ekiselev.com" target="_blank">Evgeny Kiselev</a></h2>
<div id="attachment_1839" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/evgeny-kiselev.jpg" rel="lightbox[1750]"><img class="size-medium wp-image-1839 " title="evgeny-kiselev" src="http://ericfickes.com/wp-content/uploads/2010/11/evgeny-kiselev-300x158.jpg" alt="Evgeny Kiselev - www.ekiselev.com" width="300" height="158" /></a><p class="wp-caption-text">Evgeny Kiselev - www.ekiselev.com</p></div>
</div>
<div>
<h2 style="text-align: center;"><a title="Guilherme Marconi" href="http://brain.marconi.nu" target="_blank">Guilherme Marconi</a></h2>
<div id="attachment_1840" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/guilherme-marconi.jpg" rel="lightbox[1750]"><img class="size-medium wp-image-1840" title="guilherme-marconi" src="http://ericfickes.com/wp-content/uploads/2010/11/guilherme-marconi-300x168.jpg" alt="Guilherme Marconi - brain.marconi.nu" width="300" height="168" /></a><p class="wp-caption-text">Guilherme Marconi - brain.marconi.nu</p></div>
</div>
<div>
<h2 style="text-align: center;"><a title="Joshua Davis" href="http://www.joshuadavis.com" target="_blank">Joshua Davis</a></h2>
<div id="attachment_1841" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/joshua-davis.jpg" rel="lightbox[1750]"><img class="size-medium wp-image-1841" title="joshua-davis" src="http://ericfickes.com/wp-content/uploads/2010/11/joshua-davis-300x225.jpg" alt="Joshua Davis - www.joshuadavis.com" width="300" height="225" /></a><p class="wp-caption-text">Joshua Davis - www.joshuadavis.com</p></div>
</div>
<div>
<h2 style="text-align: center;"><a title="Matt Lyon" href="http://www.c8six.com" target="_blank">Matt Lyon</a></h2>
<div id="attachment_1842" class="wp-caption aligncenter" style="width: 287px"><a href="http://ericfickes.com/wp-content/uploads/2010/11/matt-lyon.jpg" rel="lightbox[1750]"><img class="size-medium wp-image-1842" title="matt-lyon" src="http://ericfickes.com/wp-content/uploads/2010/11/matt-lyon-277x300.jpg" alt="Matt Lyon - www.c8six.com" width="277" height="300" /></a><p class="wp-caption-text">Matt Lyon - www.c8six.com</p></div>
<p>And lastly I put up a photo album on Facebook of all my camera phone pictures from the trip.  <a title="camera phone pictures from my trip to SF to launch endlessmural.com" href="http://www.facebook.com/album.php?aid=220650&amp;id=500552652&amp;l=fe921f2bc4" target="_blank">Check out the endlessmural photo album</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/11/endless-mural-wins-fwa-site-of-the-day/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upload to ASP.NET from HTML, Flash, or Flex clients</title>
		<link>http://ericfickes.com/2010/08/upload-to-asp-net-from-html-flash-or-flex-clients/</link>
		<comments>http://ericfickes.com/2010/08/upload-to-asp-net-from-html-flash-or-flex-clients/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 03:18:49 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[flash platform]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[asp.net upload]]></category>
		<category><![CDATA[flash upload]]></category>
		<category><![CDATA[flex upload]]></category>
		<category><![CDATA[html upload]]></category>
		<category><![CDATA[NETWORK SERVICE]]></category>
		<category><![CDATA[Request.Files]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[upload handler]]></category>
		<category><![CDATA[uploader]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1625</guid>
		<description><![CDATA[File uploading has been a hot topic during my time as an internet programmer.  In the classic ASP days this was a bit of a task to build and get correct.  Nowadays both Adobe&#8217;s Coldfusion and Microsoft&#8217;s ASP.NET both have &#8230; <a href="http://ericfickes.com/2010/08/upload-to-asp-net-from-html-flash-or-flex-clients/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>File uploading has been a hot topic during my time as an internet programmer.  In the classic ASP days this was a bit of a task to build and get correct.  Nowadays both <a title="Coldfusion makes file handling simple with &lt;CFFILE /&gt;" href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fa1.html" target="_blank">Adobe&#8217;s Coldfusion</a> and <a title="ASP.NET has the FileUpload class" href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx" target="_blank">Microsoft&#8217;s ASP.NET</a> both have built in file uploader tags ( server controls ) that handle this with ease.</p>
<p>This is great, but what happens when you have a mixed bag of clients that all need to upload to the same location?  Sometimes I work with completely ASP.NET or CF web apps, but more often than not I&#8217;m dealing with Flash clients as well as HTML clients.</p>
<p>Recently I ran into this upload scenario and built this simple ASP.NET uploader script.  This feels a bit old school since it uses .NET&#8217;s built in Request.Files collection, instead of a fancy new &#8216;all in one&#8217; server control, but I actually prefer this method.</p>
<p>Here&#8217;s all you need :</p>
<pre class="brush: csharp; title: ; notranslate">
// Check for posted files
for (int xx = 0; xx &lt; Request.Files.Count; xx++)
{
    // UPLOAD FILE
    HttpPostedFile _file = Request.Files[xx];

    // make sure we're not finding empty filename
    if (_file.FileName.Trim() != string.Empty)
    {
        // NOTE : IE &lt; 8 reports full path of file, not just filename
        // Parse out filename, then create full upload path
        var fileName = _file.FileName;
        if (fileName.Contains(&quot;\\&quot;))
        {
            var aFile = fileName.Split('\\');
            fileName = aFile[ aFile.Length - 1 ].ToString();
        }

        // create full save path for uploaded file
        var full_file_path = Server.MapPath( UP_FOLDER ) + &quot;\\&quot; + fileName;

        try
        {
            // save file to server
            _file.SaveAs(full_file_path);
        }
        catch (Exception exc)
        {
            var emsg = &quot;Unable to upload file : &quot; + exc.Message;

            Response.Write( emsg );
            Response.Flush();
            Response.End();
        }

        // show result
        Response.Write( _file.FileName + &quot; uploaded! &lt;br&gt;&quot; );
    }
}
</pre>
<p>That&#8217;s all there is to it codewise.  Before using this code you will need to give the NETWORK SERVICES user write permissions to your upload folder.  Other than that, that&#8217;s all she wrote!</p>
<p><a title="ASP.NET uploader, HTML upload, Flash upload, and Flex upload clients" href="http://ericfickes.com/code/aspxuploader.zip" target="_blank">Here is a zip of all the code for you to download</a>.</p>
<p>Inside this zip you will find :</p>
<ul>
<li><strong>flashclient.fla</strong> &#8211; Flash upload client ( <em>*be sure to update the upload path before building</em> )</li>
<li><strong>flexclient.mxml</strong> &#8211; Flex upload client ( <em>*also update upload path before building</em> )</li>
<li><strong>uploader.aspx </strong>- ASP.NET file upload handler</li>
<li><strong>uploadform.html </strong>- sample HTML upload form ( <em>again, update path</em> )</li>
</ul>
<p>Hope somebody finds this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/08/upload-to-asp-net-from-html-flash-or-flex-clients/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to show line numbers in Visual Studio 2010</title>
		<link>http://ericfickes.com/2010/08/how-to-show-line-numbers-in-visual-studio-2010/</link>
		<comments>http://ericfickes.com/2010/08/how-to-show-line-numbers-in-visual-studio-2010/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 19:11:35 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[line numbers]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[visual studio options]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1614</guid>
		<description><![CDATA[I&#8217;ve been using Visual Studio since forever, yet it always takes me a while to remember how to show line numbers.  It&#8217;s especially hard to remember after a fresh install of Visual Studio.  Assuming you have it installed and open, &#8230; <a href="http://ericfickes.com/2010/08/how-to-show-line-numbers-in-visual-studio-2010/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Visual Studio since forever, yet it always takes me a while to remember how to show line numbers.  It&#8217;s especially hard to remember after a fresh install of Visual Studio.  Assuming you have it installed and open, here&#8217;s how to display line numbers in your code.</p>
<ol>
<li>Click Tools in the menu bar</li>
<li>Options</li>
<li>Expand Text Editor ( in the popup window )</li>
<li>Click &#8216;All Languages&#8217;</li>
<li>Check the &#8216;Line numbers&#8217; box under the Display heading ( on the right )</li>
<li>Click OK</li>
<li>Happy Happy Joy Joy!</li>
</ol>
<p><a href="http://ericfickes.com/wp-content/uploads/2010/08/show-line-number-visual-studio-2010.png" rel="lightbox[1614]"><img class="aligncenter size-full wp-image-1615" title="Display Line numbers in Visual Studio 2010" src="http://ericfickes.com/wp-content/uploads/2010/08/show-line-number-visual-studio-2010.png" alt="How to Display Line numbers in Visual Studio 2010" width="784" height="848" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/08/how-to-show-line-numbers-in-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>DataBind a List of custom classes to an ASP:ListBox control</title>
		<link>http://ericfickes.com/2010/04/databind-a-list-of-custom-classes-to-an-asplistbox-control/</link>
		<comments>http://ericfickes.com/2010/04/databind-a-list-of-custom-classes-to-an-asplistbox-control/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 20:09:16 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[.NET framework]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[auto-implemented]]></category>
		<category><![CDATA[auto-implemented-properties]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[custom class]]></category>
		<category><![CDATA[DataBind]]></category>
		<category><![CDATA[DataSource]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[VO]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1415</guid>
		<description><![CDATA[Recently I was scratching my head at this error from the .NET Framework DataBinding: &#8216;MyApp.vo.customVO&#8217; does not contain a property with the name &#8216;Name&#8217; I was stumped because my custom VO class did in fact have a public property called &#8230; <a href="http://ericfickes.com/2010/04/databind-a-list-of-custom-classes-to-an-asplistbox-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I was scratching my head at this error from the .NET Framework</p>
<blockquote>
<h3><em><em>DataBinding: &#8216;MyApp.vo.customVO&#8217; does not contain a property with the name &#8216;Name&#8217;</em></em></h3>
</blockquote>
<p>I was stumped because my custom VO class did in fact have a public property called Name.  After many trials and tribulations I figured out that .NET didn&#8217;t like how I structured my custom class.</p>
<p>Here is what my original custom class looked like.</p>
<pre class="brush: csharp; title: ; notranslate">
namespace MyApp.vo
{
    public class customVO
    {
        public Int32 id  = 0;
        public DateTime time  = new DateTime();
        public string Name  = string.Empty;
        public string DeviceType  = string.Empty;
        public string ObjectIDs  = string.Empty;
    }
}
</pre>
<p>Luckily I have <a title="JetBrain's ReSharper is a must have for any .NET developer" href="http://www.jetbrains.com/resharper/" target="_blank">JetBrains ReSharper</a> installed, and it suggested using C#&#8217;s <a href="http://msdn.microsoft.com/en-us/library/bb384054.aspx" target="_blank">Auto-Implemented properties</a>.  This is the one thing I hadn&#8217;t thought about trying, and it ended up being the fix!  My new custom VO class now looks like this.</p>
<pre class="brush: csharp; title: ; notranslate">
namespace MyApp.vo
{
    public class customVO
    {
        public Int32 id { get; set; }
        public DateTime time { get; set; }
        public string DeviceType { get; set; }
        public string ObjectIDs { get; set; }
        public string Name { get; set; }
    }
}
</pre>
<p>So if you find yourself running into this error while trying to DataBind a collection of custom classes to a ListBox or similar control, have a look at your custom class and see if you can convert it over to using auto-implement properties as well.</p>
<p>Now I&#8217;m not suggesting this is the only way to DataBind a List of custom classes to a ListBox, but it solved my problem and let me do direct databinding from my service call without having to do any pre-processing on my list.</p>
<p>Hope this helps someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/04/databind-a-list-of-custom-classes-to-an-asplistbox-control/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to TWEET from a SQL CLR Stored Procedure</title>
		<link>http://ericfickes.com/2010/03/how-to-tweet-from-a-sql-crl-stored-procedure/</link>
		<comments>http://ericfickes.com/2010/03/how-to-tweet-from-a-sql-crl-stored-procedure/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 01:10:58 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[tsql]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[.net assembly]]></category>
		<category><![CDATA[.net Common Language Runtime]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[CLR SPROC]]></category>
		<category><![CDATA[sproc]]></category>
		<category><![CDATA[sql server 2005]]></category>
		<category><![CDATA[stored procedure]]></category>
		<category><![CDATA[tweet]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1133</guid>
		<description><![CDATA[Here&#8217;s another SQL Server 2005 geek out moment, a CLR SPROC that tweets to Twitter. Big shoutout to Danny Battison for sharing the C# code to post to Twitter. This is what got me started on the C# side of &#8230; <a href="http://ericfickes.com/2010/03/how-to-tweet-from-a-sql-crl-stored-procedure/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another SQL Server 2005 geek out moment, a CLR SPROC that tweets to Twitter.  Big shoutout to <a title="Danny Battison is a C# rocker!" href="http://www.dreamincode.net/code/snippet2556.htm" target="_blank">Danny Battison for sharing the C# code to post to Twitter</a>.  This is what got me started on the C# side of things.  Also, you can skip all my ramblings here and just <a title="CLR SPROC &gt; Tweetsproc sample code" href="http://ericfickes.com/code/tweetsproc.zip" target="_blank">download code here</a> and fire it up.  The zip file contains all the source code, the compiled assembly file, and install.sql that shows you how to hook this up.</p>
<p>Being the SQL junky that I am, I was interested in trying out SQL Server&#8217;s new  <a title="CLR Stored Procedures on MSDN" href="http://msdn.microsoft.com/en-us/library/ms131094.aspx" target="_blank">CLR Stored Procedures</a>.  A CLR sproc is a stored procedure that is able to use .net code that you&#8217;ve compiled into an assembly file.  For you classic ASP heads out there, think of the ASP page being the sproc, and the .net assembly being your COM object ( cringe, let&#8217;s talk about classic ASP ).  While there are plenty of great articles on <a title="Writing CLR Stored Procedures on SQLTEAM.com" href="http://www.sqlteam.com/article/writing-clr-stored-procedures-in-charp-introduction-to-charp-part-1" target="_blank">writing CLR stored procedures</a>, I&#8217;m going to breeze through the code that makes up this project.</p>
<h2>First make a .net class library that will be compiled into an assembly file.</h2>
<pre class="brush: csharp; title: ; notranslate">
using System;
using Microsoft.SqlServer.Server;
using System.Data.SqlTypes;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;

/// &lt;summary&gt;
/// This assembly will be used by a SQL2005 SPROC to communicate
/// with twitter.com
/// &lt;/summary&gt;
public sealed class tweetsproc
{
    /*
     * TWITTER CODE BORROWED FROM :
     *  http://www.dreamincode.net/code/snippet2556.htm
     *
     * A function to post an update to Twitter programmatically
     * Author: Danny Battison
     * Contact: gabehabe@hotmail.com
     */

    /// &lt;summary&gt;
    /// Post an update to a Twitter acount
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;username&quot;&gt;The username of the account&lt;/param&gt;
    /// &lt;param name=&quot;password&quot;&gt;The password of the account&lt;/param&gt;
    /// &lt;param name=&quot;tweet&quot;&gt;The status to post&lt;/param&gt;
    [Microsoft.SqlServer.Server.SqlProcedure(Name = &quot;PostTweet&quot;)]
    //public static void PostTweet( string username, string password, string tweet)
    public static void PostTweet(   SqlString username,
                                    SqlString password,
                                    SqlString tweet)
    {
        try
        {
            // encode the username/password
            string user = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username.ToString() + &quot;:&quot; + password.ToString()));
            // determine what we want to upload as a status
            byte[] bytes = System.Text.Encoding.ASCII.GetBytes(&quot;status=&quot; + tweet.ToString());

            // Create a WebPermission.
            WebPermission myWebPermission1 = new WebPermission();

            // Allow Connect access to the specified URLs.
            myWebPermission1.AddPermission(NetworkAccess.Connect,new Regex(&quot;http://www\\.twitter\\.com/.*&quot;,
              RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline));

            myWebPermission1.Demand();

            // connect with the update page
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(&quot;http://twitter.com/statuses/update.xml&quot;);

            // set the method to POST
            request.Method = &quot;POST&quot;;
            request.ServicePoint.Expect100Continue = false; // thanks to argodev for this recent change!
            // set the authorisation levels
            request.Headers.Add(&quot;Authorization&quot;, &quot;Basic &quot; + user);
            request.ContentType = &quot;application/x-www-form-urlencoded&quot;;
            // set the length of the content
            request.ContentLength = bytes.Length;

            // set up the stream
            Stream reqStream = request.GetRequestStream();
            // write to the stream
            reqStream.Write(bytes, 0, bytes.Length);
            // close the stream
            reqStream.Close();

            // Let's get the Response from Twitter
            var webresp = request.GetResponse();
            // Let's read the Response
            var sread = new StreamReader( webresp.GetResponseStream() );

            // Use SqlContext to return data to the QueryAnalyzer results window
            SqlContext.Pipe.Send( sread.ReadToEnd() );

        }
        catch (Exception exc)
        {
            // send error back
            SqlContext.Pipe.Send(exc.Message);
        }
    }
}
</pre>
<h3>Here&#8217;s the app.config for this assembly.</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;trust level=&quot;Full&quot; processRequestInApplicationTrust=&quot;true&quot; originUrl=&quot;&quot; /&gt;
  &lt;/system.web&gt;
&lt;/configuration&gt;
</pre>
<p>Once you build this project, you should have your assembly ( tweetsproc.dll ) which will be used by your CLR Sproc.  Now it&#8217;s time to do some SQL server work.</p>
<h2>Enable CLR access for SQL server</h2>
<pre class="brush: sql; title: ; notranslate">
EXEC sp_configure @configname = 'clr enabled', @configvalue = 1
RECONFIGURE WITH OVERRIDE
GO
</pre>
<h2>Create the SQL Assembly</h2>
<pre class="brush: sql; title: ; notranslate">
CREATE ASSEMBLY tweetsproc_clr_assembly from 'C:\Users\eric\Desktop\blog\tweetsproc.dll'
WITH PERMISSION_SET = EXTERNAL_ACCESS
GO
</pre>
<h2>Create your SPROC</h2>
<pre class="brush: sql; title: ; notranslate">
CREATE PROC tweetsproc_tweet(	@username as nvarchar(50),
								@password as nvarchar(50),
								@tweet as nvarchar(140)
							)
AS
	-- [Assembly Name].[Class Name].[CLR function Name]
	EXTERNAL NAME tweetsproc_clr_assembly.tweetsproc.PostTweet
GO
</pre>
<h2>Tweet from a sproc</h2>
<pre class="brush: sql; title: ; notranslate">EXEC tweetsproc_tweet 'TwitterUsername', 'TwitterPassword', 'Hey @ericfickes, I''m tweeting from my database too!'</pre>
<p>Running this sproc returns the XML response from Twitter.</p>
<div id="attachment_1142" class="wp-caption aligncenter" style="width: 678px"><a href="http://ericfickes.com/wp-content/uploads/2010/03/tweetsproc_tweet-response1.png" rel="lightbox[1133]"><img class="size-full wp-image-1142" title="Twitter response from tweet sproc" src="http://ericfickes.com/wp-content/uploads/2010/03/tweetsproc_tweet-response1.png" alt="Twitter response from tweet sproc" width="668" height="719" /></a><p class="wp-caption-text">Tweetsproc returns the full Twitter response</p></div>
<p>That&#8217;s one sample CLR SPROC in the bank!  Feel free to download this code and try it out yourself.  I&#8217;d love to get some feedback on anybody looking to use this for real.  While tweeting from a stored procedure probably isn&#8217;t a hot topic for anybody, this is a nice teaser for what you can do with CLR sprocs now.</p>
<p><a title="CLR SPROC &gt; Tweetsproc sample code" href="http://ericfickes.com/code/tweetsproc.zip" target="_blank">Download code here.</a></p>
<p>Inside this zip you&#8217;ll find this.</p>
<ul>
<li>install.sql is everything you need to install this on your database</li>
<li>tweetsproc.dll is the twitter assembly used by the sproc</li>
<li>tweetsproc folder is the .net class library project</li>
</ul>
<div id="attachment_1139" class="wp-caption aligncenter" style="width: 289px"><a href="http://ericfickes.com/wp-content/uploads/2010/03/tweetsproczip.png" rel="lightbox[1133]"><img class="size-full wp-image-1139" title="Contents of tweetsproc.zip" src="http://ericfickes.com/wp-content/uploads/2010/03/tweetsproczip.png" alt="Contents of tweetsproc.zip" width="279" height="114" /></a><p class="wp-caption-text">Everything you need to get TWEETING from a sproc</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/03/how-to-tweet-from-a-sql-crl-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How to JOIN two tables using LINQ to SQL</title>
		<link>http://ericfickes.com/2010/02/how-to-join-two-tables-using-linq-to-sql/</link>
		<comments>http://ericfickes.com/2010/02/how-to-join-two-tables-using-linq-to-sql/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 01:27:53 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[join]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[linq to sql]]></category>
		<category><![CDATA[linqtosql]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1065</guid>
		<description><![CDATA[Wanted to share this since it gave me so much trouble figuring out.  It&#8217;s a simple SQL query ported to LINQ to SQL that joins two tables to return a filtered listed of data. Here are the tables from my &#8230; <a href="http://ericfickes.com/2010/02/how-to-join-two-tables-using-linq-to-sql/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wanted to share this since it gave me so much trouble figuring out.  It&#8217;s a simple SQL query ported to LINQ to SQL that joins two tables to return a filtered listed of data.</p>
<p>Here are the tables from my schema<br />
<a href="http://ericfickes.com/wp-content/uploads/2010/02/user-user_videos-video.png" rel="lightbox[1065]"><img class="aligncenter size-full wp-image-1068" title="My three user tables" src="http://ericfickes.com/wp-content/uploads/2010/02/user-user_videos-video.png" alt="user, user_video, video tables" width="465" height="317" /></a></p>
<p>Here is a basic SQL statement I could fire to retrieve my user videos.</p>
<pre class="brush: sql; title: ; notranslate">
select  *
from    video v, user_videos uv
where   v.vid = uv.vid
and     uv.uid = 2
</pre>
<p><a href="http://ericfickes.com/wp-content/uploads/2010/02/uservideos-SQL.png" rel="lightbox[1065]"><img class="aligncenter size-full wp-image-1069" title="Data returned from this SQL statement" src="http://ericfickes.com/wp-content/uploads/2010/02/uservideos-SQL.png" alt="User 2 has two videos" width="499" height="220" /></a><br />
Here is how you would run the same query using .net&#8217;s LINQ to SQL.</p>
<pre class="brush: csharp; title: ; notranslate">
// create DB connection
var db = new DBCONN();
// run query
List&lt;video&gt; uvids = (
    from c in db.video
    join o in db.user_videos
    on c.vid equals o.vid
    where o.uid == 2
    select c
).ToList();
</pre>
<p>This query differs slightly from the screenshot below because I used it in a WCF Service.</p>
<p><a href="http://ericfickes.com/wp-content/uploads/2010/02/uservideos-LINQTOSQL.png" rel="lightbox[1065]"><img class="aligncenter size-full wp-image-1070" title="Same query run via LINQ to SQL" src="http://ericfickes.com/wp-content/uploads/2010/02/uservideos-LINQTOSQL.png" alt="Same data, different retrieval method" width="488" height="419" /></a></p>
<p>The variable DBCONN is my database connection that I established when mapping my DB.  If you are not familiar with how to set this up, use the Visual Studio&#8217;s &#8220;Add the ADO.NET Entity Data Model&#8221; wizard.  With your .net project open, right click your project, left click on &#8220;Add the ADO.NET Entity Data Model&#8221;.  This wizard will walk you through setting up everything you need to setup your DB model file ( edmx ), as well as setting up your database connection and saving it in web.config.</p>
<p>Jesse Liberty did a <a title="ADO.NET DataEntities and WCF Feeding a Silverlight DataGrid" href="http://silverlight.net/learn/tutorials/adonetdataentities-cs/" target="_blank">simple tutorial that uses this wizard in a WCF service application</a>.</p>
<p>I hope this helps somebody out.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/02/how-to-join-two-tables-using-linq-to-sql/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Come have a 360Flex chat with me and Jun Heider</title>
		<link>http://ericfickes.com/2010/02/come-have-a-360flex-chat-when-me-and-jun-heider/</link>
		<comments>http://ericfickes.com/2010/02/come-have-a-360flex-chat-when-me-and-jun-heider/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 23:16:52 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[360flex]]></category>
		<category><![CDATA[adobeconnect]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[jun heider]]></category>
		<category><![CDATA[speaker]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1060</guid>
		<description><![CDATA[Chat is @ Thursday Feb 11th, 11:30am MST Jun Heider and myself will be talking to the 360&#124;Flex guys tomorrow about our session.  It’s actually going to be a back-to-back mega session comparing the latest and greatest on both the &#8230; <a href="http://ericfickes.com/2010/02/come-have-a-360flex-chat-when-me-and-jun-heider/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Chat is @ Thursday Feb 11th, 11:30am MST</strong></p>
<p><a href="http://www.iheartair.com/" target="_blank">Jun Heider</a> and myself will be talking to the 360|Flex guys tomorrow about our session.  It’s actually going to be a back-to-back mega session comparing the latest and greatest on both the Flash Platform and the Silverlight Platform.</p>
<p>Come check it out and feel free to ask questions…although for the good stuff you’ll have to wait until our talks. <img src="http://www.iheartair.com/wp-includes/images/smilies/icon_wink.gif" alt=";-)" /></p>
<p>Here’s the full details: <a href="http://www.360flex.com/blog/2010/02/360flex-speaker-chat-eric-fickes-and-jun-heider/">http://www.360flex.com/blog/2010/02/360flex-speaker-chat-eric-fickes-and-jun-heider/</a></p>
<p>I hope to see you online tomorrow or at 360 Flex in March.</p>
<div class="wp-caption aligncenter" style="width: 110px"><br />
<a href="http://360flex-ericf.eventbrite.com/" target="_blank"><br />
<img title="I'm speaking at 360 Flex 2010" src="http://ericfickes.com/code/badge-2.png" alt="I'm speaking at 360 Flex 2010" width="100" height="100" /></a><p class="wp-caption-text">I&#39;m speaking at 360 Flex 2010</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/02/come-have-a-360flex-chat-when-me-and-jun-heider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invalid token &#8216;void&#8217; in class, struct, or interface member declaration</title>
		<link>http://ericfickes.com/2010/02/invalid-token-void-in-class-struct-or-interface-member-declaration/</link>
		<comments>http://ericfickes.com/2010/02/invalid-token-void-in-class-struct-or-interface-member-declaration/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 23:32:34 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[ADO.NET Entity Data Model]]></category>
		<category><![CDATA[edmx]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[void]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=1041</guid>
		<description><![CDATA[EDIT : After finishing this post I ran into all sorts of other strange issues and restarted using a Web Appliction instead of a plain old Website.  Between IntelliSense not showing any classes, to project reference issues, I couldn&#8217;t figured it &#8230; <a href="http://ericfickes.com/2010/02/invalid-token-void-in-class-struct-or-interface-member-declaration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>EDIT :</h2>
<p>After finishing this post I ran into all sorts of other strange issues and restarted using a Web Appliction instead of a plain old Website.  Between <a title="IntelliSense is the BEST feature of all Visual Studios" href="http://en.wikipedia.org/wiki/IntelliSense" target="_blank">IntelliSense</a> not showing any classes, to project reference issues, I couldn&#8217;t figured it out in time.  I&#8217;m sure there&#8217;s a way, I just had to move on.  So maybe this ramble below will be helpful for someone.</p>
<address>EF</address>
<p>Just ran into something quirky with Visual Studio 2008&#8242;s new ADO.NET Entity Data Model wizard.  While working on an ASP.NET 3.5 website ( not a codebehind web application ) I was trying to get the ADO.NET Entity Data model wizard to work with MySQL and ran into a probable Visual Studio bug.  To sum up the issue, if you are going to add a new edmx to your project, do NOT save it to the App_Code folder initially.  Put it in your root folder, compile your project, then move the edmx where you&#8217;d like.</p>
<p>Assuming you&#8217;ve already created your ASP.NET Website project, here&#8217;s how you reproduce this issue.</p>
<h3 style="text-align: center;"><strong>Right click your project and left click &#8216;Add New Item&#8217;</strong></h3>
<p style="text-align: center;">
<div id="attachment_1042" class="wp-caption aligncenter" style="width: 390px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/vs1-AddNewItem.png" rel="lightbox[1041]"><img class="size-full wp-image-1042" title="Add New Item" src="http://ericfickes.com/wp-content/uploads/2010/02/vs1-AddNewItem.png" alt="Right click your project, left click Add New Item" width="380" height="225" /></a><p class="wp-caption-text">Add New Item</p></div>
<h3 style="text-align: center;"><strong>Select ADO.NET Entity Data Model, name it, select your language of preference</strong></h3>
<p style="text-align: center;">
<div id="attachment_1045" class="wp-caption aligncenter" style="width: 372px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/vs2-NewEDM1.png" rel="lightbox[1041]"><img class="size-full wp-image-1045" title="New ADO.NET Entity Data Model" src="http://ericfickes.com/wp-content/uploads/2010/02/vs2-NewEDM1.png" alt="New ADO.NET Entity Data Model" width="362" height="466" /></a><p class="wp-caption-text">ADO.NET Entity Data Model</p></div>
<h3 style="text-align: center;"><strong>Click Yes to the &#8216;Store in App_Code&#8217; prompt</strong></h3>
<p style="text-align: center;"><strong> </strong></p>
<div id="attachment_1046" class="wp-caption aligncenter" style="width: 500px"><strong><strong><a href="http://ericfickes.com/wp-content/uploads/2010/02/vs3-AddToAPP_CODE.png" rel="lightbox[1041]"><img class="size-full wp-image-1046" title="Place your edmx in App_Code folder" src="http://ericfickes.com/wp-content/uploads/2010/02/vs3-AddToAPP_CODE.png" alt="Place your edmx in App_Code folder" width="490" height="199" /></a></strong></strong><p class="wp-caption-text">Place file in &#39;App_Code&#39; folder</p></div>
<p><strong> </strong></p>
<h3 style="text-align: center;"><strong>Complete the new Entity Data Model wizard</strong></h3>
<p style="text-align: center;"><a title="ADO.NET DataEntities and WCF Feeding a Silverlight DataGrid" href="http://silverlight.net/learn/tutorials/adonetdataentities-cs/" target="_blank">See this tutorial if you have not done this before</a></p>
<p style="text-align: center;">
<p style="text-align: center;">
<h3 style="text-align: center;"><strong>Compile project after completing wizard</strong></h3>
<p style="text-align: left;">
<div id="attachment_1047" class="wp-caption aligncenter" style="width: 665px"><a href="http://ericfickes.com/wp-content/uploads/2010/02/vs4-BuildFail.png" rel="lightbox[1041]"><img class="size-full wp-image-1047" title="Invalid token 'void' in class, struct, or interface member declaration" src="http://ericfickes.com/wp-content/uploads/2010/02/vs4-BuildFail.png" alt="Invalid token 'void' in class, struct, or interface member declaration" width="655" height="399" /></a><p class="wp-caption-text">Invalid token &#39;void&#39; in class, struct, or interface member declaration</p></div>
<p style="text-align: left;">At this point your project should have a new.edmx file located inside of the App_Code folder, but the project won&#8217;t build without failing.  If you are stuck in this predicament, follow this workaround.</p>
<h3 style="text-align: center;"><strong>Move .edmx to root folder and rebuild</strong></h3>
<p style="text-align: left;"><strong> </strong></p>
<div id="attachment_1048" class="wp-caption aligncenter" style="width: 346px"><strong><strong><a href="http://ericfickes.com/wp-content/uploads/2010/02/vs5-move_edmx.png" rel="lightbox[1041]"><img class="size-full wp-image-1048" title="Move edmx to root and recompile, no errors!" src="http://ericfickes.com/wp-content/uploads/2010/02/vs5-move_edmx.png" alt="Move edmx to root and recompile, no errors!" width="336" height="468" /></a></strong></strong><p class="wp-caption-text">WORKAROUND : move edmx to root folder, then recompile</p></div>
<p><strong> </strong></p>
<p style="text-align: left;">
<p style="text-align: left;">After moving your edmx file to the root folder you should be able to compile without problem.  Assuming this solves your problem, you should be able to move your edmx file to the App_Code folder without problem.  Seems like an initial compile problem<strong>.<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2010/02/invalid-token-void-in-class-struct-or-interface-member-declaration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Find out why Visual Studio&#8217;s publish fails</title>
		<link>http://ericfickes.com/2009/08/find-out-why-visual-studios-publish-fails/</link>
		<comments>http://ericfickes.com/2009/08/find-out-why-visual-studios-publish-fails/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 18:51:26 +0000</pubDate>
		<dc:creator>Eric Fickes</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[build options]]></category>
		<category><![CDATA[msbuild]]></category>
		<category><![CDATA[output panel]]></category>
		<category><![CDATA[publish]]></category>
		<category><![CDATA[publish failed]]></category>
		<category><![CDATA[publish options]]></category>
		<category><![CDATA[verbosity]]></category>
		<category><![CDATA[visual studio 2008]]></category>

		<guid isPermaLink="false">http://ericfickes.com/?p=876</guid>
		<description><![CDATA[Have you ever had Visual Studio tell you your web application publish failed, but never gives you a reason why?  You&#8217;re not alone.  I&#8217;ve been putting off looking into this issue on a project and just found a way to &#8230; <a href="http://ericfickes.com/2009/08/find-out-why-visual-studios-publish-fails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever had Visual Studio tell you your web application publish failed, but never gives you a reason why?  You&#8217;re not alone.  I&#8217;ve been putting off looking into this issue on a project and just found a way to get my answer right away.</p>
<div id="attachment_877" class="wp-caption aligncenter" style="width: 276px"><a href="http://ericfickes.com/wp-content/uploads/2009/08/visual-studio-2008-publish-failed.gif" rel="lightbox[876]"><img class="size-full wp-image-877" title="visual-studio-2008-publish-failed" src="http://ericfickes.com/wp-content/uploads/2009/08/visual-studio-2008-publish-failed.gif" alt="Visual Studio 2008's Publish Failed message" width="266" height="112" /></a><p class="wp-caption-text">Visual Studio 2008&#39;s Publish Failed message</p></div>
<p>Here&#8217;s what you should do inside of Visual Studio to find out why your publish failed.</p>
<ol>
<li>Click the Tools menu &gt; then Options to bring up the Options dialog.</li>
<li>Expand &#8216;Projects and Solutions&#8217; on the left and click General</li>
<li>On General, click &#8216;Show Output window when build starts&#8217;</li>
<li>Now click on &#8216;Build and Run&#8217; in the left tree</li>
<li>Next select a value from the &#8216;MSBuild project build output verbosity&#8217; drop down menu</li>
<li>OK your way back to the main Visual Studio window</li>
<li>The next time you Build or Publish your project, you should see the Output panel pop up.  If your publish is still failing, the answer will live inside the Output panel</li>
</ol>
<p>Here&#8217;s a visual walkthrough of these instructions.</p>
<div id="attachment_878" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2009/08/show-output-window-when-build-starts.gif" rel="lightbox[876]"><img class="size-medium wp-image-878" title="show-output-window-when-build-starts" src="http://ericfickes.com/wp-content/uploads/2009/08/show-output-window-when-build-starts-300x172.gif" alt="Tools &gt; Options &gt; Projects and Solutions &gt; General" width="300" height="172" /></a><p class="wp-caption-text">Tools &gt; Options &gt; Projects and Solutions &gt; General</p></div>
<div id="attachment_879" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2009/08/msbuild-project-build-output-verbosity.gif" rel="lightbox[876]"><img class="size-medium wp-image-879" title="msbuild-project-build-output-verbosity" src="http://ericfickes.com/wp-content/uploads/2009/08/msbuild-project-build-output-verbosity-300x171.gif" alt="Tools &gt; Options &gt; Projects and Solutions &gt; Build and Run" width="300" height="171" /></a><p class="wp-caption-text">Tools &gt; Options &gt; Projects and Solutions &gt; Build and Run</p></div>
<div id="attachment_880" class="wp-caption aligncenter" style="width: 310px"><a href="http://ericfickes.com/wp-content/uploads/2009/08/visual-studio-output-panel.gif" rel="lightbox[876]"><img class="size-medium wp-image-880" title="visual-studio-output-panel" src="http://ericfickes.com/wp-content/uploads/2009/08/visual-studio-output-panel-300x102.gif" alt="Visual Studio's Output Panel" width="300" height="102" /></a><p class="wp-caption-text">Visual Studio&#39;s Output Panel</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ericfickes.com/2009/08/find-out-why-visual-studios-publish-fails/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

