<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>C# Ghost</title>
	<atom:link href="http://csharpghost.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://csharpghost.wordpress.com</link>
	<description>Product Factory ( rawMaterial ) { ..............process;         return product; }</description>
	<lastBuildDate>Tue, 12 Aug 2008 12:48:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='csharpghost.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>C# Ghost</title>
		<link>http://csharpghost.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://csharpghost.wordpress.com/osd.xml" title="C# Ghost" />
	<atom:link rel='hub' href='http://csharpghost.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Updating tableadapters to use join</title>
		<link>http://csharpghost.wordpress.com/2008/08/12/updating-tableadapters-to-use-join/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/12/updating-tableadapters-to-use-join/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 12:38:15 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/?p=25</guid>
		<description><![CDATA[Dataset designer donot generate the auto insert, update and delete ad-hoc sql command when there is join in the select statement. But it generates for subquery. To introduce join in select statement, you first generate the CRUD statements without introducing join, and later we change it to introduce join. And if you use stored procedure, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=25&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Dataset designer donot generate the auto insert, update and delete ad-hoc sql command when there is join in the select statement. But it generates for subquery. To introduce join in select statement, you first generate the CRUD statements without introducing join, and later we change it to introduce join. And if you use stored procedure, it doesnot affect the insert, delete and update command which remains intact.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=25&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/12/updating-tableadapters-to-use-join/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>Geek</title>
		<link>http://csharpghost.wordpress.com/2008/08/12/geek/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/12/geek/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 12:32:28 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/?p=23</guid>
		<description><![CDATA[Subquery or Join : which is better? Ans: There is somewhat equal execution plan for both subquery and join. So there is almost no performance difference. But, join is generally used to find the existence of records whereas subquery is used to eliminate the duplicate the data. some useful links: how to perform sql join<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=23&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Subquery or Join : which is better?</strong></p>
<p>Ans: There is somewhat equal execution plan for both subquery and join. So there is almost no performance difference. But, join is generally used to find the existence of records whereas subquery is used to eliminate the duplicate the data.</p>
<p>some useful links:  <a href="http://www.w3schools.com/sql/sql_join.asp">how to perform sql join</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=23&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/12/geek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>Developing simple custom controls</title>
		<link>http://csharpghost.wordpress.com/2008/08/12/developing-simple-custom-controls/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/12/developing-simple-custom-controls/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 02:15:50 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/?p=20</guid>
		<description><![CDATA[chapter 2: part 1 ( custom controls) The word “render” has a special meaning in the context of server control development, which is different from the common meaning of the word where rendering refers to the Web browser’s task of displaying or rendering the HTMLmarkup that the browser receives from the server. Rendering in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=20&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span lang="EN-CA"> chapter 2: part 1 ( custom controls)<br />
</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="color:#548dd4;">The word “render” has a special meaning in the context of server control development, which is different from the common meaning of the word where rendering refers to the Web browser’s task of displaying or rendering the HTMLmarkup that the browser receives from the server. Rendering in the context of server control development means generating the HTMLmarkup text that the server sends to the browser. In other words, server controls render (generate) the HTMLmarkup text that browsers render (display).</span></p>
<p class="MsoNormal"><span style="color:#548dd4;">At runtime, the containing page creates an instance of a class named HtmlTextWriter and passes the instance into the Render methods of the server controls that the page contains. The HtmlTextWriter class exposes a method named write that these server controls can use to write out their HTMLmarkup text.</span></p>
<p class="MsoNormal"><strong><span style="color:#548dd4;">Adding Design-Time Attributes to Your Custom Controls</span></strong></p>
<p class="MsoNormal"><strong><span style="color:#548dd4;">Property level attributes</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>[<span style="color:teal;">BrowsableAttribute</span>(<span style="color:blue;">true</span>)]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>[<span style="color:teal;">DescriptionAttribute</span>(“Gets and sets the payment method”)]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>[<span style="color:teal;">DefaultValueAttribute</span>(“Payment Method”)]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>[<span style="color:teal;">CategoryAttribute</span>(“Appearance”)]</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">public</span> <span style="color:blue;">virtual</span> <span style="color:blue;">string</span> PaymentMethodText</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 0.0001pt 0.5in;"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">get</span> { <span style="color:blue;">return</span> <span style="color:blue;">this</span>.paymentMethodText; }</span></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 0.0001pt 0.5in;"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">set</span> { <span style="color:blue;">this</span>.paymentMethodText = <span style="color:blue;">value</span>; }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span lang="EN-CA">This code takes the following actions:</span></p>
<p class="MsoNormal"><span lang="EN-CA">1. Annotates the PaymentMethodText property with the <span style="color:#548dd4;">BrowsableAttribute(true)</span> attribute to instruct the property browser to display the name and value of this property. By default, every public property is considered browsable. You should use this attribute on read-only properties to tell the property browser not to display them because there is no point in displaying a property if page developers can’t change its value.</span></p>
<p class="MsoNormal"><span lang="EN-CA">2. Annotates the property with the <span style="color:#548dd4;">DescriptionAttribute(“Gets and sets the payment method”)</span> attribute to instruct the property browser to display the text “Gets and sets the payment method” every time the page developer selects the property.</span></p>
<p class="MsoNormal"><span lang="EN-CA">3. Annotates the property with the <span style="color:#548dd4;">DefaultValueAttribute(“Payment Method”)</span> attribute to instruct the property browser to display the text “Payment Method” as the default value of the property.</span></p>
<p class="MsoNormal"><span lang="EN-CA">4. Annotates the property with the <span style="color:#548dd4;">CategoryAttribute(“Appearance”)</span> attribute to instruct the property browser to display this property under the Appearance category.</span></p>
<p class="MsoNormal"><strong><span style="color:#548dd4;">Class level Attributes</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="color:#548dd4;">When page developers select a server control in Visual Studio, they expect to see a particular property </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="color:#548dd4;">of the control highlighted. This property is known as the default property of the server control. The following code annotates the CreditCardForm2 custom control with the DefaultPropertyAttribute(“CardholderNameText”) to mark the CardholderNameText property as the default property:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><strong><span style="color:#548dd4;"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">DefaultPropertyAttribute</span><span style="font-size:10pt;font-family:&quot;">(“CardholderNameText”)]</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;line-height:115%;font-family:&quot;"> <span style="color:blue;">class</span> <span style="color:teal;">CreditCardForm2</span> : <span style="color:teal;">Control</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:teal;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:#548dd4;">The following code annotates the CreditCardForm2 custom control with the class-level attribute ToolboxDataAttribute to specify default values for the properties of the CreditCardForm2 control:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">[<span style="color:teal;">ToolboxData</span>(“&lt;{0}:CreditCardForm2 PaymentMethodText=’Payment Options’ CreditCardNoText=’Credit Card Number’ CardholderNameText=’Cardholder Full Name’ </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">SubmitButtonText = ‘Send’<span> </span>runat=’server’&gt;&lt;/{0}:CreditCardForm2&gt;”)]</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;line-height:115%;font-family:&quot;"> <span style="color:blue;">class</span> <span style="color:teal;">CreditCardForm2</span> : <span style="color:teal;">Control</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:teal;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:#548dd4;">This attribute instructs the designer to add the following line to the .aspx page when the page developer drags CreditCardForm2 from the Toolbox onto the designer surface:</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;color:teal;">&lt;ccl:CreditCardForm2 runat=’server’ CardholderNameText=’Cardholder Full Name’ CreditCardNoText=’Credit Card Number’ PaymentMethodText=’Payment Options’ SubmitButtonText=’Send’&gt;&lt;/ccl:CreditCardForm2&gt;</span></p>
<p class="MsoNormal"><strong><span style="color:#548dd4;">Assembly-Level Attributes</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">As discussed, when page developers drag a CreditCardForm2 control from the Toolbox onto the design</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">surface, the designer adds the following two lines to the .aspx file:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">&lt;%@ Register Assembly=”CustomComponents” Namespace=”CustomComponents” </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">TagPrefix=”cc1” %&gt;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">&#8230;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">&lt;cc1:CreditCardForm2 ID=”CreditCardForm2” runat=”server”/&gt;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Notice that the designer uses the <span style="color:blue;">default</span> cc1 <span style="color:blue;">as</span> the prefix. You can add the following assembly-level attribute to the AssemblyInfo.cs file to instruct the designer to use “custom” <span style="color:blue;">as</span> the tag prefix:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">using</span><span style="font-size:10pt;font-family:&quot;"> System.Web.UI;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;">[assembly: <span style="color:teal;">TagPrefix</span>(“CustomComponents”,”custom”)]</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;"> </span></p>
<p class="MsoNormal"><strong><span style="color:#548dd4;">The HtmlTextWriter-Related Enumerations</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">class</span> <span style="color:teal;">CreditCardForm3</span> : CreditCardForm2</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">protected</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">override</span> <span style="color:blue;">void</span> Render(<span style="color:teal;">HtmlTextWriter</span> writer)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.Width,<span style="color:maroon;">&#8220;287px&#8221;</span>);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.Height, “124px”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.BorderWidth, “0”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddAttribute(<span style="color:teal;">HtmlTextWriterAttribute</span>.Id, “mytable”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.RenderBeginTag(<span style="color:teal;">HtmlTextWriterTag</span>.Table);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.RenderBeginTag(<span style="color:teal;">HtmlTextWriterTag</span>.Tr);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.RenderBeginTag(<span style="color:teal;">HtmlTextWriterTag</span>.Td);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.Write(PaymentMethodText);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.RenderEndTag();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.RenderBeginTag(<span style="color:teal;">HtmlTextWriterTag</span>.Td);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddAttribute(<span style="color:teal;">HtmlTextWriterAttribute</span>.Name, “PaymentMethod”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddAttribute(<span style="color:teal;">HtmlTextWriterAttribute</span>.Id, “PaymentMethod”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.Width, “100%”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"><span> </span>writer.RenderBeginTag(<span style="color:teal;">HtmlTextWriterTag</span>.Select);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;"><span> </span>writer.AddAttribute(<span style="color:teal;">HtmlTextWriterAttribute</span>.Value, “0”);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;line-height:115%;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">The HtmlTextWriter <span style="color:blue;">class</span> <span style="color:teal;">exposes</span> one method <span style="color:blue;">for</span> rendering each of the preceding parts <span style="color:blue;">as</span> follows:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">RenderBeginTag</span><span style="font-size:10pt;font-family:&quot;">: Renders or generates the opening tag of an HTMLelement.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">AddAttribute</span><span style="font-size:10pt;font-family:&quot;">: This method <span style="color:blue;">is</span> called once <span style="color:blue;">for</span> each attribute to generate or render the attribute on the opening tag of the HTMLelement. This method must be called before RenderBeginTag.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">AddStyleAttribute</span><span style="font-size:10pt;font-family:&quot;">: This method <span style="color:blue;">is</span> called once <span style="color:blue;">for</span> each style attribute to generate or render the attribute <span style="color:blue;">as</span> part of the style attribute of the HTMLelement. This method must also be called before RenderBeginTag. ASP.NET automatically generates a single attribute named style that contains all of the style attributes such <span style="color:blue;">as</span> width, height, and so on. In other words, multiple calls of the AddStyleAttribute method are accumulated <span style="color:blue;">in</span> a single style attribute on the opening tag of the element.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">Write</span><span style="font-size:10pt;font-family:&quot;">: Recall that an HTMLelement can contain text, other elements, or both. Use the Write method to generate any type of textual content such <span style="color:blue;">as</span> <span style="color:blue;">string</span>, <span style="color:blue;">int</span>, <span style="color:blue;">float</span>, and so on. You should use the RenderBeginTag, AddAttribute, AddStyleAttribute, and RenderEndTag methods to generate non-textual content, that <span style="color:blue;">is</span>, child elements of an element.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:#548dd4;">RenderEndTag</span><span style="font-size:10pt;font-family:&quot;">: Renders or generates the closing tag of an HTMLelement.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.Width, “287px”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.Height, “124px”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">writer.AddStyleAttribute(<span style="color:teal;">HtmlTextWriterStyle</span>.BorderWidth, “0”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">writer.AddAttribute(<span style="color:teal;">HtmlTextWriterAttribute</span>.Id, “mytable”);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">writer.RenderBeginTag(<span style="color:teal;">HtmlTextWriterTag</span>.Table);</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">&#8230;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;line-height:115%;font-family:&quot;">Writer.RenderEndTag();</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;line-height:115%;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><strong><span style="color:#548dd4;">State Management</span></strong></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">class</span> <span style="color:teal;">CreditCardForm4</span> : CreditCardForm3</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">override</span> <span style="color:blue;">string</span> PaymentMethodText</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">get</span><span style="font-size:10pt;font-family:&quot;"> { <span style="color:blue;">return</span> ViewState[“PaymentMethodText”] != <span style="color:blue;">null</span> ? </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">(<span style="color:blue;">string</span>)ViewState[“PaymentMethodText”] : “PaymentMethod”; }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">set</span><span style="font-size:10pt;font-family:&quot;"> { ViewState[“PaymentMethodText”] = <span style="color:blue;">value</span>; }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">override</span> <span style="color:blue;">string</span> CreditCardNoText</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">get</span><span style="font-size:10pt;font-family:&quot;"> { <span style="color:blue;">return</span> ViewState[“CreditCardNoText”] != <span style="color:blue;">null</span> ? </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">(<span style="color:blue;">string</span>)ViewState[“CreditCardNoText”] : “CreditCardNo”; }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">set</span><span style="font-size:10pt;font-family:&quot;"> { ViewState[“CreditCardNoText”] = <span style="color:blue;">value</span>; }</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;line-height:115%;font-family:&quot;">}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">After converting each <span style="color:blue;">object</span> to its <span style="color:blue;">string</span> representation, ASP.NET stores these <span style="color:blue;">string</span> values to a hidden field named __VIEWSTATE and sends them to the client. Therefore, the size of the <span style="color:blue;">string</span> representations of the objects you store <span style="color:blue;">in</span> ViewState matters. </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">When it comes to storing objects to ViewState you must keep the following two important things <span style="color:blue;">in</span> mind:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">ViewState <span style="color:blue;">is</span> optimized to convert certain types such <span style="color:blue;">as</span> System.String, System.Int32, System.Boolean, System.Drawing.Color, System.Unit, and Hashtable, Array, and ArrayList of Int32, Boolean, Color, and Unit values. If your custom control needs to store</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">other types to ViewState, you should write a custom type converter that <span style="color:blue;">is</span> optimized to convert your custom type to its <span style="color:blue;">string</span> representation.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Because the <span style="color:blue;">string</span> representations of the objects you add to ViewState are stored on the ASP.NET page, you must store only necessary information to ViewState to reduce the size of the ASP.NET page. For example, you shouldn’t store values that you can easily evaluate <span style="color:blue;">for</span> each</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;line-height:115%;font-family:&quot;">request.</span><strong></strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=20&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/12/developing-simple-custom-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>The ASP.NET 2.0 Framework</title>
		<link>http://csharpghost.wordpress.com/2008/08/11/the-aspnet-20-framework/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/11/the-aspnet-20-framework/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 15:09:45 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/?p=10</guid>
		<description><![CDATA[I’m going to show developing asp.net web server controls as a multipart series. This has been completely referenced from Professional ASP.NET 2.0 server control and component development book written by Dr. Shahram Khosravi. Chapter 1: ASP.NET is a framework that processes request for web resources. Everything starts when the user attempts to download the Default.aspx [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=10&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align:justify;"><span lang="EN-CA">I’m going to show developing asp.net web server controls as a multipart series. This has been completely referenced from Professional ASP.NET 2.0 server control and component development book written by Dr. Shahram Khosravi.</span></p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;"><span lang="EN-CA">Chapter 1:</span></p>
<p class="MsoNormal" style="text-align:justify;"><strong></strong></p>
<p class="MsoNormal" style="text-align:justify;"><span style="color:#548dd4;">ASP.NET is a framework that processes request for web resources</span><span lang="EN-CA">.</span></p>
<p class="MsoNormal" style="text-align:justify;"><span lang="EN-CA"> </span></p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoNormal" style="text-align:justify;"><span lang="EN-CA">Everything starts when the user attempts to download the Default.aspx page; that is, the user makes a request for this page. Internet Information Services (IIS) picks up the request and passes it to an ISAPI extension named </span><strong><span style="font-size:12pt;line-height:115%;" lang="EN-CA">aspnet_isapi.dll</span></strong><span lang="EN-CA">. After passing through some intermediary components, the request finally arrives in a .NET component named </span><strong><span style="font-size:12pt;line-height:115%;" lang="EN-CA">HttpRuntime</span></strong><span lang="EN-CA">. This component <span style="color:#548dd4;">creates an instance of a .NET class named </span></span><strong><span style="font-size:14pt;line-height:115%;color:#548dd4;">HttpContext</span></strong><span lang="EN-CA"> that contains the complete information about the request, and exposes this information in the form of well-known, convenient managed objects such as Request, Response, Server, and so on.</span><span lang="EN-CA"> </span><span lang="EN-CA">The request finally arrives in a .NET component named </span><strong><span style="font-size:12pt;line-height:115%;" lang="EN-CA">HttpApplication</span></strong><span lang="EN-CA">. This component <span style="color:#548dd4;">creates a pipeline of .NET components known as HTTP modules</span> to perform pre-processing operations such as authentication and authorization. The results of these operations are stored in the </span><strong><span style="font-size:12pt;line-height:115%;" lang="EN-CA">HttpContext</span></strong><span lang="EN-CA"> object.</span><span lang="EN-CA"> <span> </span></span><span lang="EN-CA">After </span><strong><span style="font-size:12pt;line-height:115%;" lang="EN-CA">HTTPmodules</span></strong><span lang="EN-CA"> pre-process the request, HttpApplication passes the pre-processed request to a component known as an </span><strong><span style="font-size:12pt;line-height:115%;" lang="EN-CA">HTTPHandler</span></strong><span lang="EN-CA">. The main responsibility of an HTTPHandler is to <span style="color:#548dd4;">generate the markup text that is sent back to the requester</span> as part of the response. Different types of HTTPHandlers <span style="color:#548dd4;">generate different types of markup texts</span>. For example, the HTTPhandler that handles the requests for the .aspx extension, such as the Default.aspx page shown in Listing 1-1, generates HTMLmarkup text. The HTTPhandler that handles the requests for the .asmx extension, on the other hand, <span style="color:#548dd4;">generates XML markup text</span>.</span><span lang="EN-CA"> </span><span lang="EN-CA">Therefore, ASP.NET instantiates and initializes the appropriate HTTPHandler to handle or process the request for the specified extension.</span><span lang="EN-CA"> </span></p>
<p class="MsoNormal" style="text-align:justify;">WHY DEVELOP CUSTOM CONTROLS?</p>
<p class="MsoNormal" style="text-align:justify;"><span lang="EN-CA">You need to develop custom components because there are many situations in which the contributions of the existing standard ASP.NET components do not add up to the markup text that would adequately service the request. In following sections, we’ll cover situations</span><span lang="EN-CA"> </span><span lang="EN-CA">to give you a flavour of what you can achieve with the skills, knowledge, and experience that this book provides you.</span></p>
<p class="MsoNormal" style="text-align:justify;">
<p class="MsoListParagraphCxSpFirst" style="text-align:left;text-indent:-0.25in;"><!--[if !supportLists]--><span lang="EN-CA"><span>1.<span style="font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-family:&quot;"> </span></span></span><!--[endif]--></p>
<ol>
<li><span lang="EN-CA">Data source controls</span></li>
<li><span lang="EN-CA">Role manager modules and principals</span></li>
<li><span lang="EN-CA">Role providers</span></li>
<li><span lang="EN-CA">Membership providers</span></li>
<li><span lang="EN-CA">Customizing web services and their clients</span></li>
<li><span lang="EN-CA">Developing Ajax enabled controls and components</span></li>
<li><span lang="EN-CA">Developing web part controls</span></li>
<li><span lang="EN-CA">Developing custom data control fields</span></li>
<li><span lang="EN-CA">Developing custom http handlers and modules</span></li>
<li><span lang="EN-CA">Developing custom provider-based services</span></li>
</ol>
<p class="MsoNormal" style="text-align:justify;">
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=10&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/11/the-aspnet-20-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>asdfasdfasdf</title>
		<link>http://csharpghost.wordpress.com/2008/08/08/asdfasdfasdf/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/08/asdfasdfasdf/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 15:49:00 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/2008/08/08/asdfasdfasdf/</guid>
		<description><![CDATA[asdfasdfasdf<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=30&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>asdfasdfasdf
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=30&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/08/asdfasdfasdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft&#8230;words from Bigyan RajBhandari</title>
		<link>http://csharpghost.wordpress.com/2008/08/08/microsoftwords-from-bigyan-rajbhandari/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/08/microsoftwords-from-bigyan-rajbhandari/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 11:06:00 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/2008/08/08/microsoftwords-from-bigyan-rajbhandari/</guid>
		<description><![CDATA[Well, there are few things. First ‘aspiration’, I have always wanted to work for the software giant, the fact that you have opportunity to impact millions of people by your work is impassable. Second, working with smarter people and chance to learn new things every day is appealing. And rest like benefits, location etc.. are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=40&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, there are few things. First ‘aspiration’, I have always wanted to work for the software giant, the fact that you have opportunity to impact millions of people by your work is impassable.  Second, working with smarter people and chance to learn new things every day is appealing. And rest like benefits, location etc.. are definitely added bonus.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=40&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/08/microsoftwords-from-bigyan-rajbhandari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>Good Developer&#8217;s Most Essential Qualities</title>
		<link>http://csharpghost.wordpress.com/2008/08/08/good-developers-most-essential-qualities/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/08/good-developers-most-essential-qualities/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 09:27:00 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/2008/08/08/good-developers-most-essential-qualities/</guid>
		<description><![CDATA[Good Communication skills &#8211; In the software world, people usually define good communication skills as fluency in a spoken language. That&#8217;s not really what it is. It is how effectively you are able to communicate with others. As a &#8216;good&#8217; developer, you should be able to express yourself well, listen well, as well as manage [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=39&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!--[if gte mso 9]&gt;     Normal   0               false   false   false      EN-US   X-NONE   X-NONE                                                     MicrosoftInternetExplorer4                                                   &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                                                                                                                                                                                                                                                                                                                &lt;![endif]--> <!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:Verdana; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:536871559 0 0 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph 	{mso-style-priority:34; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:.5in; 	mso-add-space:auto; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst 	{mso-style-priority:34; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-type:export-only; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:.5in; 	margin-bottom:.0001pt; 	mso-add-space:auto; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle 	{mso-style-priority:34; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-type:export-only; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:.5in; 	margin-bottom:.0001pt; 	mso-add-space:auto; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast 	{mso-style-priority:34; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-type:export-only; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:.5in; 	mso-add-space:auto; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --> <!--[if gte mso 10]&gt;   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;}  &lt;![endif]-->
<p class="MsoNormal" style="background:white none repeat scroll 0 0;text-align:justify;line-height:normal;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;">Good Communication skills</span></b><span style="font-size:10pt;"> &#8211; In the software world, people usually define good communication skills as fluency in a spoken language. That&#8217;s not really what it is. It is how effectively you are able to communicate with others. As a &#8216;good&#8217; developer, you should be able to express yourself well, listen well, as well as manage the communication process well.</span><span style="font-size:9.5pt;"></span></span></p>
<p class="MsoListParagraphCxSpFirst" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;"><span> </span>Positive Attitude</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; &#8216;Your attitude determines your altitude&#8217;. I am sure you must have heard that phrase. From a developer&#8217;s context, this means believe in you, stop blaming others and adapt to changes without fretting. Remember that you always get what you want because you always want what you get.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Read Books</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; Read plenty of them to get a good idea of different technologies. Reading books gives you quick and handy insight into a technology. You should choose books that are usually written by known professionals who recommend best practices and different methods of solving a business problem using the technology. During the course of time, you will learn to develop your own methods. Who knows you may one day write a book!!</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Practice, Practice and Practice</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; I have seen a lot of developers having good amount of theoretical knowledge. They read a lot of books and technical material. However when it comes to applying that knowledge, they take a back foot. That is because they do not practice. Efficiency and effectiveness in your work can only be attained if you practice code. The only way you can make a good developer of yourself is to practice, and then practice some more.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Follow Patterns and Best Practices</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; Patterns &amp; practices reflect technical guidance, technical problem domain and engineering practices based on real-world experiences. The process to learn it is gradual, but once done; it can save you a lot of time and efforts and enable you to work smartly. Follow a Code Design Guideline. Always use a code analysis tools that will evaluate and analyze your code.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;line-height:115%;"> </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Discussion/Newsgroup</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; Participating in communities develops the quality of leadership and contribution, both ingredients of success. Having participated in a good technical discussion on the community leaves you with a feeling of self-satisfaction. It also increases your knowledge, as you find smart people who can validate your solutions, as you validate theirs. It also teaches you to appreciate suggestions. Do not forget to &#8216;pat someone on the back&#8217; if he/her has made a positive contribution. Believe me it makes all the difference.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;line-height:115%;"> </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Knowledge of Networking and Databases</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; People may contradict this point, but during my career as a developer, I have realized that a good developer should know the basics of networking and databases. Almost all the solutions that we create, involve interactions with networks and databases. Having knowledge of these two, helps you write better code and saves you on a lot of time too.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;line-height:115%;"> </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Blog/ Write Articles</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; How many of us can remember everything? I cannot. So I document them. It helps me to reference stuff when I need them. Over and above, it also helps me get some good feedback from readers and shows me multiple approaches to do the same stuff. I have received a lot of feedback about my work, some good and some not so good. However, I do validate them and learn from this process. It develops the developer in you.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">KISS</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; Keep Implementations/Approaches Short and Simple. Do not over complicate things by using jargons, which people find it hard to understand. The key is to simplify your designs and avoid over-engineering things.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Think as a Tester</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; Developers and Testers; two sets of people from different camps, ready to take on each other. I have observed that the intersection of the two produces good results. It does not harm taking off the developer&#8217;s hat for some time and putting on the tester&#8217;s hat. In fact, in the long run it helps you reduce bugs/defects in your code. You develop a mindset of about breaking your code, when you are creating one.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;line-height:115%;"> </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Consistency is the name of the game </span></b><span style="font-size:10pt;line-height:115%;">- Do you hop jobs too often or are bitten by the &#8216;salary&#8217; bug? If yes, then it’s time for you to sit down, relax and plan. Invest time in thinking and let your decisions not be spontaneous. To move ahead, you need a solid foundation and that comes with consistency.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;line-height:115%;"> </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Attend technology seminars and events</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; If there is one hosted in your city, make sure you take out time to attend one. Most of them are free and provide a valuable source of information about new technologies.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;line-height:115%;"> </span></span></p>
<p class="MsoListParagraphCxSpLast" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;line-height:115%;">Jack of all or Master of One?</span></b><span style="font-size:10pt;line-height:115%;"> &#8211; Well that&#8217;s a difficult one to answer. In today&#8217;s scenario, you have to master more than one technology. Practically it is quiet difficult to do so, but the good ones do it. However the key is adaptability over here. If you are good at any one technology and confident in it, given an opportunity, it would be easier for to relate to a new technology in a short period of time. Try it out as it enables you to compare technologies and make decisions, once you have worked with them.</span></span></p>
<p class="MsoNormal" style="background:white none repeat scroll 0 0;text-align:justify;line-height:normal;font-family:verdana;"><span style="font-size:85%;"><b><span style="font-size:10pt;">Stop complaining</span></b><span style="font-size:10pt;"> &#8211; Did the software fail or are the testers giving you a tough time by finding a lot of bugs? A natural tendency for a lot of developers is to react and then overreact in such situations. While the reaction is natural, it may not be desirable. Analyze why the software failed or why was the bug reported. It is going to be a learning experience and will help you in your future projects.</span><span style="font-size:9.5pt;"></span></span></p>
<p class="MsoNormal" style="background:white none repeat scroll 0 0;text-align:justify;line-height:normal;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:10pt;">At the end, just remember that you are not going to remain a programmer for ever. So once you are satisfied and get a feeling that you have proven yourself as a good programmer, it’s time to re-program yourself. Expand your interests. Development is just a part of the process. Understanding the users and business is in itself an art, one should aim for and should master over a period of time</span><span style="font-size:9.5pt;"></span></span></p>
<p class="MsoListParagraph" style="margin-left:0;text-align:justify;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=39&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/08/good-developers-most-essential-qualities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>My Nuwakot Cycling Adventure</title>
		<link>http://csharpghost.wordpress.com/2008/08/02/my-nuwakot-cycling-adventure/</link>
		<comments>http://csharpghost.wordpress.com/2008/08/02/my-nuwakot-cycling-adventure/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 16:59:00 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/2008/08/02/my-nuwakot-cycling-adventure/</guid>
		<description><![CDATA[dasd<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=36&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>dasd</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=36&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/08/02/my-nuwakot-cycling-adventure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>Factory Method Design Pattern</title>
		<link>http://csharpghost.wordpress.com/2008/07/30/factory-method-design-pattern/</link>
		<comments>http://csharpghost.wordpress.com/2008/07/30/factory-method-design-pattern/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 12:21:00 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[design pattern]]></category>
		<category><![CDATA[factory]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/2008/07/30/factory-method-design-pattern/</guid>
		<description><![CDATA[The factory method pattern is a design pattern that allows for the creation of objects without specifying the type of object that is to be created in code. A factory class contains a method that allows determination of the created type at run-time. What is the Factory Method Pattern? The factory pattern is a Gang [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=38&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:85%;"><em>The factory method pattern is a design pattern that allows for the creation of objects without specifying the type of object that is to be created in code. A factory class contains a method that allows determination of the created type at run-time.</p>
<p></em></span><br />
<h2 style="font-family:verdana;"><span style="font-size:85%;">What is the Factory Method Pattern?</span></h2>
<p style="font-family:verdana;"><span style="font-size:85%;">The factory pattern is a <a target="_blank" href="http://en.wikipedia.org/wiki/Design_Patterns">Gang of Four design pattern</a>. This is a <em>creational</em> pattern as it is to control <a href="http://www.blackwasp.co.uk/CSharpSimpleClass.aspx">class</a> instantiation. The factory pattern is used to replace class <a href="http://www.blackwasp.co.uk/CSharpConstructors.aspx">constructors</a>, abstracting the process of object generation so that the type of the object instantiated can be determined at run-time.</span></p>
<p style="font-family:verdana;"><span style="font-size:85%;">A good example of the use of the factory pattern is when creating a connection to a data source if the type of the data source will be selected by the end-user using a graphical interface. In this case, an <a href="http://www.blackwasp.co.uk/AbstractClasses.aspx">abstract class</a> named &#8220;DataSource&#8221; may be created that defines the base functionality of all data sources. Many concrete <a href="http://www.blackwasp.co.uk/Inheritance.aspx">subclasses</a> may be created, perhaps &#8220;SqlDataSource&#8221;, &#8220;XmlDataSource&#8221;, &#8220;CsvDataSource&#8221;, etc, each with specific functionality for a different type of data. At run-time, a further class, perhaps named &#8220;DataSourceFactory&#8221;, generates objects of the correct concrete class based upon a <a href="http://www.blackwasp.co.uk/CSharpMethodParameters.aspx">parameter</a> passed to the factory <a href="http://www.blackwasp.co.uk/CSharpMethods.aspx">method</a>.</span></p>
<p style="font-family:verdana;"><span style="font-size:85%;"><br /></span></p>
<p style="font-family:verdana;"><span style="font-size:85%;">The UML class diagram above describes an implementation of the factory method design pattern. In this diagram there are four classes:</span></p>
<ul style="font-family:verdana;">
<li><span style="font-size:85%;"><strong>FactoryBase</strong>. This is an abstract base class for the concrete factory classes that will actually generate new objects. This class could be a simple <a href="http://www.blackwasp.co.uk/Interfaces.aspx">interface</a> containing the signature for the factory method. However, generally an abstract class will be used so that other standard functionality can be included and inherited by subclasses. In simple situations the factory method may be implemented in full here, rather than being declared as abstract.</span></li>
<li><span style="font-size:85%;"><strong>ConcreteFactory</strong>. Inheriting from the FactoryBase class, the concrete factory classes inherit the actual factory method. This is overridden with the object generation code unless already implemented in full in the base class.</span></li>
<li><span style="font-size:85%;"><strong>ProductBase</strong>. This abstract class is the base class for the types of object that the factory can create. It is also the return type for the factory method. Again, this can be a simple interface if no general functionality is to be inherited by its subclasses.</span></li>
<li><span style="font-size:85%;"><strong>ConcreteProduct</strong>. Multiple subclasses of the Product class are defined, each containing specific functionality. Objects of these classes are generated by the factory method.</span></li>
</ul>
<p><span style="font-size:85%;"><span style="font-family:verdana;">The following code shows the basic code of the factory method design pattern implemented using C#:</span></p>
<p></span>
<pre style="font-family:verdana;"><span style="font-size:85%;">public abstract class FactoryBase{   public abstract Product FactoryMethod(int type);}

public class ConcreteFactory : FactoryBase{   public override Product FactoryMethod(int type)   {       switch (type)       {           case 1:               return new ConcreteProduct1();

           case 2:               return new ConcreteProduct2();

           default:               throw new ArgumentException("Invalid type.", "type");       }   }}

public abstract class ProductBase { }

public class ConcreteProduct1 : ProductBase { }

public class ConcreteProduct2 : ProductBase { }</span></pre>
<p><span style="font-size:85%;"><br /></span>
<p style="font-family:verdana;"><span style="font-size:85%;">In this skeleton structure you can see five distinct classes. The first of these is the FactoryBase class. This is the base class for all concrete factories. A single abstract method is declared, accepting a parameter specifying the type of object to create and returning a Product instance.</span></p>
<p style="font-family:verdana;"><span style="font-size:85%;">The ConcreteFactory class is derived from FactoryBase. This class is used to generate product objects. You can see that the FactoryMethod method overrides the base class version. It accepts an integer parameter and uses this in a <a href="http://www.blackwasp.co.uk/CSharpConditionalProcess.aspx">switch statement</a> to decide which type of product to instantiate and return. If the parameter is invalid, an <a href="http://www.blackwasp.co.uk/CSharpThrowingExceptions.aspx">exception is thrown</a>.</span></p>
<p style="font-family:verdana;"><span style="font-size:85%;">The ProductBase class is the base class for all classes that can be created by the factory. When a new object is instantiated by the factory it is returned in a ProductBase object.</span></p>
<p style="font-family:verdana;"><span style="font-size:85%;">Finally we have two subclasses of ProductBase. These are the concrete products that can be created by the factory and would contain the specialised functionality required for each type.</span></p>
<h2 style="font-family:verdana;"><span style="font-size:85%;">Example Factory Method</span></h2>
<p style="font-family:verdana;"><span style="font-size:85%;">To show a simple example of the factory method design pattern in action, we will create two factories that generate car objects. Each factory will be responsible for a different manufacturer of car. The generated objects could be objects that represent cars in a racing game.</span></p>
<pre style="font-family:verdana;"><span style="font-size:85%;">public abstract class CarFactory{   public abstract Car CreateCar(string model);}

public class HyundaiCarFactory : CarFactory{   public override Car CreateCar(string model)   {       switch (model.ToLower())       {           case "coupe":               return new HyundaiCoupe();

           case "i30":               return new HyundaiI30();

           default:               throw new ArgumentException("Invalid model.", "model");       }   }}

public class MazdaCarFactory : CarFactory{   public override Car CreateCar(string model)   {       switch (model.ToLower())       {           case "mx5":               return new MazdaMX5();

           case "6":               return new Mazda6();

           default:               throw new ArgumentException("Invalid model.", "model");       }   }}

public abstract class Car { }

public class HyundaiCoupe : Car { }

public class HyundaiI30 : Car { }

public class MazdaMX5 : Car { }

public class Mazda6 : Car { }

</span></pre>
<h3 style="font-family:verdana;"><span style="font-size:85%;">Testing the Factory Method</span></h3>
<p style="font-family:verdana;"><span style="font-size:85%;">The above implementation of the factory method pattern can now be tested. The following sample code uses one of the factories to create a new Car object using a parameter that could have been selected by the player at run-time. When the object&#8217;s underlying type is outputted, we can see that the correct car subclass was selected.</span></p>
<p style="font-family:verdana;"><span style="font-size:85%;"><br /></span></p>
<pre style="font-family:verdana;"><span style="font-size:85%;">CarFactory hyundai = new HyundaiCarFactory();Car coupe = hyundai.CreateCar("coupe");Console.WriteLine(coupe.GetType());         <i>// Outputs "HyundaiCoupe"</i></span></pre>
<pre style="font-family:verdana;"><span style="font-size:85%;"></span></pre>
<p style="font-family:verdana;"><span style="font-size:85%;"><br /></span></p>
<p><span style="font-size:85%;"></p>
<p></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=38&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/07/30/factory-method-design-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Type Conversion with the &quot;As&quot; Operator</title>
		<link>http://csharpghost.wordpress.com/2008/07/30/c-type-conversion-with-the-as-operator/</link>
		<comments>http://csharpghost.wordpress.com/2008/07/30/c-type-conversion-with-the-as-operator/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 11:08:00 +0000</pubDate>
		<dc:creator>csharpghost</dc:creator>
				<category><![CDATA[as operator]]></category>
		<category><![CDATA[type conversion]]></category>

		<guid isPermaLink="false">http://csharpghost.wordpress.com/2008/07/30/c-type-conversion-with-the-as-operator/</guid>
		<description><![CDATA[Implicit casting occurs when an object is assigned as the value of a variable or method parameter. It happens if the target variable is of a compatible type that is higher in the inheritance hierarchy (a superclass), or is of an interface that is implemented by the object&#8216;s class, either directly or indirectly. In these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=3&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Implicit casting occurs when an <span style="color:blue;">object</span> <span style="color:blue;">is</span> assigned <span style="color:blue;">as</span> the value of a variable or method parameter. It happens <span style="color:blue;">if</span> the target variable <span style="color:blue;">is</span> of a compatible type <span style="color:teal;">that</span> <span style="color:blue;">is</span> higher <span style="color:blue;">in</span> the inheritance hierarchy (a superclass), or <span style="color:blue;">is</span> of an <span style="color:blue;">interface</span> <span style="color:teal;">that</span> <span style="color:blue;">is</span> implemented by the <span style="color:blue;">object</span><span style="color:maroon;">&#8216;s class, either directly or indirectly. In these cases, no additional work is required of the developer; the conversion happens automatically.</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:maroon;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Explicit casting must be used when the conversion <span style="color:blue;">is</span> <span style="color:blue;">in</span> the opposite direction to that required by <span style="color:blue;">implicit</span> casting. For example, when casting an <span style="color:blue;">object</span> to one of its subclasses or casting from an <span style="color:blue;">interface</span> <span style="color:teal;">to</span> a <span style="color:blue;">class</span>. To perform <span style="color:blue;">explicit</span> casting, the cast <span style="color:blue;">operator</span> <span style="color:blue;">is</span> used.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">class</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:teal;">Program</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">static</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">void</span> Main(<span style="color:blue;">string</span>[] args)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Subclass</span><span style="font-size:10pt;font-family:&quot;"> sub = <span style="color:blue;">new</span> <span style="color:teal;">Subclass</span>();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Superclass</span><span style="font-size:10pt;font-family:&quot;"> super = sub; <span style="color:green;">// Implicit cast</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Subclass</span><span style="font-size:10pt;font-family:&quot;"> sub2 = (<span style="color:teal;">Subclass</span>)super; <span style="color:green;">// Explicit cast</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">class</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:teal;">Superclass</span> { }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">class</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:teal;">Subclass</span> : <span style="color:teal;">Superclass</span> { }</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Explicit casting <span style="color:blue;">is</span> useful but can be problematic when the variable</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">being cast <span style="color:blue;">is</span> not compatible with the target type. In <span style="color:blue;">this</span> situation an</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">exception <span style="color:blue;">is</span> thrown. This can be demonstrated by modifying the contents of the Main method <span style="color:blue;">in</span> the previous example <span style="color:blue;">as</span> follows:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Superclass</span><span style="font-size:10pt;font-family:&quot;"> super = <span style="color:blue;">new</span> <span style="color:teal;">Superclass</span>();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Subclass</span><span style="font-size:10pt;font-family:&quot;"> sub = (<span style="color:teal;">Subclass</span>)super; <span style="color:green;">// Exception</span></span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">The <span style="color:maroon;">&#8220;as&#8221;</span> Operator</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">C# includes another method of performing explicit conversions. Using the &#8220;as&#8221; operator, an object can be converted from one type to another. Unlike with explicit casting, if the conversion is not possible because the types are incompatible the operation does not throw an exception. Instead, the resultant variable simply contains null.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Subclass sub = <span style="color:blue;">new</span> <span style="color:teal;">Subclass</span>();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Superclass</span><span style="font-size:10pt;font-family:&quot;"> super = sub;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Subclass</span><span style="font-size:10pt;font-family:&quot;"> sub2 = super <span style="color:blue;">as</span> <span style="color:teal;">Subclass</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;">Instead of throwing an exception, the target variable <span style="color:blue;">is</span> assigned the</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">null</span><span style="font-size:10pt;font-family:&quot;"> value. This can then be <span style="color:blue;">checked</span> <span style="color:blue;">for</span> and appropriate action taken.</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Superclass</span><span style="font-size:10pt;font-family:&quot;"> super = <span style="color:blue;">new</span> <span style="color:teal;">Superclass</span>();</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:teal;">Subclass</span><span style="font-size:10pt;font-family:&quot;"> sub = super <span style="color:blue;">as</span> <span style="color:teal;">Subclass</span>;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;text-align:justify;line-height:normal;"><span style="font-size:10pt;font-family:&quot;color:blue;">if</span><span style="font-size:10pt;font-family:&quot;"> (sub == <span style="color:blue;">null</span>)</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;line-height:115%;font-family:&quot;"><span> </span><span style="color:teal;">Console</span>.WriteLine(<span style="color:maroon;">&#8220;Incompatible!&#8221;</span>);<span> </span><span style="color:green;">// Outputs &#8220;Incompatible!&#8221;</span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/csharpghost.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/csharpghost.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/csharpghost.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/csharpghost.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/csharpghost.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/csharpghost.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/csharpghost.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/csharpghost.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/csharpghost.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/csharpghost.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=csharpghost.wordpress.com&amp;blog=4458389&amp;post=3&amp;subd=csharpghost&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://csharpghost.wordpress.com/2008/07/30/c-type-conversion-with-the-as-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/69adbee544f531ef528c1a141deb2052?s=96&#38;d=identicon" medium="image">
			<media:title type="html">csharpghost</media:title>
		</media:content>
	</item>
	</channel>
</rss>
