<?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>Lazycoder &#187; C#</title>
	<atom:link href="http://www.lazycoder.com/weblog/category/technology/net/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazycoder.com/weblog</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 23:26:45 +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>Mocks versus stubs and fakes</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/</link>
		<comments>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 16:59:00 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[testing mocking]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/</guid>
		<description><![CDATA[I dislike using mocks I dislike using dynamic mocking/stubbing frameworks. because it means my tests have an extra dependency beyond just the SUT (System Under Test). I often find myself spending more time getting the mock to work correctly rather than my app code. The lambada + generics based Mock suites (Moq, RhinoMocks, etc), IMO, [...]]]></description>
			<content:encoded><![CDATA[<p><del datetime="2009-10-13T20:43:30+00:00">I dislike using mocks </del> I dislike using dynamic mocking/stubbing frameworks. because it means my tests have an extra dependency beyond just the SUT (System Under Test). I often find myself spending more time getting the mock to work correctly rather than my app code. The lambada + generics based Mock suites (Moq, RhinoMocks, etc), IMO, complicate the test and make them unreadable in some situations. </p>
<p>&#160;</p>
<p>Compare the two examples in this post. One uses RhinoMocks to create a stub of IDataReader and the other uses the DataTableReader to create a stub for the test. Which example is simpler and has less chance to fail due to the stub?</p>
<p>&#160;</p>
<p>&#160;<a href="http://www.lazycoder.com/weblog/2008/12/12/mocking-idatareader-using-rhinomocks-35/">http://www.lazycoder.com/weblog/2008/12/12/mocking-idatareader-using-rhinomocks-35/</a> </p>
<p>Using RhinoMocks </p>
<div class="igBar"><span id="lcsharp-3"><a href="#" onclick="javascript:showCodeTxt('csharp-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-3">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">IDataReader reader = MockRepository.<span style="color: #0000FF;">GenerateStub</span>&lt;IDataReader&gt;<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="color: #0000FF;">Stub</span><span style="color: #000000;">&#40;</span>x =&gt; x.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0600FF;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Repeat</span>.<span style="color: #0000FF;">Times</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;color:#800000;">1</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="color: #0000FF;">Stub</span><span style="color: #000000;">&#40;</span>x =&gt; x.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0600FF;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="color: #0000FF;">Stub</span><span style="color: #000000;">&#40;</span>x =&gt; x<span style="color: #000000;">&#91;</span><span style="color: #808080;">"ID"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0600FF;">Return</span><span style="color: #000000;">&#40;</span>Guid.<span style="color: #0000FF;">Empty</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="color: #0000FF;">Stub</span><span style="color: #000000;">&#40;</span>x =&gt; x<span style="color: #000000;">&#91;</span><span style="color: #808080;">"FullName"</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0600FF;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">"Test User"</span><span style="color: #000000;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Using DataTableReader</p>
<div class="igBar"><span id="lcsharp-4"><a href="#" onclick="javascript:showCodeTxt('csharp-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-4">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DataTable table = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataTable<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataRow row = table.<span style="color: #0000FF;">NewRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table.<span style="color: #0000FF;">Columns</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataColumn<span style="color: #000000;">&#40;</span><span style="color: #808080;">"ID"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table.<span style="color: #0000FF;">Columns</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataColumn<span style="color: #000000;">&#40;</span><span style="color: #808080;">"FullName"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row<span style="color: #000000;">&#91;</span><span style="color: #808080;">"DirectoryUserID"</span><span style="color: #000000;">&#93;</span> = Guid.<span style="color: #0000FF;">Empty</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row<span style="color: #000000;">&#91;</span><span style="color: #808080;">"FullName"</span><span style="color: #000000;">&#93;</span> = <span style="color: #808080;">"Test User"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table.<span style="color: #0000FF;">Rows</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>row<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataTableReader reader = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataTableReader<span style="color: #000000;">&#40;</span>table<span style="color: #000000;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Stubs/Fakes allow me more control over HOW the test fails and results in a test/fixture that is easier to read. I'm not saying that mocks aren't useful in certain situations, but I would favor a stub over a mock IMO, your test should only fail because of the code it is testing, not because of a mock. </p>
<p>&#160;</p>
<p>Although it is fun to say &quot;Mock ME? No mock YOU!&quot;.</p>
<p>update: I forgot to link to Rob's post that inspired this post. "<a href="http://blog.wekeroad.com/cool-kids/using-dependency-injection-and-mocking-for-testability/">Using Dependency Injection and Mocking For Testability</a>"</p>
<p>update to the update: <a href="http://codebetter.com/blogs/jeremy.miller/default.aspx">Jeremy Miller</a> and <a href="http://blog.vuscode.com/">Nikola Malovic</a> both pointed out that I'm using the terminology incorrectly. It turns out I don't specifically hate mocks themselves, I dislike use dynamic mocking/stubbing frameworks due to the extra dependency they introduce into my tests. Thanks for the corrections. Back to reading Fowler for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>JavaScript: Not for the faint at heart?</title>
		<link>http://www.lazycoder.com/weblog/2009/08/13/javascript-not-for-the-faint-at-heart/</link>
		<comments>http://www.lazycoder.com/weblog/2009/08/13/javascript-not-for-the-faint-at-heart/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 16:20:20 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1157</guid>
		<description><![CDATA[JavaScript: A tool too sharp? Script# (Script Sharp) – writing javascript in C# Both Jimmy and roy have great posts discussing JavaScript. Roy is looking at it as a C# developer lured by the many, many articles about how jQuery is the only thing that makes JavaScript worth using and using Script# to abstract away [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/08/11/javascript-a-tool-too-sharp.aspx">JavaScript: A tool too sharp?</a></p>
<p><a href="http://weblogs.asp.net/rosherove/archive/2009/08/11/script-script-sharp-solving-the-javascript-overload-problem.aspx">Script# (Script Sharp) – writing javascript in C#</a></p>
<p>Both Jimmy and roy have great posts discussing JavaScript. Roy is looking at it as a C# developer lured by the many, many articles about how jQuery is the only thing that makes JavaScript worth using and using Script# to abstract away some of the messiness and pain usually associated with writing JavaScript. Jimmy discusses the merits of JavaScript itself and how it has changed how he approaches writing C# code.</p>
<p>One thing I like to point to is a great quote I heard on Twitter </p>
<blockquote><p> Java is to JavaScript as ham is to hamster</p></blockquote>
<p><img src="http://www.lazycoder.com/weblog/wp-content/uploads/2009/08/hamster2.jpg" alt="hamster2.jpg" border="0" width="400" height="277" align="right" /></p>
<p>JavaScript actually has more in common with Scheme or Lisp than it does Java or C#. I first realized this when I saw that <a href="http://javascript.crockford.com/little.html">Douglas Crockford had re-written all of the examples</a> in <a href="http://www.amazon.com/gp/product/0262560992?ie=UTF8&#038;tag=lazycoder-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0262560992">The Little Schemer</a><img src="http://www.assoc-amazon.com/e/ir?t=lazycoder-20&#038;l=as2&#038;o=1&#038;a=0262560992" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
 in JavaScript. It's easy to miss that fact when you see all of the pseudo <acronym title='Object Oriented Programming'><span class='caps'>OOP</span></acronym> noise like "var foo = new Foo();". But when you see how trvial it is to implement something like a <a href="http://www.lazycoder.com/weblog/2009/08/12/a-simple-map-function-for-plain-javascript-arrays/">map method in JavaScript</a>, you realize how powerful the language can be. Most of the hatred for JavaScript comes from two things I've found:</p>
<ol>
<li>Broken <acronym title='Document Object Model'><span class='caps'>DOM</span></acronym> implementations - every browsers implementation of the <acronym title='Document Object Model'><span class='caps'>DOM</span></acronym> is broken in one respect or another.</li>
<li>A misunderstanding of either <a href="http://www.lazycoder.com/weblog/2008/09/23/modern-javascript-development-scope/">scope</a> or <a href="http://javascript.crockford.com/prototypal.html">inheritance</a>.</li>
</ol>
<p>Roy has a great point about the lack of good tooling surrounding JavaScript. There are excellent libraries like jQuery and PrototypeJS, but the usual tool support, intellisense, re-factoring, profiling, is a little more difficult to come by. I'll address this in another post as I feel a lot of people are new to JavaScript and are struggling along with some substandard tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2009/08/13/javascript-not-for-the-faint-at-heart/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Declaration of Awesomeness for the Mono Compiler</title>
		<link>http://www.lazycoder.com/weblog/2009/02/23/declaration-of-awesomeness-for-the-mono-compiler/</link>
		<comments>http://www.lazycoder.com/weblog/2009/02/23/declaration-of-awesomeness-for-the-mono-compiler/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 16:45:15 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1107</guid>
		<description><![CDATA[MonoDevelop 2.0 Beta 1 - Miguel de Icaza Now, technically speaking we have not received any awards for our C# 3.0 compiler, but we should have, because we are awesome. And in fact, I will be arranging a dinner at my place this coming weekend where we will award prizes to the best pieces of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tirania.org/blog/archive/2009/Feb-19-1.html">MonoDevelop 2.0 Beta 1 - Miguel de Icaza</a></p>
<blockquote><p>Now, technically speaking we have not received any awards for our C# 3.0 compiler, but we should have, because we are awesome. And in fact, I will be arranging a dinner at my place this coming weekend where we will award prizes to the best pieces of technologies and our C# compiler is a nominee.</p></blockquote>
<p>We the undersigned do hereby declare the Mono C# 3.0 compiler to be awesome. This is not meant to denigrate the .NET compiler from Microsoft as it is a fine compiler in its own right. We are declaring the Mono C# 3.0 compiler to be an awesome piece of work by a <del>ragtag group of merrymakers</del> well-dressed group of distinguished gentlemen and worthy of all levels of awesomeness.</p>
<p>Leave a comment if you believe the Mono C# 3.0 compiler to be awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2009/02/23/declaration-of-awesomeness-for-the-mono-compiler/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Mocking IDataReader using Rhino.Mocks 3.5</title>
		<link>http://www.lazycoder.com/weblog/2008/12/12/mocking-idatareader-using-rhinomocks-35/</link>
		<comments>http://www.lazycoder.com/weblog/2008/12/12/mocking-idatareader-using-rhinomocks-35/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 07:08:15 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1045</guid>
		<description><![CDATA[The other day I was writing unit tests for some legacy code and I needed to mock IDataReader. I really just wanted to populate the reader with a single row of data, then the Read() method should return false. Using Rhino.Mocks it was a piece of cake. PLAIN TEXT CODE: IDataReader reader = MockRepository.GenerateStub&#60;IDataReader&#62;&#40;&#41;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was writing unit tests for some legacy code and I needed to mock IDataReader. I really just wanted to populate the reader with a single row of data, then the Read() method should return false. Using Rhino.Mocks it was a piece of cake.</p>
<div class="igBar"><span id="lcode-7"><a href="#" onclick="javascript:showCodeTxt('code-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-7">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">IDataReader reader = MockRepository.<span style="">GenerateStub</span>&lt;IDataReader&gt;<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="">Stub</span><span style="color:#006600; font-weight:bold;">&#40;</span>x =&gt; x.<span style="">Read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Return</span><span style="color:#006600; font-weight:bold;">&#40;</span>true<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Repeat</span>.<span style="">Times</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="">Stub</span><span style="color:#006600; font-weight:bold;">&#40;</span>x =&gt; x.<span style="">Read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Return</span><span style="color:#006600; font-weight:bold;">&#40;</span>false<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="">Stub</span><span style="color:#006600; font-weight:bold;">&#40;</span>x =&gt; x<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"ID"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Return</span><span style="color:#006600; font-weight:bold;">&#40;</span>Guid.<span style="">Empty</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reader.<span style="">Stub</span><span style="color:#006600; font-weight:bold;">&#40;</span>x =&gt; x<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"FullName"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">Return</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"Test User"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;UserDTO&gt; list = SearchProvider.<span style="">ParseUserData</span><span style="color:#006600; font-weight:bold;">&#40;</span>reader<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Assert.<span style="">IsNotNull</span><span style="color:#006600; font-weight:bold;">&#40;</span>list<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The magic happens in the Repeat.Times(1) statement. This tells Rhino.Mocks that when the method is called, the mock should Return the given value that number of times. After that it can return a different value.</p>
<p>Update: <a href="http://codebetter.com/blogs/jeremy.miller/default.aspx">Jeremy Miller</a> told me about the DataTableReader class in the BCL and that you can use it to stub out IDataReader. I like this better because it removes the dependency the test had on Rhino.Mocks.</p>
<div class="igBar"><span id="lcode-8"><a href="#" onclick="javascript:showCodeTxt('code-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-8">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DataTable table = new DataTable<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataRow row = table.<span style="">NewRow</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table.<span style="">Columns</span>.<span style="">Add</span><span style="color:#006600; font-weight:bold;">&#40;</span>new DataColumn<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"ID"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table.<span style="">Columns</span>.<span style="">Add</span><span style="color:#006600; font-weight:bold;">&#40;</span>new DataColumn<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"FullName"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"DirectoryUserID"</span><span style="color:#006600; font-weight:bold;">&#93;</span> = Guid.<span style="">Empty</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"FullName"</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC0000;">"Test User"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table.<span style="">Rows</span>.<span style="">Add</span><span style="color:#006600; font-weight:bold;">&#40;</span>row<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataTableReader reader = new DataTableReader<span style="color:#006600; font-weight:bold;">&#40;</span>table<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2008/12/12/mocking-idatareader-using-rhinomocks-35/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dynamic Lookup in C# 4</title>
		<link>http://www.lazycoder.com/weblog/2008/02/04/dynamic-lookup-in-c-4/</link>
		<comments>http://www.lazycoder.com/weblog/2008/02/04/dynamic-lookup-in-c-4/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 07:18:54 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/index.php/archives/2008/02/04/dynamic-lookup-in-c-4/</guid>
		<description><![CDATA[Charlie Calvert's Community Blog : Future Focus I: Dynamic Lookup: "" Charlie Calvert is discussing a new feature in C# called dynamic lookup The next version of Visual Studio will provide a common infrastructure that will enable all .NET languages, including C#, to optionally resolve names in a program at runtime instead of compile time. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.msdn.com/charlie/archive/2008/01/25/future-focus.aspx">Charlie Calvert's Community Blog : Future Focus I: Dynamic Lookup</a>: ""</p>
<p>Charlie Calvert is discussing a new feature in C# called dynamic lookup</p>
<blockquote><p>The next version of Visual Studio will provide a common infrastructure that will enable all .NET languages, including C#, to optionally resolve names in a program at runtime instead of compile time. We call this technology dynamic lookup.
</p></blockquote>
<p>Visual Basic already has this functionality in the form of late binding.</p>
<p>He also provides a short sample illustrating the change.</p>
<div class="igBar"><span id="lcode-10"><a href="#" onclick="javascript:showCodeTxt('code-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-10">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">static void Main<span style="color:#006600; font-weight:bold;">&#40;</span>string<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> args<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; dynamic</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; object myDynamicObject = GetDynamicObject<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; myDynamicObject.<span style="">SomeMethod</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// call a method&nbsp; &nbsp;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; myDynamicObject.<span style="">someString</span> = <span style="color:#CC0000;">"value"</span>; <span style="color:#FF9933; font-style:italic;">// Set a field</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; myDynamicObject<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#800000;color:#800000;">25</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Access an indexer</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The dynamic keyword seems kind of bizarre to me. It looks like they are trying to shoehorn <a href="http://en.wikipedia.org/wiki/Dynamic_dispatch">dynamic dispatch</a> into .NET. Which is fine by me.<br />
Probably the biggest language that uses dynamic dispatch in use today is Javascript. At runtime, all javascript methods are stored as members of the parent object. By using the objects prototype object, methods can be queried and added to the object. When a method is executed against an object in Javascript, first the members of the object itself are queried. If the method isn't found, the objects <a href="http://www.cs.rit.edu/~atk/JavaScript/manuals/jsobj/">prototype chain</a> is checked for the method.</p>
<p>I'm not sure I like using special case keywords in C#, <a href="http://msdn2.microsoft.com/en-us/library/ms228628(VS.80).aspx">unsafe</a> was the first one, instead of changing the language. To me, it feels like they are trying to make C# be all things to all people. My personal feelings are the statically typed languages are going the way of the manual transmission. But trying to cram dynamic features in a static languages is a bad idea. Just get the DLR out and make it a first class runtime environment in the .NET ecosystem. And make sure that managed Javascript, not JSCript ACTUAL ECMAScript, is in there. That way the bracket-lovers will still be happy, but they won't be held back by having to write out a bunch of generic declarations and casting operations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2008/02/04/dynamic-lookup-in-c-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding values to the DataGridViewComboBoxCell at runtime</title>
		<link>http://www.lazycoder.com/weblog/2006/09/12/adding-values-to-the-datagridviewcomboboxcell-at-runtime/</link>
		<comments>http://www.lazycoder.com/weblog/2006/09/12/adding-values-to-the-datagridviewcomboboxcell-at-runtime/#comments</comments>
		<pubDate>Tue, 12 Sep 2006 13:53:07 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/index.php/archives/2006/09/12/adding-values-to-the-datagridviewcomboboxcell-at-runtime/</guid>
		<description><![CDATA[Welcome to hackville population me. The DataGridViewComboBoxCell won't allow values to be entered in the cell if they are not in the Items collection. Since I can't modify the Items collection if the DataSource property is set, I add value of the cell that's causing the DataError to the DataSource for the combo box. Since [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to hackville population me.</p>
<p> The DataGridViewComboBoxCell won't allow values to be entered in the cell if they are not in the Items collection. Since I can't modify the Items collection if the DataSource property is set, I add value of the cell that's causing the DataError to the DataSource for the combo box. Since it doesn't throw anything sensible like a ComboBoxValueNotInItems exception, and it doesn't raise something nice like a "DataBinding" event or an "ValueNotInItems" event, or even an "Validating" event, I have to trap the System.ArgumentException. This may come back to bite me later. For one thing, will I ALWAYS set the Datasource   to a DataTable object? What if I use another object for the data source.</p>
<div class="igBar"><span id="lcsharp-12"><a href="#" onclick="javascript:showCodeTxt('csharp-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-12">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> dgStuff_DataError<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, DataGridViewDataErrorEventArgs e<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Exception</span> <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">is</span></a> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">ArgumentException</span><span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">dgStuff</span>.<span style="color: #0000FF;">Rows</span><span style="color: #000000;">&#91;</span>e.<span style="color: #0000FF;">RowIndex</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Cells</span><span style="color: #000000;">&#91;</span>e.<span style="color: #0000FF;">ColumnIndex</span><span style="color: #000000;">&#93;</span> <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">is</span></a> DataGridViewComboBoxCell<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataGridViewComboBoxCell _cell = <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">dgStuffDataGridView</span>.<span style="color: #0000FF;">Rows</span><span style="color: #000000;">&#91;</span>e.<span style="color: #0000FF;">RowIndex</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Cells</span><span style="color: #000000;">&#91;</span>e.<span style="color: #0000FF;">ColumnIndex</span><span style="color: #000000;">&#93;</span> <span style="color: #0600FF;">as</span> DataGridViewComboBoxCell;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataTable _dt = _cell.<span style="color: #0000FF;">DataSource</span> <span style="color: #0600FF;">as</span> DataTable;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataRow _newRow = _dt.<span style="color: #0000FF;">NewRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _newRow<span style="color: #000000;">&#91;</span><span style="color: #808080;">"LkpCode"</span><span style="color: #000000;">&#93;</span> = _cell.<span style="color: #0000FF;">Value</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _newRow<span style="color: #000000;">&#91;</span><span style="color: #808080;">"LkpDescription"</span><span style="color: #000000;">&#93;</span> = _cell.<span style="color: #0000FF;">Value</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _dt.<span style="color: #0000FF;">Rows</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>_newRow<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _dt.<span style="color: #0000FF;">AcceptChanges</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I found a post in the <acronym title='Microsoft Developer Network'><span class='caps'>MSDN</span></acronym> forums where they talk about <a href="http://forums.microsoft.com/<acronym title='Microsoft Developer Network'><span class='caps'>MSDN</span></acronym>/ShowPost.aspx?PostID=13855&#038;SiteID=1">accepting user input in the DataGridViewComboBoxCell which isn't in the cells Items collection.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2006/09/12/adding-values-to-the-datagridviewcomboboxcell-at-runtime/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visual Studio Express editions free for 1 year</title>
		<link>http://www.lazycoder.com/weblog/2005/11/07/visual-studio-express-editions-free-for-1-year/</link>
		<comments>http://www.lazycoder.com/weblog/2005/11/07/visual-studio-express-editions-free-for-1-year/#comments</comments>
		<pubDate>Mon, 07 Nov 2005 19:16:21 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/index.php/archives/2005/11/07/visual-studio-express-editions-free-for-1-year/</guid>
		<description><![CDATA[Wow. Microsoft FINALLY gets it. Even if just a little bit. For 1 year, starting Nov 7th, you can download and use any of the Visual Studio Express Editions for free. I often said the only reason I'm experimenting with Cocoa development is that XCode comes with OS X for free. If I had to [...]]]></description>
			<content:encoded><![CDATA[<p>Wow. Microsoft FINALLY gets it. Even if just a little bit.</p>
<p>For 1 year, starting Nov 7th, you can download and use any of the <a href="http://msdn.microsoft.com/vstudio/express/">Visual Studio Express Editions </a>for <a href="http://msdn.microsoft.com/vstudio/express/support/faq/default.aspx#pricing">free</a>.</p>
<p>I often said the only reason I'm experimenting with Cocoa development is that XCode comes with OS X for free. If I had to pay $400 for XCode, I wouldn't be using it. In fact, Xcode for free is part of the reason I finally took the plunge and bought an Apple machine. I get to tinker for free!</p>
<p>Now, Microsoft has the chance to prove that they really get it by providing all of the free express editions ON THE VISTA RELEASE <acronym title='Digital Video Disc'><span class='caps'>DVD</span></acronym>. C'mon Microsoft, plant the seeds for a whole new generation of developers for your platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2005/11/07/visual-studio-express-editions-free-for-1-year/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>gah, what the hell is this line doing?</title>
		<link>http://www.lazycoder.com/weblog/2005/08/22/gah-what-the-hell-is-this-line-doing/</link>
		<comments>http://www.lazycoder.com/weblog/2005/08/22/gah-what-the-hell-is-this-line-doing/#comments</comments>
		<pubDate>Mon, 22 Aug 2005 21:03:05 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/index.php/archives/2005/08/22/gah-what-the-hell-is-this-line-doing/</guid>
		<description><![CDATA[Kids, don't try this at home. This is a sick line. conn = tr != null ? tr.Connection : conn != null ? conn : stmt.SessionBroker.Provider.GetConnection();]]></description>
			<content:encoded><![CDATA[<p>Kids, don't try this at home. This is a sick line.</p>
<p>conn = tr != null ? tr.Connection : conn != null ? conn : stmt.SessionBroker.Provider.GetConnection();</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2005/08/22/gah-what-the-hell-is-this-line-doing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running visual studio versions side by side</title>
		<link>http://www.lazycoder.com/weblog/2005/08/15/running-visual-studio-versions-side-by-side/</link>
		<comments>http://www.lazycoder.com/weblog/2005/08/15/running-visual-studio-versions-side-by-side/#comments</comments>
		<pubDate>Tue, 16 Aug 2005 03:55:57 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=476</guid>
		<description><![CDATA[Has anyone had any luck running Visual Studio versions side by side? I'm going to try running VS 2003 and VS 2005 b2 on the same machine at home. It's not a production machine so I'm not too worried about it's stability.]]></description>
			<content:encoded><![CDATA[<p>Has anyone had any luck running Visual Studio versions side by side? I'm going to try running VS 2003 and VS 2005 b2 on the same machine at home. It's not a production machine so I'm not too worried about it's stability.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2005/08/15/running-visual-studio-versions-side-by-side/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A quick tip when dealing with resources</title>
		<link>http://www.lazycoder.com/weblog/2005/07/05/a-quick-tip-when-dealing-with-resources/</link>
		<comments>http://www.lazycoder.com/weblog/2005/07/05/a-quick-tip-when-dealing-with-resources/#comments</comments>
		<pubDate>Wed, 06 Jul 2005 04:40:04 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=456</guid>
		<description><![CDATA[A quick tip, this may already be well known around the community, when dealing with .resx files and namspaces. Make sure that the default namespace for your Visual Studio project is the same as the class you are trying to access resources embedded in your .resx files from. We kept running into problems if the [...]]]></description>
			<content:encoded><![CDATA[<p>A quick tip, this may already be well known around the community, when dealing with .resx files and namspaces.</p>
<p>Make sure that the default namespace for your Visual Studio project is the same as the class you are trying to access resources embedded in your .resx files from. We kept running into problems if the two were not the same in one of our custom web controls. It appears that when .NET puts your resources into the manifest of your Assembly, it associates them with the default namespace of the project somehow. (I'm not entirely sure how this is all accomplished. I'll see if either I or my co-worker can hunt down someone at MS who can give me a better explanation.).</p>
<p>The error you will get is long and generic, something about how the resource could not be retrieved for the given culture. I've just re-imaged my work machine, once I finish installing everything I'll replicate the error and the solution, posting the code and error message here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazycoder.com/weblog/2005/07/05/a-quick-tip-when-dealing-with-resources/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

