<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://www.bassemfawzy.com/wp-atom.php">
	<title type="text">Bassem's</title>
	<subtitle type="text">My Window on the World "WonW"</subtitle>

	<updated>2009-05-22T22:43:50Z</updated>
	<generator uri="http://wordpress.org/" version="2.6.2">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://www.bassemfawzy.com" />
	<id>http://www.bassemfawzy.com/?feed=atom</id>
	

			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Bassems" /><feedburner:info uri="bassems" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[Visual Studio 2010 Beta 1 Released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/3emBmADF2mU/" />
		<id>http://www.bassemfawzy.com/?p=206</id>
		<updated>2009-05-22T22:43:50Z</updated>
		<published>2009-05-22T22:42:47Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Tech News" />		<summary type="html"><![CDATA[In case you haven&#8217;t heard yet which I doubt, Visual Studio 2010 Beta 1 was released. I think you should go to download it and give it a try. However don&#8217;t expect to find it perfect as it&#8217;s still the Beta 1. I still downloading it myself so I can&#8217;t give any indication on how [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=206">&lt;p&gt;In case you haven&amp;#8217;t heard yet which I doubt, &lt;strong&gt;Visual Studio 2010 Beta 1&lt;/strong&gt; was released. I think you should go to &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;download it&lt;/a&gt; and give it a try. However don&amp;#8217;t expect to find it perfect as it&amp;#8217;s still the Beta 1. I still downloading it myself so I can&amp;#8217;t give any indication on how the installation will go. Anyway It worth trying since sooner or later we will be using it so sooner is better.&lt;/p&gt;
&lt;p&gt;I have come thorugh two good introductory blog posts to the new features and enhancements for Visual studio and .net languages and thought of sharing with you.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/jasonz/archive/2009/05/18/announcing-vs2010-net-framework-4-0-beta-1.aspx"&gt;http://blogs.msdn.com/jasonz/archive/2009/05/18/announcing-vs2010-net-framework-4-0-beta-1.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/jasonz/archive/2009/05/22/vs2010-tutorial-build-a-wpf-app-with-beta-1.aspx"&gt;http://blogs.msdn.com/jasonz/archive/2009/05/22/vs2010-tutorial-build-a-wpf-app-with-beta-1.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3Ov4X3iN20E_SYFw3Blc4dQt6r8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3Ov4X3iN20E_SYFw3Blc4dQt6r8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3Ov4X3iN20E_SYFw3Blc4dQt6r8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3Ov4X3iN20E_SYFw3Blc4dQt6r8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/3emBmADF2mU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=206#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=206" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=206</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[Friday Tip 06, We love Visual Studio Intellisense, Lets love it more]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/ehbRPrvNBWA/" />
		<id>http://www.bassemfawzy.com/?p=185</id>
		<updated>2009-05-16T23:08:05Z</updated>
		<published>2009-05-16T00:14:36Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Friday Tip" />		<summary type="html"><![CDATA[We, Developers, love nothing in Visual Studio more than its intellisense, Right ?? Yes off course, I guess that&#8217;s my readers answer if they have been using visual studio for sometime.
