<?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>AashishGupta's Weblog</title>
	<atom:link href="http://ash143gupta.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ash143gupta.wordpress.com</link>
	<description>This blog is dedicated to Microsoft Technologies such as Asp.net,Aspnet Ajax,Silverlight,MVC,Linq,Azure.............</description>
	<lastBuildDate>Sat, 29 Nov 2008 05:36:06 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ash143gupta.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/dc474db01fbc4bb65878ce996e485317?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>AashishGupta's Weblog</title>
		<link>http://ash143gupta.wordpress.com</link>
	</image>
			<item>
		<title>Blogger Tips And Tricks:- Opening each link from your new Blogger blog in a new window</title>
		<link>http://ash143gupta.wordpress.com/2008/11/29/blogger-tips-and-tricks-opening-each-link-from-your-new-blogger-blog-in-a-new-window/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/29/blogger-tips-and-tricks-opening-each-link-from-your-new-blogger-blog-in-a-new-window/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 05:36:06 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[Blogger Tricks]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/29/blogger-tips-and-tricks-opening-each-link-from-your-new-blogger-blog-in-a-new-window/</guid>
		<description><![CDATA[If you want your visitors to stay for long on your blog and they should not navigate from your blog even if they are clicking any external links from your blog then this small trick is what you all need.
Opening the links in a new window will allow your visitors to return to your blog [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=67&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you want your visitors to stay for long on your blog and they should not navigate from your blog even if they are clicking any external links from your blog then this small trick is what you all need.</p>
<p>Opening the links in a new window will allow your visitors to return to your blog once they have read the information in the external link which you provided on your blog.Sometimes readers just simply forget your blogs name while they navigate through and then just don&#8217;t care to come back again.</p>
<p>So to provide an easy hand to your visitors this trick can be of help.</p>
<p><strong>Workaround</strong></p>
<ol>
<li>Just sign in to your blogger and navigate to Layouts Section.
<li>Under layouts just click Edit HTML link.
<li>Remeber to backup your existing template now so that you can rollback if you don&#8217;t like the changes.</li>
</ol>
<blockquote>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:b6879b3f-4421-4b31-9d58-7bec2f97ca24" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="329" src="http://lh6.ggpht.com/_UE1MjS8wccA/STDHDaUcX1I/AAAAAAAAAbM/k6TDVFfGXVk/s800/CropperCapture%5B2%5D.jpg" width="718"></p>
</div>
</blockquote>
<p>4.Now just search for the &lt;/head&gt; section in your blogger template.Remember to edit this template in firefox because it will allow you to search within the template rest all browsers which i have tested only search on the visible content on the page.</p>
<p>5.After you find &lt;/head&gt;.Just above it enter this exactly the same way it is given below.</p>
<blockquote><p>&lt;base target=&#8217; &amp;quot;_blank&amp;quot;&#8217;/&gt;</p>
<p>Here in my blog the html tags will be replaced by their tags and symbols so i have provide the image below on how you should add this so kindly do it the same way.</p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:aa68d0dc-9644-4e76-99cb-74879e48562e" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="329" src="http://lh5.ggpht.com/_UE1MjS8wccA/STDEn9-lvcI/AAAAAAAAAbI/9qNlWrb870s/s800/CropperCapture%5B1%5D.jpg" width="718"></p>
</div>
</blockquote>
<p>Remeber this is tested only for new blogger.I have not tested this myself for old blogger.</p>
<p>That&#8217;s all now save the template and see the changes now your every link will open up in a new window not in the same window in which&nbsp; your blog was opened.</p>
<p>If you have any doubts then do leave a comment.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=67&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/29/blogger-tips-and-tricks-opening-each-link-from-your-new-blogger-blog-in-a-new-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh6.ggpht.com/_UE1MjS8wccA/STDHDaUcX1I/AAAAAAAAAbM/k6TDVFfGXVk/s800/CropperCapture%5B2%5D.jpg" medium="image" />

		<media:content url="http://lh5.ggpht.com/_UE1MjS8wccA/STDEn9-lvcI/AAAAAAAAAbI/9qNlWrb870s/s800/CropperCapture%5B1%5D.jpg" medium="image" />
	</item>
		<item>
		<title>Google Calendar Sync for Windows Server 2003:-Install Google Calendar Sync on your Windows Server 2003 Systems</title>
		<link>http://ash143gupta.wordpress.com/2008/11/28/google-calendar-sync-for-windows-server-2003-install-google-calendar-sync-on-your-windows-server-2003-systems/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/28/google-calendar-sync-for-windows-server-2003-install-google-calendar-sync-on-your-windows-server-2003-systems/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 03:57:39 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/28/google-calendar-sync-for-windows-server-2003-install-google-calendar-sync-on-your-windows-server-2003-systems/</guid>
		<description><![CDATA[If you use Microsoft Outlook as a Desktop Client and want to synchronize your Google Calendar then you need to download and install Google Calendar Sync which can be downloaded here.
http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe
How to install this on Windows XP and Vista can be found here on this link
http://www.google.com/support/calendar/bin/answer.py?answer=89955
But if you are running Windows Server 2003 then this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=66&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you use Microsoft Outlook as a Desktop Client and want to synchronize your Google Calendar then you need to download and install Google Calendar Sync which can be downloaded here.</p>
<p><a title="http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe" href="http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe">http://dl.google.com/googlecalendarsync/GoogleCalendarSync_Installer.exe</a></p>
<p>How to install this on Windows XP and Vista can be found here on this link</p>
<p><a title="http://www.google.com/support/calendar/bin/answer.py?answer=89955" href="http://www.google.com/support/calendar/bin/answer.py?answer=89955">http://www.google.com/support/calendar/bin/answer.py?answer=89955</a></p>
<p>But if you are running Windows Server 2003 then this installer will fail and give an error stating that this can only be installed on Windows XP and Windows Vista operating Systems.</p>
<p><strong>Workaround</strong></p>
<ol>
<li>So the solution of this problem is just download a tool by microsoft called Application Verifier.
<li>Install this tool and just go to File -&gt;Add Application.
<li>Now add the Google Calendar Sync.exe to this and just fool the installer to think that it is going to install on Windows XP system.
<li>How to do this is explained here in this article remember it shows the workaround for Photoshop CS3 but you have to open the Google calendar Sync file.</li>
</ol>
<p><a title="http://smallworkarounds.blogspot.com/2008/09/installing-photoshop-cs3-on-windows.html" href="http://smallworkarounds.blogspot.com/2008/09/installing-photoshop-cs3-on-windows.html">http://smallworkarounds.blogspot.com/2008/09/installing-photoshop-cs3-on-windows.html</a></p>
<blockquote><p><strong>Just copy the below as same given in the above article -&nbsp;&nbsp;&nbsp; </strong></p>
<p><strong>Major Version &#8212; 5</strong></p>
<p><strong>Minor Version&#8212;- 1</strong></p>
<p><strong>Build Number &#8212;&nbsp; 2600</strong></p>
<p><strong>Service Pack Major &#8212; 2 </strong></p>
<p><strong>Service Pack Minor &#8212; 1</strong></p>
</blockquote>
<p>Now just click save and run the Google Calendar Sync.exe </p>
<p>Now it will just work fine.</p>
<p>I have not tested it for Windows Server 2008.Anyone who tested this trick please do leave a comment telling that is it working or not in WS2008.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=66&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/28/google-calendar-sync-for-windows-server-2003-install-google-calendar-sync-on-your-windows-server-2003-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>
	</item>
		<item>
		<title>FeedBurner only showing 25 feeds for Blogger blogs,How to get all my posts feed in feedburner</title>
		<link>http://ash143gupta.wordpress.com/2008/11/23/feedburner-only-showing-25-feeds-for-blogger-blogshow-to-get-all-my-posts-feed-in-feedburner/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/23/feedburner-only-showing-25-feeds-for-blogger-blogshow-to-get-all-my-posts-feed-in-feedburner/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 22:50:42 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[Blog Publishing]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/23/feedburner-only-showing-25-feeds-for-blogger-blogshow-to-get-all-my-posts-feed-in-feedburner/</guid>
		<description><![CDATA[Blogger&#8217;s atom.xml file by default contains only 25 latest posts and when we burn this file with feed burner then only these 25 posts are converted to feedburner feeds, so what if i want all my feeds to be burnt by feed burner and to be availiable as feeds to my subscribers.
Workaround

So the workaround for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=65&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Blogger&#8217;s atom.xml file by default contains only 25 latest posts and when we burn this file with feed burner then only these 25 posts are converted to feedburner feeds, so what if i want all my feeds to be burnt by feed burner and to be availiable as feeds to my subscribers.</p>
<p><strong>Workaround</strong></p>
<ol>
<li>So the workaround for this common problem is just go to your blogger homepage and do the View Source
<li>In view source you will find an entry saying &#8230;..Atom&#8221; href=<a href="http://www.blogger.com/feeds/....some no/posts/default">http://www.blogger.com/feeds/&#8230;.some no/posts/default</a>.Lets assume this no to be 12345678 so you will be having it like this&#8230;..Atom&#8221; href=&#8221;http://www.blogger.com/feeds/12345678/posts/default.Its also shown in the figure below. </li>
</ol>
<p>&nbsp;</p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:13c3d9c5-b55b-49f1-a352-8f7100642c34" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="238" src="http://lh5.ggpht.com/_UE1MjS8wccA/SSnaNFpLi6I/AAAAAAAAAac/shI6KZAYxW8/s800/CropperCapture%5B2%5D.jpg" width="640"></p>
</div>
<p>&nbsp;</p>
<p>3.Just copy that URL and add to its end ?max-results=100 so now your final URL will look like <a href="http://www.blogger.com/feeds/12345678/posts/default?max-results=100">http://www.blogger.com/feeds/12345678/posts/default?max-results=100</a>.</p>
<p>4.You can also replace this max-results =100 by 500 or 50 or by any no which blogger provides.</p>
<p>5.Also there is some limit on feedburner feeds size. its something around 500-550 KB&#8217;s so keep that also in mind before giving a very large no.</p>
<p>6.That&#8217;s all go to your feedburner account and add this url&nbsp; and then burn it now you will see that the no of feeds availiable are the one which you specified as the parameter.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=65&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/23/feedburner-only-showing-25-feeds-for-blogger-blogshow-to-get-all-my-posts-feed-in-feedburner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh5.ggpht.com/_UE1MjS8wccA/SSnaNFpLi6I/AAAAAAAAAac/shI6KZAYxW8/s800/CropperCapture%5B2%5D.jpg" medium="image" />
	</item>
		<item>
		<title>Custom DAL having functions which recieve StoredProcedure Name and SortedList having key/value pairs as parameters to reduce code duplicacy and redundant open() and close() sql Connection calls.</title>
		<link>http://ash143gupta.wordpress.com/2008/11/23/custom-dal-having-functions-which-recieve-storedprocedure-name-and-sortedlist-having-keyvalue-pairs-as-parameters-to-reduce-code-duplicacy-and-redundant-open-and-close-sql-connection-calls/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/23/custom-dal-having-functions-which-recieve-storedprocedure-name-and-sortedlist-having-keyvalue-pairs-as-parameters-to-reduce-code-duplicacy-and-redundant-open-and-close-sql-connection-calls/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 16:48:15 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/23/custom-dal-having-functions-which-recieve-storedprocedure-name-and-sortedlist-having-keyvalue-pairs-as-parameters-to-reduce-code-duplicacy-and-redundant-open-and-close-sql-connection-calls/</guid>
		<description><![CDATA[Mostly whenever we code an enterprise project we should follow the n-tier model and divide our project into various tiers.
Lets continue from the UI,so first tier is our UI ,from the UI we should we should make use of our Model layer objects which simply contains&#160; classes which map our requirements for the projects.
Now from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=64&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mostly whenever we code an enterprise project we should follow the n-tier model and divide our project into various tiers.</p>
<p>Lets continue from the UI,so first tier is our UI ,from the UI we should we should make use of our Model layer objects which simply contains&nbsp; classes which map our requirements for the projects.</p>
<p>Now from UI,we should create objects of Model Classes and pass these model classes to the Service class.This service class is nothing but it contains all the static functions which we require in our projects.Most of the application&#8217;s service logic is applied in these classes, or we can say that these classes serve the Model Objects behaviour.</p>
<p>Next comes the most important layer called Utility or some people might Directly call it DAL layer.</p>
<p>Anyways the function of this layer is to interact with the Service Layer on one hand and on the other hand fetch and persist result to the database either using ad-hoc queries or using the stored procedure logic.Given below is the representation of this n-tier project arichitecture</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:6e44af64-60d0-46f2-90d7-3e77f6b77002" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="300" src="http://lh4.ggpht.com/_UE1MjS8wccA/SSmIFgSoPCI/AAAAAAAAAZ4/trWx4wnTm6A/s800/CropperCapture%5B1%5D.jpg" width="300"></p>
</div>
<p>&nbsp;</p>
<p>In this article we will mainly concentrate on the DAL part or the last layer or tier in our architecture.In our model we are not using ad-hoc queries but only stored procedures.So we have developed a SqlHelper file which will recieve only the names of stored procedure and a sorted list having a key value pair of parameters which we will pass to the stored procedure.</p>
<p>This layer will also handle every opening and closing of the connection to the database.We generally return a reader from the database to any point in our code but here we don&#8217;t want to open and close connection in the application logic so we are converting the reader fetched from the database to the dataset and then finally returning the dataset in the application.</p>
<p>There are various functions used in order to achieve this logic i will describe here a few important ones.You can download the whole file which is attached at the end of this article.</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> DBExecuteNonQuery(<span style="color:#0000ff;">string</span> storedProcedure, SqlCommand command)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> <span style="color:#0000ff;">using</span> (var connection = <span style="color:#0000ff;">new</span> SqlConnection(ConnectionString))</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> connection.Open();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> command.CommandText = storedProcedure;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> command.Connection = connection;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> command.CommandType = CommandType.StoredProcedure;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> command.ExecuteNonQuery();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> }</pre>
</div>
</div>
<p>We are not using above function directly from the application service layers but it is being called from inside another sqlhelper function called <strong>&#8220;ConvertToSqlCommandForNonQuery&#8221;</strong> although it can be directly used but we want to follow our key,value transfer from the application thus we follow this pattern.So below given is our ConvertToSqlCommandForNonQuery function which takes stored procedure name and sortedlist as parameters,then it calls the DBExecuteNonQuery which we have seen just above after making a command out of the recieved SoretedList.</p>
<p>In this function we are also using a ConvertToSqlDBType function, it is used because the value we recieve as object and we now have to map the objects C# type to Sql Server Database type.So we have another function called ConvertToSqlDBType to achieve this.We will talk about it later.</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> ConvertToSqlCommandForNonQuery(<span style="color:#0000ff;">string</span> storedProcedure, SortedList&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">object</span>&gt; values)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> var command = <span style="color:#0000ff;">new</span> SqlCommand();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> <span style="color:#0000ff;">foreach</span> (var <span style="color:#0000ff;">value</span> <span style="color:#0000ff;">in</span> values)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> Type type = <span style="color:#0000ff;">value</span>.Value.GetType();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> SqlDbType sqlDBType = ConverToSqlDBType(type);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> command.Parameters.Add(<span style="color:#0000ff;">value</span>.Key, sqlDBType).Value = <span style="color:#0000ff;">value</span>.Value;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> DBExecuteNonQuery(storedProcedure, command);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> }</pre>
</div>
</div>
<div>&nbsp;</div>
<div>Usage of above function is give below here&nbsp; SaveCategory recieves a model layer object called Category which contains information about the Category newly added now to persist these changes to Database we call our SqlHelper files ConvertToSqlCommandForNonQuery function and pass the name of the stored procedure and the parameterlist to the function.</div>
<div>Remember that ConvertToSqlCommandForNonQuery is used only when we want to insert,update or delete functions.</div>
<div>&nbsp;</div>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> SaveCategory(Category category)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> var parameterList = <span style="color:#0000ff;">new</span> SortedList&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">object</span>&gt;();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> parameterList.Add(<span style="color:#006080;">"categoryName"</span>, category.CategoryName);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> SqlHelper.ConvertToSqlCommandForNonQuery(<span style="color:#006080;">"usp_SaveCategory"</span>, parameterList);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> }</pre>
</div>
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Similarly is the below given function called <strong>&#8220;DBExecuteScalar&#8221; </strong>it also takes a stored procedure name and a sortedlist as inputs and return the integer value.</div>
<div>This function also internally calls <strong>&#8220;DBExecuteScalar(string storedprocedurename,SqlCommand command)&#8221;</strong> like the above function</div>
<div>&nbsp;</div>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> Int32 DBExecuteScalar(<span style="color:#0000ff;">string</span> storedProcedure, SortedList&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">object</span>&gt; values)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> var command = <span style="color:#0000ff;">new</span> SqlCommand();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> <span style="color:#0000ff;">foreach</span> (var <span style="color:#0000ff;">value</span> <span style="color:#0000ff;">in</span> values)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> Type type = <span style="color:#0000ff;">value</span>.Value.GetType();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> SqlDbType sqlDBType = ConverToSqlDBType(type);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> command.Parameters.Add(<span style="color:#0000ff;">value</span>.Key, sqlDBType).Value = <span style="color:#0000ff;">value</span>.Value;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> <span style="color:#0000ff;">int</span> retValue = DBExecuteScalar(storedProcedure, command);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> <span style="color:#0000ff;">return</span> retValue;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 12:</span> }</pre>
</div>
</div>
<p>&nbsp;</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> Int32 DBExecuteScalar(<span style="color:#0000ff;">string</span> storedProcedure, SqlCommand command)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> Int32 <span style="color:#0000ff;">value</span> = 0;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> <span style="color:#0000ff;">using</span> (var connection = <span style="color:#0000ff;">new</span> SqlConnection(ConnectionString))</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> connection.Open();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> command.CommandText = storedProcedure;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> command.Connection = connection;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> command.CommandType = CommandType.StoredProcedure;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> <span style="color:#0000ff;">value</span> = (Int32) command.ExecuteScalar();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 12:</span> <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">value</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 13:</span> }</pre>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Third set of functions are the main functions which first convert the datareader returned from the stored procedure to the dataset and then return this dataset to the application.We can very well return the datareader to the application and then iterate till the end of the reader but we are not doing here because we dont want to carry the opened connection to the application or simply we want to limit the connection flow only to the DAL layer.</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> DataSet DBExecuteReader(<span style="color:#0000ff;">string</span> storedProcedure)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> SqlDataReader reader = <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> var command = <span style="color:#0000ff;">new</span> SqlCommand();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> <span style="color:#0000ff;">using</span> (var connection = <span style="color:#0000ff;">new</span> SqlConnection(ConnectionString))</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> connection.Open();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> command.CommandText = storedProcedure;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> command.Connection = connection;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> command.CommandType = CommandType.StoredProcedure;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> reader = command.ExecuteReader();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 12:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 13:</span> var dataSet = <span style="color:#0000ff;">new</span> DataSet();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 14:</span> <span style="color:#0000ff;">do</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 15:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 16:</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 17:</span> DataTable schemaTable = reader.GetSchemaTable();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 18:</span> var dataTable = <span style="color:#0000ff;">new</span> DataTable();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 19:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 20:</span> <span style="color:#0000ff;">if</span> (schemaTable != <span style="color:#0000ff;">null</span>)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 21:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 22:</span> <span style="color:#0000ff;">for</span> (<span style="color:#0000ff;">int</span> i = 0; i &lt; schemaTable.Rows.Count; i++)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 23:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 24:</span> DataRow dataRow = schemaTable.Rows[i];</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 25:</span> var columnName = (<span style="color:#0000ff;">string</span>) dataRow[<span style="color:#006080;">"ColumnName"</span>];</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 26:</span> var column = <span style="color:#0000ff;">new</span> DataColumn(columnName, (Type) dataRow[<span style="color:#006080;">"DataType"</span>]);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 27:</span> dataTable.Columns.Add(column);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 28:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 29:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 30:</span> dataSet.Tables.Add(dataTable);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 31:</span> <span style="color:#0000ff;">while</span> (reader.Read())</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 32:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 33:</span> DataRow dataRow = dataTable.NewRow();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 34:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 35:</span> <span style="color:#0000ff;">for</span> (<span style="color:#0000ff;">int</span> i = 0; i &lt; reader.FieldCount; i++)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 36:</span> dataRow[i] = reader.GetValue(i);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 37:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 38:</span> dataTable.Rows.Add(dataRow);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 39:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 40:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 41:</span> <span style="color:#0000ff;">else</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 42:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 43:</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 44:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 45:</span> var column = <span style="color:#0000ff;">new</span> DataColumn(<span style="color:#006080;">"RowsAffected"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 46:</span> dataTable.Columns.Add(column);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 47:</span> dataSet.Tables.Add(dataTable);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 48:</span> DataRow dataRow = dataTable.NewRow();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 49:</span> dataRow[0] = reader.RecordsAffected;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 50:</span> dataTable.Rows.Add(dataRow);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 51:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 52:</span> } <span style="color:#0000ff;">while</span> (reader.NextResult());</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 53:</span> <span style="color:#0000ff;">return</span> dataSet;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 54:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 55:</span> }</pre>
</div>
</div>
<p>&nbsp;</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> DataSet ConvertToSqlCommand(<span style="color:#0000ff;">string</span> storedProcedure, SortedList&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">object</span>&gt; values)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> var command = <span style="color:#0000ff;">new</span> SqlCommand();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> <span style="color:#0000ff;">foreach</span> (var <span style="color:#0000ff;">value</span> <span style="color:#0000ff;">in</span> values)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> Type type = <span style="color:#0000ff;">value</span>.Value.GetType();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> SqlDbType sqlDBType = ConverToSqlDBType(type);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> command.Parameters.Add(<span style="color:#0000ff;">value</span>.Key, sqlDBType).Value = <span style="color:#0000ff;">value</span>.Value; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> DataSet dataSet = DBExecuteReader(storedProcedure, command);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 12:</span> <span style="color:#0000ff;">return</span> dataSet;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 13:</span> }</pre>
</div>
</div>
<div>&nbsp;</div>
<div>Given below is the example of the <strong>&#8220;ConvertToSqlCommand&#8221; </strong>function.Here we are populating all the categories of a particular user.</div>
<div>&nbsp;</div>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> List&lt;Category&gt; PopulateUserCategory(<span style="color:#0000ff;">int</span> userID)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> var categoryList = <span style="color:#0000ff;">new</span> List&lt;Category&gt;();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> var parameterList = <span style="color:#0000ff;">new</span> SortedList&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">object</span>&gt;();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> parameterList.Add(<span style="color:#006080;">"@userID"</span>, userID);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> DataSet dataSet = SqlHelper.ConvertToSqlCommand(<span style="color:#006080;">"usp_GetAllCategoriesByUserID"</span>, parameterList);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> DataTable dataTable = dataSet.Tables[0];</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> <span style="color:#0000ff;">foreach</span> (DataRow dataRow <span style="color:#0000ff;">in</span> dataTable.Rows)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> var category = <span style="color:#0000ff;">new</span> Category();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> category.CategoryID = Convert.ToInt32(dataRow[<span style="color:#006080;">"CategoryID"</span>]);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 12:</span> category.CategoryName = Convert.ToString(dataRow[<span style="color:#006080;">"CategoryName"</span>]);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 13:</span> categoryList.Add(category);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 14:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 15:</span> <span style="color:#0000ff;">return</span> categoryList;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 16:</span> }</pre>
</div>
</div>
<p>&nbsp;</p>
<p>This is the <strong>&#8220;ConvertToSqlDBType&#8221;</strong>&nbsp; function which we use to convert C# types to SqlDBTypes.Given below are some common type conversions you can very well enhance this list and do whatever you feel like.</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> SqlDbType ConverToSqlDBType(Type systemType)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 3:</span> </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 4:</span> <span style="color:#0000ff;">switch</span> (systemType.Name)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 6:</span> <span style="color:#0000ff;">case</span> <span style="color:#006080;">"Int32"</span>:</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 7:</span> <span style="color:#0000ff;">return</span> SqlDbType.Int;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 8:</span> <span style="color:#0000ff;">case</span> <span style="color:#006080;">"String"</span>:</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 9:</span> <span style="color:#0000ff;">return</span> SqlDbType.NVarChar;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 10:</span> <span style="color:#0000ff;">case</span> <span style="color:#006080;">"DateTime"</span>:</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 11:</span> <span style="color:#0000ff;">return</span> SqlDbType.DateTime;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 12:</span> <span style="color:#0000ff;">case</span> <span style="color:#006080;">"Boolean"</span>:</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 13:</span> <span style="color:#0000ff;">return</span> SqlDbType.Bit;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 14:</span> <span style="color:#0000ff;">default</span>:</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 15:</span> <span style="color:#0000ff;">return</span> SqlDbType.VarChar;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 16:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;"> 17:</span> }</pre>
</div>
</div>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;"></div>
</div>
<div>&nbsp;</div>
<div><strong></strong></div>
<div><strong></strong></div>
<div><strong>Conclusion</strong></div>
<div>So above was an article on how to follow a layerd approach in an n-tier enterprise solution and this article also gave a small insight on how to handle Database calls from within the Data Access Layer and also how to efficiently opening and closing the database connection.</div>
<div>It also talked about the various functions which we have designed in order to talk to the database.</div>
<div>You are free to extend it and modify it according to your needs and use it inside your projects.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Uploaded Below is the <strong><u>SqlHelper.cs file</u> </strong>which achieves the desired result.</div>
<div><a title="http://cid-d3498dea37dde9b0.skydrive.live.com/self.aspx/Files/SqlHelper.cs" href="http://cid-d3498dea37dde9b0.skydrive.live.com/self.aspx/Files/SqlHelper.cs">http://cid-d3498dea37dde9b0.skydrive.live.com/self.aspx/Files/SqlHelper.cs</a></div>
<div></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=64&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/23/custom-dal-having-functions-which-recieve-storedprocedure-name-and-sortedlist-having-keyvalue-pairs-as-parameters-to-reduce-code-duplicacy-and-redundant-open-and-close-sql-connection-calls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh4.ggpht.com/_UE1MjS8wccA/SSmIFgSoPCI/AAAAAAAAAZ4/trWx4wnTm6A/s800/CropperCapture%5B1%5D.jpg" medium="image" />
	</item>
		<item>
		<title>JQuery with Asp.net and Visual Studio 2008 intellisense</title>
		<link>http://ash143gupta.wordpress.com/2008/11/22/jquery-with-aspnet-and-visual-studio-2008-intellisense-2/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/22/jquery-with-aspnet-and-visual-studio-2008-intellisense-2/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 09:33:02 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/22/jquery-with-aspnet-and-visual-studio-2008-intellisense-2/</guid>
		<description><![CDATA[Here is a small post on Jquery which is a far better alternative to Aspnet Ajax.Its a small JavaScript library with immense power and most widely used these days.A few months ago Microsoft announced that they will be shipping JQuery with Next Release of their Visual Studio i.e Visual Studio 2010.
Visual Studio 2010 and .net [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=63&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here is a small post on Jquery which is a far better alternative to Aspnet Ajax.Its a small JavaScript library with immense power and most widely used these days.A few months ago Microsoft announced that they will be shipping JQuery with Next Release of their Visual Studio i.e Visual Studio 2010.</p>
<p>Visual Studio 2010 and .net framework 4.0 Community Technology Preview are already available&nbsp; for download from </p>
<p><a title="http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&amp;displaylang=en</a></p>
<p>I am not sure about the intellisense support for JQuery and JavaScript in this new version but as Microsoft Promised they will surely ship it in their final release.</p>
<p>As for now with Visual Studio 2008 full intellisense for JQuery is achieved using a .vsdoc.js file.</p>
<p>&nbsp;</p>
<p><strong>Steps to follow to get full intellisense</strong></p>
<ol>
<li>Install this Hotfix which will fix many issues for Visual Studio Team Systems 2008 and also enable and enhance you script intellisense if somehow it is disabled or its not coming with many other fixes.
<p>Download Link :-<a title="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826" href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826">https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826</a></p>
<li>Jeff King has a very good post describing the second step here. </li>
</ol>
<blockquote><p><a title="http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx" href="http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx">http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx</a></p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:0ceb8cbd-b001-4f98-9577-52ceeb9e5a23" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="190" src="http://lh3.ggpht.com/_UE1MjS8wccA/SSfKrc5WtQI/AAAAAAAAAWI/bbOuFyNN43E/s800/CropperCapture%5B2%5D.jpg" width="600"></p>
</div>
<p>Here a hack is applied so there two files are given one is &#8220;jquery-1.2.6.js&#8221; another is &#8220;jquery-1.2.6-vsdoc.js&#8221;.So the first file is the actual Jquery file which should be downloaded on the clients browser along with the markup whereas second file should only be available while using intellisense inside the Visual Studio 2008.The markup comments shown above are achieving the same thing.</p>
<p>A very simple Visual Studio Solution is attached at the end of this post for you to see the architecture of how to include jquery files and how to do very basic things using Jquery in an aspx page having basic markup as HTML.</p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:a6fc3b51-6d49-469b-864f-1437ea1ac3cb" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="190" src="http://lh3.ggpht.com/_UE1MjS8wccA/SSfKqL7ncfI/AAAAAAAAAWA/wSzMuKi2ALQ/s800/CropperCapture%5B1%5D.jpg" width="290"></p>
</div>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:af59779a-b233-4c50-aa3d-703d832f6bc5" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="327" src="http://lh6.ggpht.com/_UE1MjS8wccA/SSfKwsk4OLI/AAAAAAAAAXg/4B5udQ8ZOoM/s800/CropperCapture%5B3%5D.jpg" width="800"></p>
</div>
</p>
<p>After following these steps you are now ready to start Jquery development in Asp.net</p>
<p>Download Source Code Here :-<a title="http://9wtpog.bay.livefilestore.com/y1pPZ0KF1m2F28wRGe4wQYrbDCyIuWruESEpdlcILrP_8rIkJfe2eTchl6iw6KSUMwRroVAQ2UvoCo/JqueryIntellisenseInstallation.rar?download" href="http://9wtpog.bay.livefilestore.com/y1pPZ0KF1m2F28wRGe4wQYrbDCyIuWruESEpdlcILrP_8rIkJfe2eTchl6iw6KSUMwRroVAQ2UvoCo/JqueryIntellisenseInstallation.rar?download">http://9wtpog.bay.livefilestore.com/y1pPZ0KF1m2F28wRGe4wQYrbDCyIuWruESEpdlcILrP_8rIkJfe2eTchl6iw6KSUMwRroVAQ2UvoCo/JqueryIntellisenseInstallation.rar?download</a></p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" id="scid:C16BAC14-9A3D-4c50-9394-FBFEF7A93539:9542aae4-b028-43e6-b6f7-c0a2bec79676" style="display:inline;margin:0;padding:0;"><!--dotnetkickit--></div>
</blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=63&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/22/jquery-with-aspnet-and-visual-studio-2008-intellisense-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_UE1MjS8wccA/SSfKrc5WtQI/AAAAAAAAAWI/bbOuFyNN43E/s800/CropperCapture%5B2%5D.jpg" medium="image" />

		<media:content url="http://lh3.ggpht.com/_UE1MjS8wccA/SSfKqL7ncfI/AAAAAAAAAWA/wSzMuKi2ALQ/s800/CropperCapture%5B1%5D.jpg" medium="image" />

		<media:content url="http://lh6.ggpht.com/_UE1MjS8wccA/SSfKwsk4OLI/AAAAAAAAAXg/4B5udQ8ZOoM/s800/CropperCapture%5B3%5D.jpg" medium="image" />
	</item>
		<item>
		<title>Adding LinkedIn Button To Blogger or WordPress or any other Blog</title>
		<link>http://ash143gupta.wordpress.com/2008/11/22/adding-linkedin-button-to-blogger-or-wordpress-or-any-other-blog-2/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/22/adding-linkedin-button-to-blogger-or-wordpress-or-any-other-blog-2/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 09:26:08 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[Blog Publishing]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/22/adding-linkedin-button-to-blogger-or-wordpress-or-any-other-blog-2/</guid>
		<description><![CDATA[Today i was trying to add a &#8220;LinkedIn&#8221; to my linked in profile button on Blogger.But it was not so easy.
You can directly embed the HTML and get the linked in image link if you want but for me it didn&#8217;t workde.Then i came to know that the linked in people themselves provide custom buttons [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=62&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today i was trying to add a &#8220;<strong>LinkedIn&#8221; </strong>to my linked in profile button on Blogger.But it was not so easy.</p>
<p>You can directly embed the HTML and get the linked in image link if you want but for me it didn&#8217;t workde.Then i came to know that the linked in people themselves provide custom buttons that you can add anywhere either to your blog or your websites.</p>
<p>But these custom button service is rather hidden ie not visible at the first sight.So i thought that it would be helpful if i share this post with you all.</p>
<p>Below i have given detailed description with images on how to add this linked in button to your blog.</p>
<p><strong>Steps:-</strong></p>
<ol>
<li><strong>Just go to <a href="http://www.linkedin.com/">http://www.linkedin.com/</a></strong> </li>
</ol>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:68b459ee-4f5f-4ea5-b477-069c8fce1564" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="573" src="http://lh4.ggpht.com/_UE1MjS8wccA/SSfLBh-m-8I/AAAAAAAAAXo/ioCYpxzhVXw/s800/CropperCapture%5B28%5D.jpg" width="800"></p>
</div>
<blockquote><p><strong>2.Sign into your profile</strong> </p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:76085e8a-e957-4306-a82d-1d8d74ab4458" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="310" src="http://lh5.ggpht.com/_UE1MjS8wccA/SSfLE6Xil6I/AAAAAAAAAXs/wL-hM7vOPi4/s800/CropperCapture%5B26%5D.jpg" width="800"></p>
</div>
</blockquote>
<ol>3.Goto public profile and click the edit button next to your public profile</ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol></ol>
<ol>4.Click on promote your profile add custom buttons link</ol>
<ol></ol>
<ol>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:834c715d-e253-4cb4-b98c-8696e6417a12" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="573" src="http://lh5.ggpht.com/_UE1MjS8wccA/SSfK6SL0GgI/AAAAAAAAAXk/h7a13WwO01w/s800/CropperCapture%5B27%5D.jpg" width="800"></p>
</div>
</ol>
<ol></ol>
<ol>5. Now you can see a lot of buttons and their respective code which you can directly paste into your blog.</ol>
<ol>
<div class="wlWriterSmartContent" id="scid:C16BAC14-9A3D-4c50-9394-FBFEF7A93539:3a516b98-1120-4c39-9a25-03a8035a7c56" style="display:inline;margin:0;padding:0;"><!--dotnetkickit--></div>
</ol>
<ol></ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=62&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/22/adding-linkedin-button-to-blogger-or-wordpress-or-any-other-blog-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh4.ggpht.com/_UE1MjS8wccA/SSfLBh-m-8I/AAAAAAAAAXo/ioCYpxzhVXw/s800/CropperCapture%5B28%5D.jpg" medium="image" />

		<media:content url="http://lh5.ggpht.com/_UE1MjS8wccA/SSfLE6Xil6I/AAAAAAAAAXs/wL-hM7vOPi4/s800/CropperCapture%5B26%5D.jpg" medium="image" />

		<media:content url="http://lh5.ggpht.com/_UE1MjS8wccA/SSfK6SL0GgI/AAAAAAAAAXk/h7a13WwO01w/s800/CropperCapture%5B27%5D.jpg" medium="image" />
	</item>
		<item>
		<title>Outlook 2007 Signatures:- Using custon HTML and styles in Signatures in Outlook 2007</title>
		<link>http://ash143gupta.wordpress.com/2008/11/22/outlook-2007-signatures-using-custon-html-and-styles-in-signatures-in-outlook-2007-2/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/22/outlook-2007-signatures-using-custon-html-and-styles-in-signatures-in-outlook-2007-2/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 09:14:47 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[Outlook 2007]]></category>
		<category><![CDATA[Outlook2007]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/22/outlook-2007-signatures-using-custon-html-and-styles-in-signatures-in-outlook-2007-2/</guid>
		<description><![CDATA[Outlook 2007 does not give the facility to put the custom HTML and styling in Signatures under the signatures box.




As you can see that by default when you edit your signatures you only have Delete New Save Rename Options.
And also a few options to insert image and some hyperlink but no support for any kind [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=61&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Outlook 2007 does not give the facility to put the custom HTML and styling in Signatures under the signatures box.</p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:67de3a33-d683-4bae-b936-aeef617a5d3d" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="369" src="http://lh3.ggpht.com/_UE1MjS8wccA/SSfLNHSzJGI/AAAAAAAAAX0/lk8YH8MzcVs/s800/CropperCapture%5B6%5D.jpg" width="800"></p>
</div>
<p>As you can see that by default when you edit your signatures you only have Delete New Save Rename Options.</p>
<p>And also a few options to insert image and some hyperlink but no support for any kind of custom editing of HTML and styles.</p>
<p>So what to do if you want to enter some custom HTML and do some styling to your signatures while using Outlook 2007.</p>
<p>Here is the workaround.</p>
<p><strong>WorkAround</strong></p>
</p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:cfcd4cb9-0662-41c4-8fba-203e39c164e1" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="440" src="http://lh3.ggpht.com/_UE1MjS8wccA/SSfLQeN-GxI/AAAAAAAAAXQ/DX01NXjdYsI/s800/CropperCapture%5B7%5D.jpg" width="800"></p>
</div>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:4bd13e69-4103-48b3-bb84-0e261f1c6f5b" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="440" src="http://lh5.ggpht.com/_UE1MjS8wccA/SSfLUJKhaUI/AAAAAAAAAXY/3u13hjlc3pk/s800/CropperCapture%5B8%5D.jpg" width="800"></p>
</div>
<p>Just Navigate to your <strong>&#8220;C:\Documents and Settings\(your_username)\Application Data\Microsoft\Signatures&#8221;.</strong></p>
<p><strong>Here Search for the htm file which will generally be starting with you Name.</strong></p>
<p><strong>Open this file in Notepad , Notepad++ and add whatever custom content you want to add.</strong></p>
</p>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:c2703e93-8a2c-4765-80bc-6965dbdffe3f" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="286" src="http://lh5.ggpht.com/_UE1MjS8wccA/SSfLIdyMDSI/AAAAAAAAAXw/CkNUajxs9Ms/s800/CropperCapture%5B5%5D.jpg" width="800"></p>
</div>
<p><strong>Click Save and you are done.</strong></p>
<p><strong>Open your Outlook Signatures Box to see that changes made by you are reflected or not.</strong></p>
<p>Send a mail to your another account to check whether your custom signatures are working or not.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=61&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/22/outlook-2007-signatures-using-custon-html-and-styles-in-signatures-in-outlook-2007-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_UE1MjS8wccA/SSfLNHSzJGI/AAAAAAAAAX0/lk8YH8MzcVs/s800/CropperCapture%5B6%5D.jpg" medium="image" />

		<media:content url="http://lh3.ggpht.com/_UE1MjS8wccA/SSfLQeN-GxI/AAAAAAAAAXQ/DX01NXjdYsI/s800/CropperCapture%5B7%5D.jpg" medium="image" />

		<media:content url="http://lh5.ggpht.com/_UE1MjS8wccA/SSfLUJKhaUI/AAAAAAAAAXY/3u13hjlc3pk/s800/CropperCapture%5B8%5D.jpg" medium="image" />

		<media:content url="http://lh5.ggpht.com/_UE1MjS8wccA/SSfLIdyMDSI/AAAAAAAAAXw/CkNUajxs9Ms/s800/CropperCapture%5B5%5D.jpg" medium="image" />
	</item>
		<item>
		<title>Visual Studio is missing default templates</title>
		<link>http://ash143gupta.wordpress.com/2008/11/22/visual-studio-is-missing-default-templates/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/22/visual-studio-is-missing-default-templates/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 06:44:14 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/22/visual-studio-is-missing-default-templates/</guid>
		<description><![CDATA[If your Visual Studio either VS2005 or VS2008 is missing some default tempates, or whenever you want to add any new item and click add new item you are surprise to find that either your add new WebForm is missing or any other similar item is missing from the add new item list then your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=60&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If your Visual Studio either VS2005 or VS2008 is missing some default tempates, or whenever you want to add any new item and click add new item you are surprise to find that either your add new WebForm is missing or any other similar item is missing from the add new item list then your templates defaults are corrupted due to some reasons or latest updates or patches or any other software which you have recently installed.</p>
<p><strong>Workaround</strong></p>
<p>So the workaround to this problem is:-</p>
<ol>
<li>Just go to the Visual Studio command prompt.
<li>Close all opened instances of Visual Studio
<li>Run this command <strong>devenv/installvstemplates </strong>on Visual Studio Command Prompt.
<li>And thats it all your templates will be set to defaults.</li>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=60&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/22/visual-studio-is-missing-default-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>
	</item>
		<item>
		<title>Want to transfer your post:- From Blogger to Blogger,Blogger to WordPress,LiveJournal to Blogger,Blogger To Windows Live Spaces all in all almost every blog.</title>
		<link>http://ash143gupta.wordpress.com/2008/11/18/want-to-transfer-your-post-from-blogger-to-bloggerblogger-to-wordpresslivejournal-to-bloggerblogger-to-windows-live-spaces-all-in-all-almost-every-blog/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/18/want-to-transfer-your-post-from-blogger-to-bloggerblogger-to-wordpresslivejournal-to-bloggerblogger-to-windows-live-spaces-all-in-all-almost-every-blog/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:41:15 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/18/want-to-transfer-your-post-from-blogger-to-bloggerblogger-to-wordpresslivejournal-to-bloggerblogger-to-windows-live-spaces-all-in-all-almost-every-blog/</guid>
		<description><![CDATA[If you want to transfer your posts from one blogging platform to another and are facing problems , then Paul Cooley has a very good application which he calls &#8220;Blog2Blog&#8221; which can do this for you very easily.
I have myself tested it for my blogger to blogger transfer and it works just fine.
Also in blogger [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=59&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you want to transfer your posts from one blogging platform to another and are facing problems , then Paul Cooley has a very good application which he calls <strong>&#8220;Blog2Blog&#8221;</strong> which can do this for you very easily.</p>
<p>I have myself tested it for my blogger to blogger transfer and it works just fine.</p>
<p>Also in blogger i was unable to find a safe way to transfer all the posts or selected posts to another blogger account.</p>
<p>But with this tool you can achieve the same easily.</p>
<p>You can download the tool from here:-</p>
<p><a title="http://www.paulcooley.com/linuxlore_blogstorage/apps/blog2blog/blog2blog-2.4.0.2.zip" href="http://www.paulcooley.com/linuxlore_blogstorage/apps/blog2blog/blog2blog-2.4.0.2.zip">http://www.paulcooley.com/linuxlore_blogstorage/apps/blog2blog/blog2blog-2.4.0.2.zip</a></p>
<p><strong>Instructions for using the tool</strong></p>
<ul>
<li><strong>Just Click the setup.exe and install the application.</strong>
<li><strong>Once installed it will open up an interface like this</strong> </li>
</ul>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:9a8bcb88-512a-4adf-be69-f7a321bd897b" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="379" src="http://lh6.ggpht.com/_UE1MjS8wccA/SSMlHDGmDMI/AAAAAAAAAU0/lD-Y03wa6_k/s800/CropperCapture%5B1%5D.jpg" width="640"></p>
</div>
<ul>
<li><strong>In select source select the blogging platform from which you want to import the posts.</strong>
<li><strong>Enter your username and password source-URL ex. <a href="http://smallworkarounds.blogspot.com">http://smallworkarounds.blogspot.com</a>.</strong>
<li><strong>Then for the source-API-URL especially in blogger if you are using old blogger then the defaults which will be coming will work.</strong>
<li><strong>But if you are on new blogger then you have to open your blog on the home page and do the view source.</strong>
<li><strong>In view source you can locate and entry which says &#8220;service.post&#8221; and there will be a link after that as shown below.</strong></li>
</ul>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:20718325-c45f-46b4-a8ad-1e8d28c0c79f" style="display:inline;float:none;margin:0;padding:0;">
<p><img style="border-right:2px;border-top:2px;border-left:2px;border-bottom:2px;" height="379" src="http://lh4.ggpht.com/_UE1MjS8wccA/SSMlL31dyAI/AAAAAAAAAU8/1KEPxvFcAnI/s800/CropperCapture%5B2%5D.jpg" width="640"></p>
</div>
<ul>
<li><strong>Just copy and paste that link to the source-API-URL and this is it your source is set up.</strong>
<li><strong>Remember that this trick is for new blogger only.</strong>
<li><strong>Once completed with all the above things just press fetch.</strong></li>
</ul>
<p><strong></strong>&nbsp;</p>
<ul>
<li><strong>After fetching is completed just repeat the same steps for your destination blog also.</strong>
<li><strong>Once you are done with your destination blog then just click publish.</strong>
<li><strong>And thats all you will see all the posts being published to your new blog.</strong></li>
</ul>
<p><strong>Thanks! for this great tool by &#8220;Paul Cooley&#8221;</strong></p>
<p><a href="http://linuxlore.blogspot.com/2007/09/livejournal-to-blogger-or-blogger-to.html">http://linuxlore.blogspot.com/2007/09/livejournal-to-blogger-or-blogger-to.html</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=59&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/18/want-to-transfer-your-post-from-blogger-to-bloggerblogger-to-wordpresslivejournal-to-bloggerblogger-to-windows-live-spaces-all-in-all-almost-every-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>

		<media:content url="http://lh6.ggpht.com/_UE1MjS8wccA/SSMlHDGmDMI/AAAAAAAAAU0/lD-Y03wa6_k/s800/CropperCapture%5B1%5D.jpg" medium="image" />

		<media:content url="http://lh4.ggpht.com/_UE1MjS8wccA/SSMlL31dyAI/AAAAAAAAAU8/1KEPxvFcAnI/s800/CropperCapture%5B2%5D.jpg" medium="image" />
	</item>
		<item>
		<title>C#&#8212;-When to use As Keyword in C#</title>
		<link>http://ash143gupta.wordpress.com/2008/11/17/c-when-to-use-as-keyword-in-c/</link>
		<comments>http://ash143gupta.wordpress.com/2008/11/17/c-when-to-use-as-keyword-in-c/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 20:46:59 +0000</pubDate>
		<dc:creator>ash143gupta</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://ash143gupta.wordpress.com/2008/11/17/c-when-to-use-as-keyword-in-c/</guid>
		<description><![CDATA[
As keyword is a hidden treasure in C# which most of us don&#8217;t use in our day today programming.
As keyword is used for the comparison of compatible types
Its general syntax is expression as type where expression is also a reference type and type is also a reference type.
Whenever there is nothing in the object instead [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=58&subd=ash143gupta&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><ol>
<li>As keyword is a hidden treasure in C# which most of us don&#8217;t use in our day today programming.
<li>As keyword is used for the comparison of <strong>compatible types</strong>
<li>Its general syntax is <strong>expression as type</strong> where expression is also a reference type and type is also a reference type.
<li>Whenever there is nothing in the object instead of complaining to user or throwing an exception it just returns &#8220;null&#8221; thus it doesn&#8217;t throw an exception.
<li>So when to use as keyword and when to use cast expression is a very important question indeed.
<li>Both have their individual significance.
<li>Whenever you do not want to raise any exception and you have already handled the returned <strong>null</strong> value condition then it&nbsp; is wiser to use <strong>&#8220;As&#8221; </strong>keyword.
<li>But when you want that whenever the object is null an exception should be raised and you are using exception handling then you always must use the same familier cast expressions.</li>
</ol>
<p>Given below is a small code snippet to demonstrate that:-</p>
<blockquote><p>&nbsp;</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">using</span> System;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> <span style="color:#0000ff;">namespace</span> Ramp.Test</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">class</span> Program</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> Main(<span style="color:#0000ff;">string</span>[] args)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>             var myObject = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">object</span>[3];</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>             myObject[0] = <span style="color:#0000ff;">new</span> Student();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>             myObject[1] = <span style="color:#0000ff;">new</span> Teacher();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>             myObject[2] = <span style="color:#006080;">"I love C#"</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>             <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">object</span> obj <span style="color:#0000ff;">in</span> myObject)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>             {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>                 <span style="color:#0000ff;">string</span> s = obj <span style="color:#0000ff;">as</span> <span style="color:#0000ff;">string</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>                 <span style="color:#0000ff;">if</span>(s!=<span style="color:#0000ff;">null</span>)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>                 Console.WriteLine(<span style="color:#006080;">"It is a string"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>                 <span style="color:#0000ff;">else</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>                 {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>                     Console.WriteLine(<span style="color:#006080;">"Its not a string"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>                 }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>                 Console.ReadLine();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>             }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>             </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> Student</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span>         </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  31:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  32:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> Teacher</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  33:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  34:</span>         </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  35:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  36:</span> }</pre>
</div>
</div>
</blockquote>
<p>&nbsp;</p>
<blockquote>
<p><strong>Output</strong></p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;">Its not a <span style="color:#0000ff;">string</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">Its not a <span style="color:#0000ff;">string</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;">Its a <span style="color:#0000ff;">string</span></pre>
</div>
</div>
</blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ash143gupta.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ash143gupta.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ash143gupta.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ash143gupta.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ash143gupta.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ash143gupta.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ash143gupta.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ash143gupta.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ash143gupta.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ash143gupta.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ash143gupta.wordpress.com&blog=4469831&post=58&subd=ash143gupta&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ash143gupta.wordpress.com/2008/11/17/c-when-to-use-as-keyword-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2eed35eeb3981da17e8d80841d4bdea?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">AashishGupta</media:title>
		</media:content>
	</item>
	</channel>
</rss>