why not, since it&#8217;s getting smarter, no lets say more intelligent with every release of Microsoft Visual Studio.
Today I&#8217;ll be discussing special area of VS [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=185">&lt;p&gt;We, Developers, love nothing in Visual Studio more than its intellisense, Right ?? Yes off course, I guess that&amp;#8217;s my readers answer if they have been using visual studio for sometime.&lt;/p&gt;
&lt;p&gt;why not, since it&amp;#8217;s getting smarter, no lets say more intelligent with every release of Microsoft Visual Studio.&lt;/p&gt;
&lt;p&gt;Today I&amp;#8217;ll be discussing special area of VS intellisense that VS 2008 brought to further make developers happier. That would be JavaScript intellisense along with the latest additions to the intellisense package which is &lt;strong&gt;Jquery Intellisense&lt;/strong&gt;.&lt;br /&gt;
&lt;strong&gt; There is more, &lt;/strong&gt;&lt;span id="more-185"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span style="color: #ff6600;"&gt;First: Javascrip Intellisense&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;Scripting javascript before VS 2008 and after in VS is totally different. You simpley get the power of scripting with the joy of intellisense rather than trying to remember what a particular method name is or even having your favorite search engine warmed up with javascript names searches.&lt;/p&gt;
&lt;p&gt;Either you script within your page or in a separate file you will get the intellisense like below&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/javascript-intellisense1.jpg"&gt;&lt;img class="aligncenter size-medium wp-image-186" title="javascript-intellisense1" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/javascript-intellisense1-296x300.jpg" alt="" width="296" height="300" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;What about your own javascript ?? For sure you need intellisense for javascript you wrote in separate javascript files to be seen from pages or even other javascript files. You got that too. In below screens I have a javascript file &amp;#8220;main.js&amp;#8221; that has function called ShowLove(). You can see in the second screen that I can see it from my aspx page and all I needed is to add a refernce to the js file like we all used to.:&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/intellisense2.jpg"&gt;&lt;img class="aligncenter size-full wp-image-187" title="intellisense2" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/intellisense2.jpg" alt="" width="440" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/intellisense3.jpg"&gt;&lt;img class="aligncenter size-full wp-image-188" title="intellisense3" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/intellisense3.jpg" alt="" width="500" height="420" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;I know You are smart enough and had noticed the help tip &amp;#8220;Show love alert&amp;#8221;. if you went back to the method declartion you will notice the documentation line in the begining of the method body. Remember you of something ?? Didn&amp;#8217;t I tell you that you are smart, that&amp;#8217;s right the XML documentation in our .net code and off course it has the same functionality of providing help to whom consuming your methods. But remember in .net we write our XML comments before method or class declaration where in Javascript we write them at the begining of methods. In the refernces at the end of the article you will find a great article about javascript intellisense comments to get more about them.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;Now, what about calling javascript written in javascript file from another javascript file? To do this you will need to refernce your source javascript file at the begining of your destination file &amp;#8220;where you want to call that javascript&amp;#8221; and the syntax is simple as below:&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/intellisense4.jpg"&gt;&lt;img class="aligncenter size-full wp-image-189" title="intellisense4" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/intellisense4.jpg" alt="" width="500" height="274" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;If you are not installing &lt;a href="http://msdn.microsoft.com/en-us/vstudio/cc533448.aspx"&gt;VS 2008 SP1&lt;/a&gt; the above example won&amp;#8217;t work for you until installing this &lt;a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=14883&amp;amp;wa=wsignin1.0"&gt;HotFix&lt;/a&gt;. I will recommend you to install the SP1 which we will need for the other part of this article &lt;strong&gt;Jquery Intellisense.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;The fun doesn&amp;#8217;t stop here, Actually the fun will just start with the second part of this article &amp;#8220;just below&amp;#8221; so lets have fun &amp;#8230;&lt;/p&gt;
&lt;h3 style="text-align: left;"&gt;&lt;span style="color: #ff6600;"&gt;Second: Jquery Intellisense&lt;/span&gt;&lt;/h3&gt;
&lt;p style="text-align: left;"&gt;If you have been a web developer for a while, for sure you have come acrross &lt;a href="http://jquery.com/"&gt;Jquery &lt;/a&gt;and moreover you may have become a fan like most of us. Since I assume you already know what Jquery is lets not talk about it and get to our point. Afterall we all know how light, delight, effictive, easy, powerfull and time saving javascript utility is Jquery. Microsoft knew it as well and that&amp;#8217;s why they decided to add Jquery Intellisense for Visual Studion with collaboration of Jquery team.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;To use this great addition to Intellisense, you will need the following :&lt;/p&gt;
&lt;p style="text-align: left;"&gt;1- Download and install &lt;a href="http://msdn.microsoft.com/en-us/vstudio/cc533448.aspx"&gt;VS 2008 SP1&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;2- Downloa and install this &lt;a href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736"&gt;patch&lt;/a&gt; to support vsdococ.js files.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;3- Download &lt;a href="http://docs.jquery.com/Downloading_jQuery"&gt;Jquery and Jquery-vsdoc.js files&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;After you finished add Jquery file along with the vsdoc file in the same directory&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/jquery.jpg"&gt;&lt;img class="aligncenter size-full wp-image-190" title="jquery" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/jquery.jpg" alt="" width="195" height="85" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;Make a reference to your jquery in your page or javascript file and have fun getting Jquery intellisense in your visual studio&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/jquery2.jpg"&gt;&lt;img class="aligncenter size-full wp-image-194" title="jquery2" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/jquery2.jpg" alt="" width="337" height="262" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 style="text-align: left;"&gt;&lt;span style="color: #ff6600;"&gt;Some Tips&lt;/span&gt;&lt;/h3&gt;
&lt;p style="text-align: left;"&gt;While enjoing javascript and jquery intellisense in Visual Studio I came through few tips that I&amp;#8217;ll share with you. They can simply save you sometime in one busy day  when tiny little things become invisible.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;1- when using Master Page that is not in the same directory as its content page and you want to write javascript inside that page, you will need to change your javascript/jaquery refernce to represent how master page see your javascript/jquery at develpment time which is opposed to run time. consider the below file structure&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/structurte.jpg"&gt;&lt;img class="aligncenter size-full wp-image-191" title="structurte" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/structurte.jpg" alt="" width="215" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;To be able to use intellisense from that master page your javascript refernce will be like below&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/reference1.jpg"&gt;&lt;img class="aligncenter size-full wp-image-192" title="reference1" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/reference1.jpg" alt="" width="499" height="22" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;However for your javascript to run in the browser you will need to update your javascript refernce since master pages are not actually pages and rendered as part of their content pages.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/05/reference2.jpg"&gt;&lt;img class="aligncenter size-full wp-image-193" title="reference2" src="http://www.bassemfawzy.com/wp-content/uploads/2009/05/reference2.jpg" alt="" width="500" height="28" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;2- Make sure that the vsdoc file has exactly the same name as the jquery file plus -vsdoc.js. I say that because the latest version of jsdoc to download from jquery site ends with vsdoc2.js which you need to convert to jsdoc.js to work. Moreover to use the minified version of jquery you will need to remove min part from the name.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;3- Sometimes The intellisense doesn&amp;#8217;t work immediatly so you may need to give a cariage return to start writing on a new line so that visual studio can bring you intellisense. so when ever you get this situation, you may close and reopen your page or js file and start writing on a new line. I don&amp;#8217;t have a logical explanation for this situation but I have come through it several times and that&amp;#8217;s how it worked out with me.&lt;/p&gt;
&lt;p style="text-align: left;"&gt;Below are some reference articles that you will find great and provide more explantions :&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intellisense.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intellisense.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx"&gt;http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p style="text-align: left;"&gt;
&lt;p&gt;This Post is on &lt;a href="http://www.codeproject.com/script/Articles/BlogArticleList.aspx?amid=3079188" rel="tag"&gt;  codeproject  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-HHUZoh3rYQ5LccMZZkcipe8H1U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-HHUZoh3rYQ5LccMZZkcipe8H1U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-HHUZoh3rYQ5LccMZZkcipe8H1U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-HHUZoh3rYQ5LccMZZkcipe8H1U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/ehbRPrvNBWA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=185#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=185" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=185</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[What makes a good browser ?]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/vEUJcEcjGhQ/" />
		<id>http://www.bassemfawzy.com/?p=168</id>
		<updated>2009-05-02T19:41:06Z</updated>
		<published>2009-05-02T19:33:13Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Misc" />		<summary type="html"><![CDATA[As I was exploring my google reader for something interesting among the tens of feeds am subscribing to I have found an interesting feed regarding Browsers. I found the Google Chrome Channel on Youtube. It simply contains tens of short films about browsers and how users see or need to see in browsers they use [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=168">&lt;p&gt;As I was exploring my google reader for something interesting among the tens of feeds am subscribing to I have found an interesting feed regarding Browsers. I found the Google Chrome Channel on Youtube. It simply contains tens of short films about browsers and how users see or need to see in browsers they use everyday.. The channel promotes Google Chrome in an light innovative way. The channel allows for user subscriptions for short movies as well.&lt;br /&gt;
&lt;object width="480" height="295"&gt;&lt;param name="movie" value="http://www.youtube-nocookie.com/v/5535Ts-iOP0&amp;#038;hl=en&amp;#038;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube-nocookie.com/v/5535Ts-iOP0&amp;#038;hl=en&amp;#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;Here is the &lt;a href="http://www.youtube.com/googlechrome"&gt;Chrome Shorts Channel&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PFfdM4jiIy2Jud3KHv-Xzw5zdr0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PFfdM4jiIy2Jud3KHv-Xzw5zdr0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PFfdM4jiIy2Jud3KHv-Xzw5zdr0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PFfdM4jiIy2Jud3KHv-Xzw5zdr0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/vEUJcEcjGhQ" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=168#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=168" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=168</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[Friday Tip 05, Execute As &#8230; Revert]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/ukKDLcLEyl8/" />
		<id>http://www.bassemfawzy.com/?p=164</id>
		<updated>2009-05-02T13:30:46Z</updated>
		<published>2009-05-02T13:24:37Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Friday Tip" /><category scheme="http://www.bassemfawzy.com" term="excecute revert" /><category scheme="http://www.bassemfawzy.com" term="execute as" /><category scheme="http://www.bassemfawzy.com" term="sqlserver execute as" />		<summary type="html"><![CDATA[This Friday tip is a fast small tip that could save some developers or even  sqlserver administrators some time and give them more flexibility if they do not already know  it. You all may have passed through a situation when you needed to create a sqlserver  login with specific set of permissions. [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=164">&lt;p&gt;This Friday tip is a fast small tip that could save some developers or even  sqlserver administrators some time and give them more flexibility if they do not already know  it. You all may have passed through a situation when you needed to create a sqlserver  login with specific set of permissions. Moreover you must have used to test  those permission after creating that user. Before sqlserver 2005 and even after  it for a plenty of time I used to reconnect to sql server with that user to be  able to test it.&lt;/p&gt;
&lt;p&gt;Sqlserver 2005 came with a handy statement that allows you to change your  execution context to a different user and then revert to your original login  without leaving your query window.&lt;/p&gt;
&lt;p&gt;Suppose you logged to your database as an administrator and created a user  named &lt;strong&gt;TestMe &lt;/strong&gt;who have a permission to select from a table named  &lt;strong&gt;QueryMe .&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To test this user, all you need to do is using the &lt;strong&gt;Execute As&lt;/strong&gt; statement and then &lt;strong&gt;Revert &lt;/strong&gt;to your original admin login when  done like below.&lt;/p&gt;
&lt;pre class="brush:sql"&gt;
Execute As user = 'TestMe'

Select * from QueryMe

Revert
&lt;/pre&gt;
&lt;p&gt;Easy and Fast, Right ?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1jhrwYGv57K_VC7DEzg2NNgH4Q8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1jhrwYGv57K_VC7DEzg2NNgH4Q8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1jhrwYGv57K_VC7DEzg2NNgH4Q8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1jhrwYGv57K_VC7DEzg2NNgH4Q8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/ukKDLcLEyl8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=164#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=164" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=164</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[Blog the way you like with SyntaxHighlighter]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/KVk6snK-dC8/" />
		<id>http://www.bassemfawzy.com/?p=156</id>
		<updated>2009-04-29T23:11:00Z</updated>
		<published>2009-04-29T22:59:24Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Development" />		<summary type="html"><![CDATA[I got to tell you that I had no intention to blog today. Moreover It&#8217;s 1:30 am and I got to be deeply sleeping as I have to get early for work. well this is a lovely summer Egyptian night that pushed me to write even a small hint.
If you are a blogger you must [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=156">&lt;p&gt;I got to tell you that I had no intention to blog today. Moreover It&amp;#8217;s 1:30 am and I got to be deeply sleeping as I have to get early for work. well this is a lovely summer Egyptian night that pushed me to write even a small hint.&lt;/p&gt;
&lt;p&gt;If you are a blogger you must have come through the problem of posting your own code on your blog in approximately the same format or colors you wrote it. I ran throught the same problem when tried to past some c# from Visual Studio to my wordpress post few times in the past. Sometimes I had no time to look for a solution or even was lazy enough to work around it by giving my code different color from post text to highlight it. In my last Post about &lt;a href="http://www.bassemfawzy.com/development/c-sharp-yield-statement/"&gt;C# yield statement&lt;/a&gt; I decided to take a break and find a good solution for this problem. when I post a piece of code I want it to be clear enough to any reader. I give a try on google and immediately drove me to &lt;a href="http://code.google.com/p/syntaxhighlighter/"&gt;Syntax Highlighter&lt;/a&gt; . Syntax highlighter is a great javascript utility that doesn&amp;#8217;t depend on whatever language or technology your blog use. It supports highlighting for many languages including javascript, C#, C++, Css and &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes"&gt;much more&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;Implementation is so easy, after downloading&lt;/p&gt;
&lt;p&gt;1-unzip the file&lt;/p&gt;
&lt;p&gt;2-upload folders &amp;#8220;javascript and css&amp;#8221; to your server.&lt;/p&gt;
&lt;p&gt;3-add the required references in your page to the css and javascript files.&lt;/p&gt;
&lt;p&gt;4- Tag the code segment you want with &lt;strong&gt;Pre &lt;/strong&gt;tag with desired brush/ language you want.&lt;/p&gt;
&lt;p&gt;You can find the simple implementation steps &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter:Usage"&gt;Detailed Here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then you will enjoy reading your posts the same way you wrote them.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Lzwg3bt0MoIxzrfjF54SoOzKzmo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lzwg3bt0MoIxzrfjF54SoOzKzmo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Lzwg3bt0MoIxzrfjF54SoOzKzmo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lzwg3bt0MoIxzrfjF54SoOzKzmo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/KVk6snK-dC8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=156#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=156" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=156</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[C# 2.0 Yield Statement, You will like it.]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/aygwjAzvoHY/" />
		<id>http://www.bassemfawzy.com/?p=141</id>
		<updated>2009-04-29T22:44:20Z</updated>
		<published>2009-04-27T20:54:45Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Development" />		<summary type="html"><![CDATA[If you are a new to c# development and just started learning c# or even started with version 2 of the language, propabilities are high that you know what Yield statement is. The same propabilities are there if you are a real geek who enjoys the taste of new technologies in their Beta versions. If [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=141">&lt;p&gt;If you are a new to c# development and just started learning c# or even started with version 2 of the language, propabilities are high that you know what &lt;strong&gt;Yield &lt;/strong&gt;statement is. The same propabilities are there if you are a real geek who enjoys the taste of new technologies in their Beta versions. If you are like me and started c# about 5 or 6 years ago with its first version and find work situations forces you in direction you haven&amp;#8217;t expected or planned for, you may find this statement new and yet lovely.&lt;/p&gt;
&lt;p&gt;Well, from time to time I give myself a break to get some of this rapidly growing language, after all C# 4 is on doors. As I was reading about some of c# features that I couldn&amp;#8217;t get a chance to use I found the &lt;strong&gt;Yield&lt;/strong&gt; Statement.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Yield &lt;/strong&gt;statement allows you to return Items from an enumerator while keeping its state. In other terms if you have a method that returns an Enumerator of certain object you can call that method several times each time the method starting where it was stopped. You can think of it as  a static variable or even a cursor for Enumerators. K don&amp;#8217;t go away, I know you are just like me and need an example so let&amp;#8217;s see.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; There is more, &lt;/strong&gt;&lt;span id="more-141"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class="brush:csharp"&gt;class Program

private static IEnumerable&amp;lt;string&amp;gt; HelloYield()
{
for (int i = 0; i &amp;lt; 4; i++)
{
if (i == 0)
yield return "Ok Bassem \r\n";
else if (i == 1)
yield return "I got It \r\n";
else if (i == 2)
yield return "And I liked it \r\n";
else
yield break;
}

}

static void Main(string[] args)
{
foreach (string piece in HelloYield())
Console.WriteLine(piece);
}
}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/04/yield.jpg"&gt;&lt;img class="aligncenter size-full wp-image-142" title="yield" src="http://www.bassemfawzy.com/wp-content/uploads/2009/04/yield.jpg" alt="" width="499" height="299" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see this simple console application uses the &lt;strong&gt;yield&lt;/strong&gt; statement. The method &lt;strong&gt;HelloYield()&lt;/strong&gt; returns an Enumerator of strings depending on the value of i. In the application start &amp;#8220;Main method&amp;#8221; I just loop through that Enumerator and display that string value. Note the way the method is called and imagine if the HelloYield() method was written without yield. If that was the case, each time the method is called it will initialize i variable and you will have to maintain its state yourself.&lt;/p&gt;
&lt;p&gt;A last thing to mention is that yield is used in two forms:&lt;/p&gt;
&lt;p&gt;either &lt;strong&gt;yield return &lt;/strong&gt;or &lt;strong&gt;yield break. &lt;/strong&gt;Just as you would expect &lt;strong&gt;yield return &lt;/strong&gt; is used to return a value of the enumerator and &lt;strong&gt;yield break&lt;/strong&gt; to end execution of the method.&lt;/p&gt;
&lt;p&gt;Hope you liked it, Did you ?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/U9AB_k2IbW8gF8fFzkOk0StCNQk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U9AB_k2IbW8gF8fFzkOk0StCNQk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/U9AB_k2IbW8gF8fFzkOk0StCNQk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U9AB_k2IbW8gF8fFzkOk0StCNQk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/aygwjAzvoHY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=141#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=141" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=141</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[My worst weekend ever]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/-KyIGp1cqwU/" />
		<id>http://www.bassemfawzy.com/?p=135</id>
		<updated>2009-04-20T22:33:47Z</updated>
		<published>2009-04-20T22:18:46Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Personal" />		<summary type="html"><![CDATA[It was a 2 days weekend plus 2 days vacation. A sum of 4 days make you put a plan of either Business Or  pleasure. For me it was a one day of fun and 3 of study. well I had the fun part and that&#8217;s good. For the study part, It never happened. I [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=135">&lt;p&gt;It was a 2 days weekend plus 2 days vacation. A sum of 4 days make you put a plan of either Business Or  pleasure. For me it was a one day of fun and 3 of study. well I had the fun part and that&amp;#8217;s good. For the study part, It never happened. I got my Laptop and PC broken in the same day. what made it worse is that I mistakenly formatted All my Laptop hard drives, yup I couldn&amp;#8217;t believe it myself as well and it was a shock. you know the rest, I spent my days trying fixing my PC which still dead and installing everything on my laptop. I still somehow see it as an &lt;strong&gt;Evil Eye&lt;/strong&gt; so take care every body &lt;img src='http://www.bassemfawzy.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /&gt; .&lt;/p&gt;
&lt;p&gt;Some of you may think why I would write this stupid post, come on I have to share my misery with you not only my knowledge plus It&amp;#8217;s my Blog and I can write whatever I want &lt;img src='http://www.bassemfawzy.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /&gt; .&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/C9wYNstYDdBAwoVSJlFHc3NLnss/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C9wYNstYDdBAwoVSJlFHc3NLnss/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/C9wYNstYDdBAwoVSJlFHc3NLnss/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C9wYNstYDdBAwoVSJlFHc3NLnss/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/-KyIGp1cqwU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=135#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=135" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=135</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[Friday Tip 04, Behind Asp.net Sqlserver sesssions]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/Ron0ytRZ3pk/" />
		<id>http://www.bassemfawzy.com/?p=114</id>
		<updated>2009-05-15T14:59:56Z</updated>
		<published>2009-04-18T14:09:48Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Friday Tip" />		<summary type="html"><![CDATA[ASP.Net developers have been using sessions for state management since asp.net released and on a daily bases in their applications. However most developers use sessions as its default mode moreover others don&#8217;t know about these modes at all. Today I&#8217;ll recap the different types of session states and discuss in details one important type &#8220;Sqlserver [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=114">&lt;p&gt;ASP.Net developers have been using sessions for state management since asp.net released and on a daily bases in their applications. However most developers use sessions as its default mode moreover others don&amp;#8217;t know about these modes at all. Today I&amp;#8217;ll recap the different types of session states and discuss in details one important type &amp;#8220;Sqlserver sessions&amp;#8221; that would be necessary to know about when working on big applications that require web farm deployment.&lt;/p&gt;
&lt;h2&gt;&lt;span style="color: #ff6600;"&gt;Asp.net session state modes:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;1- Inproc (default)&lt;/p&gt;
&lt;p&gt;2- Out Of Proc / State Server&lt;/p&gt;
&lt;p&gt;3- SqlServer&lt;/p&gt;
&lt;p&gt;session states can be configured from web.config under sessionstate node as follows&lt;span style="color: #cc99ff;"&gt;&lt;br /&gt;
&lt;code&gt; &lt;span style="color: #ff0000;"&gt; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&amp;lt;sessionState mode=&amp;#8221;InProc&amp;#8221;&amp;gt;&lt;br /&gt;
&amp;lt;/sessionState&amp;gt;&lt;br /&gt;
&amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; There is more, &lt;/strong&gt;&lt;span id="more-114"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style="color: #ff6600;"&gt;Sqlserver Session mode&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Sqlserver mode for session although is not the fastest way to store sessions is sometimes an important when it comes to big applications that implement web farms since the INPROC mode won&amp;#8217;t be approperiate, why? Imagine that you have a web farm composed of 2 servers A and B. A user had made a request to your web site and was directed to Server A, then that user made another request which was handled through Server B. In that case the INPROC mode is not approperiate since that user session will be held on one server while his request on another which can&amp;#8217;t access his session info. hence the need for shared place to hold sessions.&lt;/p&gt;
&lt;h2&gt;&lt;span style="color: #ff6600;"&gt;Installing Sqlserver session DataBase&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Asp.net is shipped with script that allow you to install the sessions Database. You can find this script in this directory &lt;span style="color: #ff0000;"&gt;Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Moreover Asp.net 2 is shipped with a command line tool that allow you to install / uninstall that database with different options. Using this tool is more recommended by Microsoft than using the scripts which exist for backword compatibility.&lt;/p&gt;
&lt;p&gt;To launch this toll,&lt;/p&gt;
&lt;p&gt;From Start menu Open your visual studio 2005/ 2008 &amp;gt; Visual Studio tools &amp;gt; Visual Studio Command Prompt&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/04/command1.jpg"&gt;&lt;img class="aligncenter size-medium wp-image-117" title="command1" src="http://www.bassemfawzy.com/wp-content/uploads/2009/04/command1-300x171.jpg" alt="" width="300" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The command window will appear, The command line tool is called &lt;strong&gt;Aspnet_Regsql &lt;/strong&gt;so just write Aspnet_Reqsql -? and you will get the help for that tool to know all parameters you need to pass.&lt;/p&gt;
&lt;p&gt;Note: This tool has many functionalities than just installing the asp.net session database. You can also use it to install membership, enable and disable sql cache dependancy. provide the required parameters and click enter to install the database. (the paranmeters include server, login credentials and the operation you want, Add / Remove the database).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/04/command2.jpg"&gt;&lt;img class="aligncenter size-full wp-image-119" title="command2" src="http://www.bassemfawzy.com/wp-content/uploads/2009/04/command2.jpg" alt="" width="499" height="299" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;&lt;span style="color: #ff6600;"&gt;Persist VS Temporary &lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;You may have noticed that there are two sql scripts for session database in the .netframe work directory named InstallPersistSqlState, InstallSqlState.sql . So what is the difference ?! Sqlserver sessions can be temporary or persistent . The temporary sessions are sotored in the TempDB rather than in Aspstate database. On the other hand the persistant sessions exist in the AspState Database. The Temp one is faster when writing and reading sessions becauase operations are not logged but the session data lost if the sqlserver goes down for any reason while the persistant one keeps its data.&lt;/p&gt;
&lt;p&gt;The Aspnet_regsql tool gives you the option to install whatever type you want by passing the approperiate value to the &lt;strong&gt;sstype &lt;/strong&gt;parameter.&lt;/p&gt;
&lt;h2&gt;&lt;span style="color: #ff6600;"&gt;Now, What&amp;#8217;s Behind ?&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;When you finish installing the database it creates 2 tables, Punch of stored procedures and one sql job.&lt;/p&gt;
&lt;h4&gt;Tables&lt;/h4&gt;
&lt;h4&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/04/session-tables.jpg"&gt;&lt;img class="aligncenter size-full wp-image-125" title="session-tables" src="http://www.bassemfawzy.com/wp-content/uploads/2009/04/session-tables.jpg" alt="" width="486" height="288" /&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;For the first while the above 2 tables have no significant relation between each other but that&amp;#8217;s not true. each asp.net application has an application Id and each application has multiple sessions but how this is maintained since no relation exist. If you noticed, the sessionsId in AspstateTempsessions is a 32 bytes of which the first 24 are for sessionId and the last 8 are the ApplicationId. However the value of the AppId in The AspstateTempApplications table is in Decimal Format where where in the AspstateTempSessions stored in HexaDecimal. You can try It yourself, Copy the AppId of The AspStateTempApplications Table and &lt;a href="http://www.statman.info/conversions/hexadecimal.html"&gt;Convert It to Hexadecimal&lt;/a&gt; and compare it with last 8 characters of the SessionId in the AspstateTempSessions table.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="color: #ff6600;"&gt;Note:&lt;/span&gt; This is a bit of usefull information cause you can use it  to share sessions among multiple asp.net applications. You will simply make sure to use one static AppId for all appplications.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;Stored Procedures&lt;/h4&gt;
&lt;h4&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/04/session-storedprocedures.jpg"&gt;&lt;img class="aligncenter size-full wp-image-126" title="session-storedprocedures" src="http://www.bassemfawzy.com/wp-content/uploads/2009/04/session-storedprocedures.jpg" alt="" width="281" height="385" /&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;I won&amp;#8217;t goto detail every single stored procedure However I can highlight important ones. It&amp;#8217;s obvious to have insert and update procedures to insert and update existing sessions. for the delete the &lt;strong&gt;DeleteExpiredSessions &lt;/strong&gt;stored procedure is used and I&amp;#8217;ll discuss it when discussing the job below. another procedure that you will need to know about is the &lt;strong&gt;TempGetAppID &lt;/strong&gt;which you will need to edit if you want to unify your applications IDs.&lt;/p&gt;
&lt;h4&gt;JOB&lt;/h4&gt;
&lt;p&gt;Only one sql job is created with the ASPSATE database. this job is responsible for deleting all expired sessions from the database.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bassemfawzy.com/wp-content/uploads/2009/04/session-job.jpg"&gt;&lt;img class="aligncenter size-full wp-image-127" title="session-job" src="http://www.bassemfawzy.com/wp-content/uploads/2009/04/session-job.jpg" alt="" width="291" height="47" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This job consists of only one step that call the stored procedure &lt;strong&gt;DeleteExpiredSessions &lt;/strong&gt;to clear the database from expired sessions. This stored procedure is simple, it just check the current DateTimeand delete all session rows that has its expires field exceeded that DateTime.&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #ff0000;"&gt;CREATE PROCEDURE [dbo].[DeleteExpiredSessions]&lt;br /&gt;
AS&lt;br /&gt;
DECLARE @now datetime&lt;br /&gt;
SET @now = GETUTCDATE()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #ff0000;"&gt;DELETE [ASPState].dbo.ASPStateTempSessions&lt;br /&gt;
WHERE Expires &amp;lt; @now&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #ff0000;"&gt;RETURN 0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: #ff6600;"&gt;Note:&lt;/span&gt;&lt;/strong&gt; When using sqlserver mode for sessions all objects stored in sessions have to be serializable (that can be serialized and deserialized).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Although the need for developers to interact with the SessionState database is not actually a case but it&amp;#8217;s powerful to know how it works and looks like for furthere complicated needs that business cases may put developers in.&lt;/p&gt;
&lt;p&gt;Hope It was clear enough and added alittle bit to your knowledge.&lt;br /&gt;
This Post is on &lt;a href="http://www.codeproject.com/script/Articles/BlogArticleList.aspx?amid=3079188" rel="tag"&gt;  codeproject  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9FSeQqz26usqz_Io9h4x1ULSUA0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9FSeQqz26usqz_Io9h4x1ULSUA0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9FSeQqz26usqz_Io9h4x1ULSUA0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9FSeQqz26usqz_Io9h4x1ULSUA0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/Ron0ytRZ3pk" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=114#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=114" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=114</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[Friday Tip 03, OLEDB Provider against sqlserver database, A tiny worthy Tip.]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/TLSikaWmtgo/" />
		<id>http://www.bassemfawzy.com/?p=110</id>
		<updated>2009-04-11T20:54:49Z</updated>
		<published>2009-04-11T20:52:34Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Friday Tip" />		<summary type="html"><![CDATA[This is not precisely Friday nevertheless I&#8217;m writing my Friday Tip which I couldn&#8217;t do yesterday. For me Late is better than never, for you who were waiting , If any, my apology.
Back to our today tip, As you all may know we can use an OLEDB data provider to connect to sql server although [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=110">&lt;p&gt;This is not precisely Friday nevertheless I&amp;#8217;m writing my Friday Tip which I couldn&amp;#8217;t do yesterday. For me Late is better than never, for you who were waiting , If any, my apology.&lt;/p&gt;
&lt;p&gt;Back to our today tip, As you all may know we can use an OLEDB data provider to connect to sql server although the preferred and more efficient way is using a sqlserver data provider which we all in 2009 do, I guess. However if you haven&amp;#8217;t got a chance to work with an old developed application for maintainance, solving bugs or even adding a new functionality as I had let me tell you some people used to use an OLEDB with sqlserver. No they were not idiots since one reason for doing that is creating one Data Access Layer that can work with diffrent data sources say sqlserver and Access.&lt;/p&gt;
&lt;p&gt;Anyway our Tip is as follows&lt;strong&gt; when using an OLEDB data provider with sqlserver you would have to make sure that you add the sql parameters in the same order they appear in your stored procedure when calling it from your .net application. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Why is that ? BECAUSE OLEDBs use what is known as &lt;strong&gt;parametrized queries&lt;/strong&gt; which use parameters order rather than their names as opposed to stored procedures.&lt;/p&gt;
&lt;p&gt;Now believe me when I say the lack of this simple tip can cost some developers hours solving a simple bug in an old application as they will find no reasonable cause for the failure from their own point of view off course and .net won&amp;#8217;t aid them with any descriptive error message.&lt;/p&gt;
&lt;p&gt;For me It took about 10 mintues 2 years ago when I faced that situation, see one tiny tip can save you hours.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ljt0uK80hcYpnGSRf4Zh5LLMUcs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ljt0uK80hcYpnGSRf4Zh5LLMUcs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ljt0uK80hcYpnGSRf4Zh5LLMUcs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ljt0uK80hcYpnGSRf4Zh5LLMUcs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/TLSikaWmtgo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=110#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=110" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=110</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Bassem</name>
					</author>
		<title type="html"><![CDATA[IIS 6 Problem,uuh, and confusing error message]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bassems/~3/J3SIGxHZCo8/" />
		<id>http://www.bassemfawzy.com/?p=106</id>
		<updated>2009-04-08T10:56:15Z</updated>
		<published>2009-04-08T07:28:54Z</published>
		<category scheme="http://www.bassemfawzy.com" term="Development" />		<summary type="html"><![CDATA[Last night a colleague was trying to setup a new website on a new server. A 5 minutes job, Right? Yup but It wasn&#8217;t. As we all now creating a new website on IIS is as easy as few known steps. However what he got was unexpected. After finishing the setup he tried to browse [...]]]></summary>
		<content type="html" xml:base="http://www.bassemfawzy.com/?p=106">&lt;p&gt;Last night a colleague was trying to setup a new website on a new server. A 5 minutes job, Right? Yup but It wasn&amp;#8217;t. As we all now creating a new website on IIS is as easy as few known steps. However what he got was unexpected. After finishing the setup he tried to browse the site which always returned this page can&amp;#8217;t be displayed page. As you may think he though it&amp;#8217;s an IIS problem. well, he did everything you may have to think of including, restarting IIS, Checking IIS configuration, the right .net framework installed, &amp;#8230; etc. Any way he called me to figure a solution together. Our first step then was to check the windows event viewer which keeps track of all system and applications errors. To be honest, what we got from the error text in the event viewer was much confusing than an aid. Here is the error message in the event viewer&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #ff0000;"&gt;&lt;em&gt;Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d6968e, faulting module kernel32.dll, version 5.2.3790.4062, stamp 46264680, debug? 0, fault address 0&amp;#215;0000bee7.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #ff0000;"&gt;&lt;em&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;for the first while you would think that it&amp;#8217;s something related to the .netframework or even windows installation. After several trials and googling we got nothing. well I tried to think out of the box and ignore that error message. knowing that the website we were installing is back ended on sqlserver, I turned my eyes to sqlserver and guess what, It was the right direction to look at.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I figured that the NETWORKSERVICE builtin IIS account lacked the required permissions on the database and the solution was quite simple as giving it these permissions.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;well Although The problem solved I still don&amp;#8217;t know why didn&amp;#8217;t I get the friendly &lt;em&gt;CRASH YELLOW PAGE  &lt;img src='http://www.bassemfawzy.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /&gt; &lt;/em&gt;instead of this ambiguous error.&lt;/p&gt;
&lt;p&gt;If you didn&amp;#8217;t get much knowledge from this article, it would be a great lesson to learn how to expect the unexpected and to remember that some solutions may be very well not reasonable when you think traditionally.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it for today, Got to go to work.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ew7BdJ1JydTbVw1VPzst0N9RALY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ew7BdJ1JydTbVw1VPzst0N9RALY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ew7BdJ1JydTbVw1VPzst0N9RALY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ew7BdJ1JydTbVw1VPzst0N9RALY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bassems/~4/J3SIGxHZCo8" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://www.bassemfawzy.com/?p=106#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.bassemfawzy.com/?feed=atom&amp;p=106" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.bassemfawzy.com/?p=106</feedburner:origLink></entry>
	</feed>
