<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-10554145</id><updated>2011-12-15T05:54:23.403+03:00</updated><title type='text'>.NET ShortCut</title><subtitle type='html'>.NET Tips &amp; Tricks .........</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10554145.post-6934015974669396469</id><published>2007-05-06T22:59:00.000+03:00</published><updated>2007-05-06T23:00:05.447+03:00</updated><title type='text'>Blog Moved</title><content type='html'>i moved to &lt;a href="http://blogs.msdn.com/HusseinA"&gt;http://blogs.msdn.com/HusseinA&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-6934015974669396469?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blogs.msdn.com/HusseinA' title='Blog Moved'/><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/6934015974669396469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=6934015974669396469' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/6934015974669396469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/6934015974669396469'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2007/05/blog-moved.html' title='Blog Moved'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-116445312143619428</id><published>2006-11-25T14:12:00.000+03:00</published><updated>2006-11-25T14:12:01.490+03:00</updated><title type='text'></title><content type='html'>&lt;H4&gt;&lt;FONT color=#000080&gt;Why BTS 2006 Host Process can be Clustered ?&lt;/FONT&gt;&lt;/H4&gt;&lt;br /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;High Availability in BTS is provided using host instances in the same Biztalk Server group . so why do we need to Cluster BTS Host Process ?&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;FONT color=#800000&gt;&lt;STRONG&gt;1- Concurrency&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;Problem Statement :&amp;nbsp; If an adapter handlers running inside an unclustered&amp;nbsp;host process , this means that this adapter is running simultaneously on all the host instances. so let's say that all instances are accessing a shared resource , so we have a concurrency violation access issue here .&lt;/P&gt;&lt;br /&gt;&lt;P&gt;a typical example is FTP Adapter that is using FTP Protocol : so if all instances are accessing the same FTP location using FTP protocol , this will lead to concurrency problems since FTP protocol doesnt put any locks on the accessed files. &lt;/P&gt;&lt;br /&gt;&lt;P&gt;solution : make the FTP adapter clustered so we got high availability and in the same time , removing concurrency issues.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;FONT color=#800000&gt;&lt;STRONG&gt;2- Ordered Delivery&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;Problem Statement : in case of MSMQ adapter for example : it delivers the messages in the order that messages have been received . so if we have two MSMQ running in two host instances we might lose this order delivery behaviour.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;Solution : make only one adapter running at a time and getting high availability for that adapter by clustering the adapter.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;for how to Implement the Clustering Itslef : &lt;A href="http://www.microsoft.com/technet/prodtechnol/biztalk/2006/library/bts06clustering/cd301e18-ca9a-4b33-b57d-f03bff750521.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/biztalk/2006/library/bts06clustering/cd301e18-ca9a-4b33-b57d-f03bff750521.mspx&lt;/A&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-116445312143619428?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/116445312143619428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=116445312143619428' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116445312143619428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116445312143619428'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/11/why-bts-2006-host-process-can-be.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-116359968656084945</id><published>2006-11-15T17:08:00.000+03:00</published><updated>2006-11-15T17:08:06.606+03:00</updated><title type='text'></title><content type='html'>&lt;H4&gt;&lt;FONT color=#000080&gt;How To change the Database Server Location and DB Names for BizTalk Server&lt;/FONT&gt;&lt;/H4&gt;&lt;br /&gt;&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN lang=NO-BOK style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN lang=NO-BOK style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Foe BizTalk Server 2004: &lt;A title=blocked::http://msdn.microsoft.com/library/default.asp?url=/library/en-us/operations/htm/ebiz_ops_backuprestore_prqu.asp href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/operations/htm/ebiz_ops_backuprestore_prqu.asp"&gt;&lt;FONT color=#800080&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/operations/htm/ebiz_ops_backuprestore_prqu.asp&lt;/FONT&gt;&lt;/A&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN lang=NO-BOK style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;For BizTalk Server 2006: &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=#800080 size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;A title=blocked::http://msdn2.microsoft.com/en-us/library/aa559835.aspx href="http://msdn2.microsoft.com/en-us/library/aa559835.aspx"&gt;&lt;SPAN lang=NO-BOK title=blocked::http://msdn2.microsoft.com/en-us/library/aa559835.aspx&gt;http://msdn2.microsoft.com/en-us/library/aa559835.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-116359968656084945?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/116359968656084945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=116359968656084945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116359968656084945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116359968656084945'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/11/how-to-change-database-server-location.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-116297315800028303</id><published>2006-11-08T11:05:00.000+03:00</published><updated>2006-11-08T11:07:14.480+03:00</updated><title type='text'></title><content type='html'>&lt;H4&gt;&lt;FONT color=#000080&gt;Never ever change snk files during development&lt;/FONT&gt;&lt;/H4&gt;&lt;br /&gt;&lt;P&gt;assembly 1 is signed with snk 1 . alot of apps are using assembly 1. a developer for some reasons created a new snk file and resigned the assembly and redeployed it. i know that all of us know that all apps will not work. but this really happens alot with developers. i faced it alot with my developers in the last month so i decided to write about it.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;snk is not a configuration that we can change . think about it like a critical change where all the behaviours of the application will change.&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-116297315800028303?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/116297315800028303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=116297315800028303' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116297315800028303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116297315800028303'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/11/never-ever-change-snk-files-during.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-116048748948730516</id><published>2006-10-10T16:38:00.000+03:00</published><updated>2006-10-10T16:38:15.696+03:00</updated><title type='text'></title><content type='html'>&lt;H4 align=left xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;FONT color=#000080&gt;&amp;nbsp;WSS Web Parts vs ASP.NET 2.0 Web Parts&lt;/FONT&gt;&lt;/H4&gt;&lt;br /&gt;&lt;P align=left xmlns="http://www.w3.org/1999/xhtml"&gt;a good comparison between WSS web parts and ASP.NET 2.0 web parts is here by Ted Pattison : &lt;A href="http://pluralsight.com/blogs/ted/archive/2005/06/01/9697.aspx"&gt;http://pluralsight.com/blogs/ted/archive/2005/06/01/9697.aspx&lt;/A&gt;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-116048748948730516?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/116048748948730516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=116048748948730516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116048748948730516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116048748948730516'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/10/wss-web-parts-vs-asp.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-116048652037694839</id><published>2006-10-10T16:22:00.000+03:00</published><updated>2006-10-10T16:22:00.430+03:00</updated><title type='text'></title><content type='html'>&lt;P&gt;&lt;FONT color=#000080&gt;&lt;STRONG&gt;msdn wiki has been released&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;A href="http://msdnwiki.microsoft.com"&gt;http://msdnwiki.microsoft.com&lt;/A&gt;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-116048652037694839?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/116048652037694839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=116048652037694839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116048652037694839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/116048652037694839'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/10/msdn-wiki-has-been-released.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-115894571841728714</id><published>2006-09-22T20:21:00.000+03:00</published><updated>2006-10-10T12:44:41.250+03:00</updated><title type='text'></title><content type='html'>&lt;h1&gt;&lt;span style="font-size:130%;color:#000080;"&gt;BizTalk Rules Parameters not Appearing in CallRules Shape in Orchestration :&lt;/span&gt;&lt;/h1&gt;&lt;br /&gt;&lt;p&gt;i spend some quite time figuring out what was the problem , so i would like to share this with everyone.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;after i created a rule in Biztalk rule composer , i created an orchestration with a callrules shape that points to the rule i created , but no properties appear in the window. i want to add a message as an input .&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Solution :  the "fully qualified name" for schema must = document type for a fact&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1- go to the schema1.xsd file that you have created initially and built your facts on &lt;/p&gt;&lt;br /&gt;&lt;p&gt;2- highlight the .xsd file in solution explorer&lt;/p&gt;&lt;br /&gt;&lt;p&gt;3- copy the "fully qualified name" property value from the properties window&lt;/p&gt;&lt;br /&gt;&lt;p&gt;4- goto your vocabularies&lt;/p&gt;&lt;br /&gt;&lt;p&gt;5- create a fact based on XML schema &lt;/p&gt;&lt;br /&gt;&lt;p&gt;6- in the fact definition window , in the document type property : paste the "fully qualified name"&lt;/p&gt;&lt;br /&gt;&lt;p&gt;if you have already published your vocabulary , copy and create a new version , and then create new rules based on the new vocabulary . you will notice the vocabulary version in the properties window&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-115894571841728714?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/115894571841728714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=115894571841728714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/115894571841728714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/115894571841728714'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/09/biztalk-rules-parameters-not-appearing.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114651204556855829</id><published>2006-05-01T22:34:00.000+03:00</published><updated>2006-05-01T22:34:05.606+03:00</updated><title type='text'>I love this Feature, I really love it</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;Aspnet_regiis -ga MachineName\user1&lt;/p&gt;&lt;p class="mobile-post"&gt;This command gives user1 privileges to access the IIS metabase . In short it&lt;br /&gt;gives this account permissions so it can now be an identity of an&lt;br /&gt;application pool in IIS .&lt;br /&gt;In v1.1 we don't have this switch (-ga) . So I used to grant all the rights&lt;br /&gt;and permissions manually ...&lt;/p&gt;&lt;p class="mobile-post"&gt;I love the ga switch :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114651204556855829?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114651204556855829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114651204556855829' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114651204556855829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114651204556855829'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/05/i-love-this-feature-i-really-love-it.html' title='I love this Feature, I really love it'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114597696881173681</id><published>2006-04-25T17:56:00.000+03:00</published><updated>2006-04-25T17:56:09.446+03:00</updated><title type='text'>Referencing 2 versions of the same DLL at the same time</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;I need this feature in VB&lt;br /&gt;,Pleeeeeeeaaaaaaaaassssssseeeeeeeeeeeeeeeeeeeeeeeeeeee&lt;br /&gt;Only C# has this feature nowwwwwwwww  :(&lt;/p&gt;&lt;p class="mobile-post"&gt;You can do this in C# :&lt;br /&gt;Csc /r:ver1=assembly1.dll /r:ver2=c:\assembly1.dll myapp.cs&lt;/p&gt;&lt;p class="mobile-post"&gt;Here is a sample of myapp.cs file&lt;br /&gt;extern alias ver1;&lt;br /&gt;extern alias ver2;&lt;/p&gt;&lt;p class="mobile-post"&gt;using System;&lt;/p&gt;&lt;p class="mobile-post"&gt;	class MyApp&lt;br /&gt;	{&lt;br /&gt;		static void Main(string[] args)&lt;br /&gt;		{&lt;br /&gt;			Console.WriteLine(ver1::MyLibrary.Class1.Test());&lt;/p&gt;&lt;p class="mobile-post"&gt;			Console.WriteLine(ver2::MyLibrary.Class1.Test());&lt;br /&gt;	      }&lt;br /&gt;	}&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114597696881173681?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114597696881173681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114597696881173681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114597696881173681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114597696881173681'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/referencing-2-versions-of-same-dll-at.html' title='Referencing 2 versions of the same DLL at the same time'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114579469068316782</id><published>2006-04-23T15:18:00.000+03:00</published><updated>2006-04-23T15:18:11.676+03:00</updated><title type='text'>Connection Pooling</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;This is a very interesting funny notice :&lt;br /&gt;Connection Strings must be IDENTICAL . so what is new ?&lt;/p&gt;&lt;p class="mobile-post"&gt;Conn1 :  "Server=SQL01;Database=AdventureWorks;Integrated&lt;br /&gt;Security=SSPI;Pooling=true"&lt;br /&gt;Conn2 :  "Server=SQL01;Database=AdventureWorks;Integrated Security=SSPI&lt;br /&gt;;Pooling=true"&lt;/p&gt;&lt;p class="mobile-post"&gt;These are not identical since the second connection string has a SPACE after&lt;br /&gt;the word SSPI, so they generate two different pools.you can examine that by&lt;br /&gt;SQL Profiler .&lt;br /&gt;It is very interesting ha . &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114579469068316782?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114579469068316782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114579469068316782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114579469068316782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114579469068316782'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/connection-pooling.html' title='Connection Pooling'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114570711282534701</id><published>2006-04-22T14:58:00.000+03:00</published><updated>2006-04-22T14:58:32.866+03:00</updated><title type='text'>Connection Pooling Series or parallel ?</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;If we have a connection like this :&lt;/p&gt;&lt;p class="mobile-post"&gt;Conn1 :  "Server=SQL01;Database=AdventureWorks;Integrated&lt;br /&gt;Security=SSPI;Pooling=true;Min Pool Size=100"&lt;/p&gt;&lt;p class="mobile-post"&gt;Are the 100 connections created in series(one after the other) or&lt;br /&gt;parallel(all nearly at the same time) ?&lt;br /&gt;To avoid Flooding the Database with Connections they are created in series .&lt;br /&gt;You can check that by executing the above connection and notice the&lt;br /&gt;"starttime" column in Profiler , you will notice in the profiler that they&lt;br /&gt;are opened serially after each other by fractions of seconds.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114570711282534701?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114570711282534701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114570711282534701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114570711282534701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114570711282534701'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/connection-pooling-series-or-parallel.html' title='Connection Pooling Series or parallel ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114540793230868159</id><published>2006-04-19T03:52:00.000+03:00</published><updated>2006-04-19T03:52:12.346+03:00</updated><title type='text'>Why do I have to press CTRL+ALT+DELETE to logon</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;Why don't the logon screen just appears directly without having to press&lt;br /&gt;this combination ?&lt;br /&gt;As Keith Brown says in his book "A .NET Developer's Guide to Windows&lt;br /&gt;Security" . Always Asking the user for his password trains the user to&lt;br /&gt;always type his password whenever asked. And since it can be any&lt;br /&gt;malicious code asking the user for his password so logon screens must be&lt;br /&gt;kept to minimal.&lt;br /&gt;The Sequence of CTRL+ALT+DELETE can only be traced by Kernel mode , so&lt;br /&gt;this is a clear message from the user to the OS that "I need to type my&lt;br /&gt;password to logon". This Sequence cannot be tracked by user mode. So try&lt;br /&gt;seriously to use the logon user account instead of asking him.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114540793230868159?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114540793230868159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114540793230868159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114540793230868159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114540793230868159'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/why-do-i-have-to-press-ctrlaltdelete.html' title='Why do I have to press CTRL+ALT+DELETE to logon'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114536489164010336</id><published>2006-04-18T15:54:00.000+03:00</published><updated>2006-04-18T15:54:51.690+03:00</updated><title type='text'>VB VB VB</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;Unfortunately I still see some developers and architects see that VB is&lt;br /&gt;untrustable and you still cant do a lot of things using VB, I would say to&lt;br /&gt;those people "please read the Developer Division Manager Somasegar's blog&lt;br /&gt;entry" http://blogs.msdn.com/somasegar/archive/2004/08/01/204540.aspx&lt;/p&gt;&lt;p class="mobile-post"&gt;And you can read also the Man behind VB's Blog entry : &lt;br /&gt;http://www.panopticoncentral.net/archive/2004/05/31/1100.aspx&lt;/p&gt;&lt;p class="mobile-post"&gt;I hope you completely change your mind now specially when you know that a&lt;br /&gt;lot of .NET 2.0 classes have been written entirely with VB as well as the VB&lt;br /&gt;engine itself and parts of the VS IDE.&lt;/p&gt;&lt;p class="mobile-post"&gt;The comparison between C# and VB.NET now becomes like "which of my 2 eyes I&lt;br /&gt;like better " as SomaSegar has said .i really like this phrase&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114536489164010336?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114536489164010336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114536489164010336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114536489164010336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114536489164010336'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/vb-vb-vb.html' title='VB VB VB'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114531470541032240</id><published>2006-04-18T01:54:00.000+03:00</published><updated>2006-04-18T01:58:25.416+03:00</updated><title type='text'>Impersonation in .NET</title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/4268/821/1600/thread.6.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/4268/821/400/thread.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/4268/821/1600/thread.5.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Impersonation is done on a thread basis not on a process level. So when we say that something is impersonating a user, then this something must be for sure a Thread not a process.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A thread impersonating a specific user means that the thread will be working with the security context of that user.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;New created processes inherits their parents’ tokens&lt;br /&gt;&lt;/li&gt;&lt;li&gt;When a thread needs to stop impersonation for a while for example in ASP.NET if we used impersonation in web.config and a certain page needs to do a task with a specific privilege regardless the impersonated account then in that case we have to stop impersonation temporarily . there is a specific function to call in this case called “RevertToSelf”&lt;br /&gt;We can do this in .NET by :&lt;br /&gt;&lt;br /&gt;Console.WriteLine(WindowsIdentity.GetCurrent().Name); &lt;span style="color:#009900;"&gt;//print the impersonated account name&lt;br /&gt;&lt;br /&gt;//RevertToSelf&lt;br /&gt;//&lt;/span&gt;&lt;span style="color:#009900;"&gt;This line will remove the token impersonated and will revert back to the process identity.&lt;br /&gt;&lt;/span&gt;WindowsImpersonationContext c = WindowsIdentity.Impersonate(System.IntPtr.Zero);&lt;br /&gt;&lt;br /&gt;Console.WriteLine(WindowsIdentity.GetCurrent().Name); &lt;span style="color:#009900;"&gt;//print the process identity account name&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;//go back to Imopersonation&lt;br /&gt;&lt;/span&gt;c.Undo(); &lt;span style="color:#009900;"&gt;// will get the impersonated token back&lt;br /&gt;&lt;/span&gt;Console.WriteLine(WindowsIdentity.GetCurrent().Name); &lt;span style="color:#009900;"&gt;//print the impersonated account name&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Flow of tokens to new threads is different in .NET 1.1 than 2.0&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/4268/821/1600/thread.2.jpg"&gt;&lt;/a&gt;in the image above you can see...&lt;br /&gt;&lt;br /&gt;Step1&lt;br /&gt;A process running under Administrator Token. And a thread that is running under the same account&lt;br /&gt;&lt;br /&gt;Step2&lt;br /&gt;The thread impersonates HusseinA.&lt;br /&gt;&lt;br /&gt;Step3&lt;br /&gt;The current thread in the process spawns a new thread&lt;br /&gt;&lt;br /&gt;If thread1 spawned a new thread, what will be the token flown from thread1 to the spawned thread.&lt;br /&gt;&lt;br /&gt;In .NET v1.1 it is the original Process token which is Administrator in this case.&lt;br /&gt;Example: if a process running under “local system” and a thread in this process impersonated another lower privilege account then the current thread decided to spawn another thread. the new thread will run under local system not under the impersonated account. This is very dangerous and can lead to some flaws.&lt;br /&gt;&lt;br /&gt;In .NET 2.0 the default now is to flow the impersonated account and not the original process account.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;using&lt;/span&gt; System.Security;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;using&lt;/span&gt; System.Security.Principal;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;using&lt;/span&gt; System.Threading;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;namespace&lt;/span&gt; ImpersonateTest&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;class&lt;/span&gt; Program&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[DllImport("advapi32.dll", SetLastError = &lt;span style="color:#3366ff;"&gt;true&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;static extern bool&lt;/span&gt; LogonUser(&lt;span style="color:#3366ff;"&gt;string&lt;/span&gt; lpszUsername, &lt;span style="color:#3366ff;"&gt;string&lt;/span&gt; lpszDomain, &lt;span style="color:#3366ff;"&gt;string&lt;/span&gt; lpszPassword,&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;int&lt;/span&gt; dwLogonType, &lt;span style="color:#3366ff;"&gt;int&lt;/span&gt; dwLogonProvider, &lt;span style="color:#3366ff;"&gt;ref&lt;/span&gt; IntPtr phToken);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;static void&lt;/span&gt; Main(&lt;span style="color:#3366ff;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;//get a token for a user&lt;/span&gt;&lt;br /&gt;IntPtr token = IntPtr.Zero;;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;bool&lt;/span&gt; loggedin = LogonUser("user1", "MyMachine", "P@ssw0rd", 3, 0, ref token);&lt;br /&gt;&lt;span style="color:#009900;"&gt;//prints the name of the process identity name&lt;/span&gt; Console.WriteLine(WindowsIdentity.GetCurrent().Name);&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;//Impersonate&lt;/span&gt;&lt;br /&gt;WindowsIdentity w = new WindowsIdentity(token);&lt;br /&gt;WindowsImpersonationContext oldWindowsIdentity = w.Impersonate();&lt;br /&gt;&lt;br /&gt;//prints the name of the Impersonated account name Console.WriteLine(WindowsIdentity.GetCurrent().Name);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thread t1 = &lt;span style="color:#3333ff;"&gt;new&lt;/span&gt; Thread(&lt;span style="color:#3366ff;"&gt;new&lt;/span&gt; ThreadStart(Test));&lt;br /&gt;t1.Start();&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;static void&lt;/span&gt; Test()&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;//in .NET 1.1 prints the name of the Process account name&lt;br /&gt;//in .NET 2.0 prints the name of the Impersonated account name&lt;br /&gt;&lt;/span&gt;Console.WriteLine(WindowsIdentity.GetCurrent().name);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;a href="http://photos1.blogger.com/blogger/4268/821/1600/thread.2.jpg"&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114531470541032240?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114531470541032240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114531470541032240' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114531470541032240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114531470541032240'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/impersonation-in-net_18.html' title='Impersonation in .NET'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114456893297793627</id><published>2006-04-09T10:48:00.000+03:00</published><updated>2006-04-09T10:57:47.690+03:00</updated><title type='text'>Web Application Projects vs Web Site Projects</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;The motivation for building a new Application Project Model :&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2005/12/07/432630.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2005/12/07/432630.aspx&lt;/a&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;A very useful comparison between the two models :&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnvs05/html/WAP.asp"&gt;http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnvs05/html/WAP.asp&lt;/a&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;Very useful Tutorials :&lt;br /&gt;&lt;a href="http://webproject.scottgu.com/CSharp/Default.aspx"&gt;http://webproject.scottgu.com/CSharp/Default.aspx&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114456893297793627?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114456893297793627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114456893297793627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114456893297793627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114456893297793627'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/04/web-application-projects-vs-web-site.html' title='Web Application Projects vs Web Site Projects'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114347229968304622</id><published>2006-03-27T18:11:00.000+03:00</published><updated>2006-03-27T18:11:39.693+03:00</updated><title type='text'>Data Driven Unit Test</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;TDD :&lt;/p&gt;&lt;p class="mobile-post"&gt;You will hear a lot about it in the VSTS era&lt;/p&gt;&lt;p class="mobile-post"&gt;Test driven development :&lt;/p&gt;&lt;p class="mobile-post"&gt;It is not testing software ,NO&lt;br /&gt;It is aligning the developers to write more code efficient from customer&lt;br /&gt;point of view&lt;/p&gt;&lt;p class="mobile-post"&gt;So life cycle would be :&lt;br /&gt;- Write test (what ? Without having a code to test it) yes , write test&lt;br /&gt;projects first . Think from customer point of view: what I need this&lt;br /&gt;software to behave like . For example : I need my method to return&lt;br /&gt;InvalidCustomerIDException when someone passes a null of invalid ID, and&lt;br /&gt;I begin writing the test for the method that doesn't exist yet. So I&lt;br /&gt;force the production in this way to follow the behaviour that I have&lt;br /&gt;already designed in the test&lt;/p&gt;&lt;p class="mobile-post"&gt;- run test and see it fails . In this way I know that there is something&lt;br /&gt;that must be done in the production code to make the test succeed&lt;/p&gt;&lt;p class="mobile-post"&gt;- write production code that make the test pass&lt;/p&gt;&lt;p class="mobile-post"&gt;- run test and see it pass &lt;/p&gt;&lt;p class="mobile-post"&gt;Ok here comes the main goal for this feed entry :&lt;br /&gt;When I write a unit test , I am writing a static expected value and&lt;br /&gt;calculate the actual value and then compare by Assert .what if I need&lt;br /&gt;these values to be dynamic or having many values ? I will write an array&lt;br /&gt;of course in the test method and loop through the array and invoke the&lt;br /&gt;production code, WRONG. &lt;br /&gt;There is another smart way: Data Driven unit test&lt;br /&gt;I will create a table in the DB , and fill the table with data and tell&lt;br /&gt;the test engine : please invoke my test method number of times equals&lt;br /&gt;the no of rows in the table and pass the value for each row to the test&lt;br /&gt;method every time. Wowwwwwwwwwwwwwwwwwwwwwwwwwwwww magnificent &lt;br /&gt;So any time I can go to the table and change the test data and have&lt;br /&gt;another punch of tested values.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114347229968304622?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114347229968304622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114347229968304622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114347229968304622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114347229968304622'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/03/data-driven-unit-test.html' title='Data Driven Unit Test'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114347225845420554</id><published>2006-03-27T18:10:00.000+03:00</published><updated>2006-03-27T18:10:58.473+03:00</updated><title type='text'>Visual Studio 2005 Web Application Projects </title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;Now we have two environments for building ASP.NET II web sites &lt;/p&gt;&lt;p class="mobile-post"&gt;1- Visual Studio 2005 Web Application Projects Model  (Similar to VS&lt;br /&gt;2003)&lt;br /&gt;2- Visual Studio 2005 Web Site Projects Model		   (the new 2005&lt;br /&gt;model)&lt;/p&gt;&lt;p class="mobile-post"&gt;You can download the web app model from here :&lt;br /&gt;http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.a&lt;br /&gt;spx&lt;/p&gt;&lt;p class="mobile-post"&gt;This VS 2003 model style will be merged with VS 2005 SP1&lt;/p&gt;&lt;p class="mobile-post"&gt;And please no one ask me why we have two models ? &lt;br /&gt;From my point of view : it is left for your flavour .&lt;br /&gt;And one more thing :&lt;/p&gt;&lt;p class="mobile-post"&gt;Migration from VS 2003 web projects to VS 2005 web projects will be&lt;br /&gt;straight forward as they are the same model .&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114347225845420554?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114347225845420554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114347225845420554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114347225845420554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114347225845420554'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/03/visual-studio-2005-web-application.html' title='Visual Studio 2005 Web Application Projects '/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114157306975677852</id><published>2006-03-05T18:37:00.000+03:00</published><updated>2006-03-05T18:37:49.770+03:00</updated><title type='text'>Deploy Web Part in GAC or in /bin</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;There is only 1 difference : Security&lt;/p&gt;&lt;p class="mobile-post"&gt;Web parts deployed in GAC run always under full trust without any CAS&lt;br /&gt;restrictions&lt;br /&gt;Web parts deployed in /bin follow any of the five CAS trust levels&lt;br /&gt;defined in web.config .&lt;/p&gt;&lt;p class="mobile-post"&gt;BTW : "Trust Levels" is a feature provided by ASP.NET II&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114157306975677852?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114157306975677852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114157306975677852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114157306975677852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114157306975677852'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/03/deploy-web-part-in-gac-or-in-bin.html' title='Deploy Web Part in GAC or in /bin'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114156889861639090</id><published>2006-03-05T17:28:00.000+03:00</published><updated>2006-03-05T17:28:18.643+03:00</updated><title type='text'>Is Runnable DLL taking over EXE ?</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;Till the launch of .NET 1.1 there were some difference between DLLs and EXEs&lt;br /&gt;:&lt;/p&gt;&lt;p class="mobile-post"&gt;1- you cannot reference /r an EXE in your project but you can reference a&lt;br /&gt;DLL&lt;br /&gt;2- you cannot deploy an EXE in GAC (Gacutil) but you can do so with DLL&lt;br /&gt;3- DLL never meant to be runnable (has an entry point) but EXE does&lt;/p&gt;&lt;p class="mobile-post"&gt;After launching .NET 2.0 everything have changed now :&lt;br /&gt;1- you can reference an EXE as well as DLL&lt;br /&gt;2- you can Deploy EXEs in GAC&lt;br /&gt;3- you can have a runnable DLL, yes you heard me , you can have a complete&lt;br /&gt;project(like a windows forms APP) inside a DLL and run it .although this is&lt;br /&gt;not documented, but it can be easily done .&lt;/p&gt;&lt;p class="mobile-post"&gt;So the question now is :&lt;br /&gt;are DLLs taking over EXEs ? It can if it wants to&lt;br /&gt;Are EXEs taking over DLLs ? It can if it wants to&lt;/p&gt;&lt;p class="mobile-post"&gt;There is still only one difference between them , which is the concept of&lt;br /&gt;"Stand alone runnable APP". If I have a windows or a web or a mobile control&lt;br /&gt;as EXE , I wouldn't know if I need to double click on it to make it run or&lt;br /&gt;just add a reference to it in my app. So the logical meaning beyond the&lt;br /&gt;extension is still there .&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114156889861639090?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114156889861639090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114156889861639090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114156889861639090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114156889861639090'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/03/is-runnable-dll-taking-over-exe.html' title='Is Runnable DLL taking over EXE ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114060914972514248</id><published>2006-02-22T14:52:00.000+03:00</published><updated>2006-02-22T15:03:24.160+03:00</updated><title type='text'>I Already Have MARS in SQL 2000</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;Can we really have &lt;strong&gt;&lt;span style="color:#000099;"&gt;Mars in SQL 2000&lt;/span&gt;&lt;/strong&gt; ? The answer is &lt;span style="color:#cc0000;"&gt;&lt;strong&gt;yes&lt;/strong&gt; &lt;/span&gt;to some limit&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#cc33cc;"&gt;pIDBCreateCommand-&amp;gt;CreateCommand(NULL, IID_ICommandText, (IUnknown**)&lt;br /&gt;&amp;amp;pICommandText);&lt;br /&gt;pIDBCreateCommand-&amp;gt;CreateCommand(NULL, IID_ICommandText, (IUnknown**)&lt;br /&gt;&amp;amp;pICommandText2);&lt;br /&gt;pICommandText-&amp;gt;SetCommandText(DBGUID_DBSQL,&lt;br /&gt;OLESTR("select operation_id, operation_code, product_id, quantity&lt;br /&gt;from dbo.operations where processed=0"));&lt;br /&gt;pICommandText2-&amp;gt;SetCommandText(DBGUID_DBSQL,OLESTR("update dbo.operations&lt;br /&gt;set processed=1 where operation_id=?"));&lt;br /&gt;//Execute the command&lt;br /&gt;pICommandText-&amp;gt;Execute(NULL, IID_IRowset, NULL, &amp;cRowsAffected, (IUnknown**)&lt;br /&gt;&amp;amp;pIRowset);&lt;br /&gt;..&lt;br /&gt;ProcessOperation();&lt;br /&gt;..&lt;br /&gt;//Execute the command 2&lt;br /&gt;pICommandText2-&amp;gt;Execute(NULL, IID_IRowset, NULL, &amp;cRowsAffected, NULL);&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;What does SQLOLEDB does in the background ? It opens a new connection . What&lt;br /&gt;? Yes you heard me . It opens a new connection and execute command2 &lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Some Scenarios :&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;1- what happens if command1 was in a DTC TX ?&lt;br /&gt;in this case SQLOLEDB cannot open a new connection and command2&lt;br /&gt;fails&lt;br /&gt;2-Command1 in a TSQL TX not a DTC TX ?&lt;br /&gt;SQLOLEDB has no idea that command1 is in a TX and it will open a new&lt;br /&gt;one, ending in two command living in different TX.&lt;br /&gt;3- think about more scenarios like locking (2 commands lock each other )&lt;br /&gt;There are a lot of more scenarios to be covered but no time &lt;/p&gt;&lt;p class="mobile-post"&gt;Any way , again the answer of the question is YES of course we do support&lt;br /&gt;MARS in SQL 2000 behind the scene&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114060914972514248?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114060914972514248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114060914972514248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114060914972514248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114060914972514248'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/02/i-already-have-mars-in-sql-2000.html' title='I Already Have MARS in SQL 2000'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114051819065704306</id><published>2006-02-21T13:36:00.000+03:00</published><updated>2006-02-21T13:36:30.690+03:00</updated><title type='text'>The binding handle is invalid</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;At last I found a solution for this problem .&lt;br /&gt;Problem : when you start debuggin on Visual Studio 2005 you get this&lt;br /&gt;message . Some people disable generating the vshost files which are&lt;br /&gt;important&lt;br /&gt;But the solution is : go to the terminal services windows service and&lt;br /&gt;change the startup option to be manual and restart the computer or make&lt;br /&gt;it manual and start it without starting the computer&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114051819065704306?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114051819065704306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114051819065704306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114051819065704306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114051819065704306'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/02/binding-handle-is-invalid.html' title='The binding handle is invalid'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114036088954679952</id><published>2006-02-19T17:54:00.000+03:00</published><updated>2006-02-19T17:54:49.606+03:00</updated><title type='text'>Change configuration profile in 2005</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;If you want to change the configuration Profile from Debug to Release in&lt;br /&gt;2005 , some people go to application properties designer and from (Compile&lt;br /&gt;or Build) they change the configuration to Debug or Release . This is wrong&lt;br /&gt; This allows you only to change the settings of each profile , but if you&lt;br /&gt;want to change the current running active profile you have to go to menu&lt;br /&gt;Build\Configuration Manager and change it &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114036088954679952?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114036088954679952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114036088954679952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114036088954679952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114036088954679952'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/02/change-configuration-profile-in-2005.html' title='Change configuration profile in 2005'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-114026656441563820</id><published>2006-02-18T15:42:00.000+03:00</published><updated>2006-02-18T15:42:44.440+03:00</updated><title type='text'>vshost</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;What are vshost files : "app.vshost.exe" and "app.vshost.exe.config" ?&lt;/p&gt;&lt;p class="mobile-post"&gt;Vshost files are used at design time only and they are used for 3 purposes :&lt;/p&gt;&lt;p class="mobile-post"&gt;*	improved F5 performance. Keep the state of appdomains between runs&lt;br /&gt;of my application. So before running the app for 2nd time , the vshost&lt;br /&gt;preserve the state of appdomain so saving sometime to reinitialize&lt;br /&gt;everything&lt;/p&gt;&lt;p class="mobile-post"&gt;*	partial trust debugging&lt;/p&gt;&lt;p class="mobile-post"&gt;*	design time expression evaluation. Which has taken out from VB2003&lt;br /&gt;and now is back for all langs .you can use the immediate windows in design&lt;br /&gt;mode for some design time expressions evaluation we need,&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-114026656441563820?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/114026656441563820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=114026656441563820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114026656441563820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/114026656441563820'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2006/02/vshost.html' title='vshost'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113507907062605612</id><published>2005-12-20T14:44:00.000+03:00</published><updated>2005-12-20T14:44:30.676+03:00</updated><title type='text'>Why Do we need AppDomains ?</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;1- a place to load unload assemblies  &lt;br /&gt;2- isolation&lt;br /&gt;3- security (assemblies inside same appdomain can have same policy)&lt;br /&gt;4- configuration &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113507907062605612?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113507907062605612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113507907062605612' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113507907062605612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113507907062605612'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/12/why-do-we-need-appdomains.html' title='Why Do we need AppDomains ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113434521584144280</id><published>2005-12-12T02:53:00.000+03:00</published><updated>2005-12-12T02:53:35.890+03:00</updated><title type='text'>A very powerful feature that has been taken for 6 years , now is back</title><content type='html'>&lt;p class="mobile-post"&gt;VB DTEE ...............&lt;br /&gt;Yes it is back , I cannot believe that . I deadly needed this feature in&lt;br /&gt;2002 and 2003. and I always wanted to see the one in charge who has removed&lt;br /&gt;this feature , but fortunately now I wont be searching for him any more :)&lt;/p&gt;&lt;p class="mobile-post"&gt;Now (in 2005) I can open the immediate window without running the program at&lt;br /&gt;all and execute commands .without running my program I can invoke a function&lt;br /&gt;, evaluate an expression , create an object , anything !!!!!!&lt;br /&gt;Wow awseome :-)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113434521584144280?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113434521584144280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113434521584144280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113434521584144280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113434521584144280'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/12/very-powerful-feature-that-has-been.html' title='A very powerful feature that has been taken for 6 years , now is back'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113415987976513823</id><published>2005-12-09T23:24:00.000+03:00</published><updated>2005-12-09T23:47:47.796+03:00</updated><title type='text'>Filtering Exceptions</title><content type='html'>&lt;p class="mobile-post"&gt;Some languages like VB.NET but not C# supports Exception Filters .&lt;/p&gt;&lt;p class="mobile-post"&gt;Let's take these quick scenarios :&lt;/p&gt;&lt;p class="mobile-post"&gt;1- procedure A which has an exception handler is calling Proc B which&lt;br /&gt;doesn't have an exception handler. Proc B Throw an exception . What happens&lt;br /&gt;? Of course the runtime will search the stack for any catch until it hits A.&lt;br /&gt;so A cacth the exception&lt;/p&gt;&lt;p class="mobile-post"&gt;2- same as before but B has an exception handler . What happens ? Of course&lt;br /&gt;B catch the exception which might in turn voluntarily throw the exception .&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;3-&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;Sub&lt;/span&gt; A&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;Try&lt;/span&gt;&lt;br /&gt;       B()&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;Catch when&lt;/span&gt; Filter1() = &lt;span style="color:#3333ff;"&gt;True&lt;/span&gt;&lt;br /&gt;       DoSomething()&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;End Try&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End sub&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#3333ff;"&gt;Function&lt;/span&gt; Filter1() &lt;span style="color:#3333ff;"&gt;as boolean&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:#3333ff;"&gt;return True&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End function&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#3333ff;"&gt;Sub&lt;/span&gt; B&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;Try&lt;/span&gt;&lt;br /&gt;       DoWork()&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;Finally&lt;/span&gt;&lt;br /&gt;       FinalizeMyWork()&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;End Try&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;End sub&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#3333ff;"&gt;Sub&lt;/span&gt; DoWork()&lt;br /&gt;    &lt;span style="color:#3333ff;"&gt;throw new&lt;/span&gt; exception()&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;End sub&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;strong&gt;The question now is&lt;/strong&gt; : &lt;strong&gt;&lt;span style="color:#990000;"&gt;what are the ordered steps of execution ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;1- A calls B&lt;br /&gt;2- B calls DoWork()&lt;br /&gt;3- DoWork throw an exception&lt;br /&gt;4- CLR will search in the stack for a handler until it finds A's&lt;br /&gt;Handler&lt;br /&gt;5- &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;this is the trick&lt;/strong&gt;&lt;/span&gt; . Filter1 is executed&lt;br /&gt;6- B's Finally&lt;br /&gt;7- DoSomething &lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;br /&gt;So here is the lesson : &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;TAKE CARE&lt;/strong&gt;&lt;/span&gt; , some code could run after the try and&lt;br /&gt;before the Finally . In our case , from B's Perspective , DoWork() is&lt;br /&gt;executed then (&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;SHOULD&lt;/strong&gt;&lt;/span&gt;) followed by FinalizeMyWork(). But in practical , &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;NO&lt;/strong&gt;&lt;/span&gt; the&lt;br /&gt;filter is executed in between . For me it is like (not is) code injection . &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113415987976513823?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113415987976513823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113415987976513823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113415987976513823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113415987976513823'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/12/filtering-exceptions.html' title='Filtering Exceptions'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113405565690886394</id><published>2005-12-08T18:27:00.000+03:00</published><updated>2005-12-08T18:45:23.423+03:00</updated><title type='text'>Throw THINGS that are not exceptions !!!</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;This is my first time to know that we can throw types that are not&lt;br /&gt;exceptions (not derived from system.exception)&lt;br /&gt;Fortunately this cannot be done directly from CLS compliant languages like&lt;br /&gt;C# and VB , but what if we are calling method M1() written by naughty C++ or&lt;br /&gt;IL which throws an integer for example (throw 4). How can we catch this in&lt;br /&gt;C# or VB ?&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;In .NET v1.x we can write :&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#3333ff;"&gt;Try&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#33cc00;"&gt;               'call a naughty code that throws a non-exception&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Catch&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;span style="color:#3333ff;"&gt;End try&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;This approach has 2 issues :&lt;br /&gt;1- there is no variable for catching the exception&lt;br /&gt;2- non-system exceptions are not accumulated on the stack trace so we cannot&lt;br /&gt;debug .&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;In .NET v2.0 :&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;Non-system exceptions are wrapped up with&lt;br /&gt;System.Runtime.CompilerServices.RuntimeWrappedException which derives from&lt;br /&gt;System.Exception . And even more there is a switch to enable or disable this&lt;br /&gt;: &amp;lt;Assembly:&lt;br /&gt;System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(true)&amp;gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;CLR Magic :&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;If assembly A (written in IL) throws a non-system exception . Assembly B&lt;br /&gt;(written in C#) calls A . Assembly C (written in C++) call B.&lt;br /&gt;1- if A catch it . It will see the non-system exception and never see that&lt;br /&gt;it has been wrapped&lt;br /&gt;2- if B catch it . It will see RuntimeWrappedException&lt;br /&gt;3- if C catch it . It will see the non-system exception and never see that&lt;br /&gt;it has been wrapped&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113405565690886394?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113405565690886394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113405565690886394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113405565690886394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113405565690886394'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/12/throw-things-that-are-not-exceptions.html' title='Throw THINGS that are not exceptions !!!'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113294676183104282</id><published>2005-11-25T22:26:00.000+03:00</published><updated>2005-11-25T22:26:01.866+03:00</updated><title type='text'>Dynamic ports and muli-port/IP listener in SQL 2005</title><content type='html'>&lt;p class="mobile-post"&gt;In the configuration manager , you can configure SQL 2005 to listen on&lt;br /&gt;multiple Ips , and even more you can make it listen to multiple ports on the&lt;br /&gt;same IP (1440,1450,1460) , but in this case you have to make "listen ALL =&lt;br /&gt;NO"&lt;/p&gt;&lt;p class="mobile-post"&gt;Moreovere you can configure the server to have dynamic port , so when the&lt;br /&gt;service is strating , it asks the OS for an available port, opens an&lt;br /&gt;endpoint for that port.&lt;br /&gt;SQL Server Browser monitors the ports, and direct incoming connections to&lt;br /&gt;the right port for specific instance.&lt;br /&gt;So what happens if SQLBrowser is off ? Of course clients must provide the&lt;br /&gt;right IP and port otherwise they cannot connect.&lt;br /&gt;So sql browser acts as a resolution for instance name to their ports .&lt;br /&gt;The client send a UDP msg to port 1434 with the name of the instance , the&lt;br /&gt;sql browser replies with the port.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113294676183104282?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113294676183104282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113294676183104282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113294676183104282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113294676183104282'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/11/dynamic-ports-and-muli-portip-listener.html' title='Dynamic ports and muli-port/IP listener in SQL 2005'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113293393280506072</id><published>2005-11-25T18:52:00.000+03:00</published><updated>2005-11-25T18:52:12.843+03:00</updated><title type='text'>The war of SQL vs. Xquery</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;The world is your database with Log Parser.&lt;/p&gt;&lt;p class="mobile-post"&gt;I can think of this as a point towards the relational world against the&lt;br /&gt;hierarchical world ...&lt;/p&gt;&lt;p class="mobile-post"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-&lt;br /&gt;91b2-f8d975cf8c07&amp;amp;displaylang=en&lt;/p&gt;&lt;p class="mobile-post"&gt;Log parser is a powerful, versatile tool that provides universal query&lt;br /&gt;access to text-based data such as log files, XML files and CSV files, as&lt;br /&gt;well as key data sources on the WindowsR operating system such as the Event&lt;br /&gt;Log, the Registry, the file system, and Active DirectoryR. You tell Log&lt;br /&gt;Parser what information you need and how you want it processed. The results&lt;br /&gt;of your query can be custom-formatted in text based output, or they can be&lt;br /&gt;persisted to more specialty targets like SQL, SYSLOG, or a chart. &lt;/p&gt;&lt;p class="mobile-post"&gt;Most software is designed to accomplish a limited number of specific tasks.&lt;br /&gt;Log Parser is different... the number of ways it can be used is limited only&lt;br /&gt;by the needs and imagination of the user. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113293393280506072?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113293393280506072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113293393280506072' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113293393280506072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113293393280506072'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/11/war-of-sql-vs-xquery.html' title='The war of SQL vs. Xquery'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113239081080549475</id><published>2005-11-19T12:00:00.000+03:00</published><updated>2005-11-19T12:00:10.810+03:00</updated><title type='text'>Cannot delete fileX :Access is Denied</title><content type='html'>&lt;p class="mobile-post"&gt;&lt;br /&gt;How many times did you get this message ? &lt;/p&gt;&lt;p class="mobile-post"&gt;"Cannot delete fileX :Access is Denied&lt;br /&gt;Make Sure the Disk is not full or write-protected&lt;br /&gt;And the file is not currently in use"&lt;/p&gt;&lt;p class="mobile-post"&gt;I think a lot ha ?&lt;br /&gt;At last I got a solution from the BCL Team&lt;/p&gt;&lt;p class="mobile-post"&gt;you can use it to enumerate the processes that are using the blocked module&lt;/p&gt;&lt;p class="mobile-post"&gt;For example : LMOD.exe file1.dll&lt;br /&gt;Then you get a list of running process who are using file1.dll module&lt;/p&gt;&lt;p class="mobile-post"&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Simple tool to find out which process have loaded a particular module.&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;public class LMod&lt;br /&gt;{     &lt;br /&gt;    // "System Idle Process" pid&lt;br /&gt;    static int IdleProcessID = 0;&lt;/p&gt;&lt;p class="mobile-post"&gt;    // "System" pid&lt;br /&gt;    static int SystemProcessID&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            //Is older than XP...&lt;br /&gt;            if (Environment.OSVersion.Version.Major &amp;lt; 5 ||&lt;br /&gt;                (Environment.OSVersion.Version.Major == 5 &amp;amp;&amp;amp;&lt;br /&gt;                     Environment.OSVersion.Version.Minor == 0))&lt;br /&gt;                return 8;&lt;br /&gt;            else&lt;br /&gt;                return 4;&lt;br /&gt;        }&lt;br /&gt;    } &lt;br /&gt;    public static int Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        int total = 0;&lt;br /&gt;        string m_ModuleName = "";&lt;/p&gt;&lt;p class="mobile-post"&gt;        if (args.Length == 1)&lt;br /&gt;            m_ModuleName = args[0];&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            // wrong number of parameters...&lt;br /&gt;            Console.WriteLine("Usage: LMod module_name");&lt;br /&gt;            return 1;&lt;br /&gt;        } &lt;/p&gt;&lt;p class="mobile-post"&gt;        // Get all running processes on the machine...&lt;br /&gt;        Process[] m_arrSysProcesses = Process.GetProcesses();&lt;br /&gt;        for (int i = 0; i &amp;lt; m_arrSysProcesses.Length; i++)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            { &lt;br /&gt;                ProcessModuleCollection modules =&lt;br /&gt;m_arrSysProcesses[i].Modules;&lt;br /&gt;                int nCount = modules.Count;&lt;br /&gt; &lt;br /&gt;                if (nCount &amp;gt; 0)&lt;br /&gt;                {&lt;br /&gt;                    for (int j = 0; j &amp;lt; nCount; j++)&lt;br /&gt;                    {&lt;br /&gt;                        // Is it the module we are looking for?&lt;br /&gt;                        if (modules[j].ModuleName == m_ModuleName)&lt;br /&gt;                        {&lt;br /&gt;                            Console.WriteLine("-------------------");&lt;br /&gt;                            Console.WriteLine("Process Name: " &lt;br /&gt;                                 + m_arrSysProcesses[i].ProcessName);&lt;br /&gt;                            Console.WriteLine("Process ID : " &lt;br /&gt;                                 + m_arrSysProcesses[i].Id);&lt;br /&gt;                            Console.WriteLine("Priority : " &lt;br /&gt;                                 + m_arrSysProcesses[i].BasePriority);&lt;br /&gt;                            Console.WriteLine("Memory Usage: " &lt;br /&gt;                                 + (m_arrSysProcesses[i].WorkingSet64 /&lt;br /&gt;1024) + " Kb");&lt;br /&gt;                            Console.WriteLine();&lt;/p&gt;&lt;p class="mobile-post"&gt;                            total++;&lt;br /&gt;                            break;&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception e)&lt;br /&gt;            {&lt;br /&gt;                // System Idle Process (Idle): represents pseudo-process  &lt;br /&gt;                // that represents all the processor time not used by&lt;br /&gt;                // other processes.&lt;br /&gt;                // System (System): represents the processor time&lt;br /&gt;                // used by the kernel itself.&lt;br /&gt;                if (m_arrSysProcesses[i].Id != SystemProcessID &lt;br /&gt;                     &amp;amp;&amp;amp; m_arrSysProcesses[i].Id != IdleProcessID)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine("Error: Process " &lt;br /&gt;                         + m_arrSysProcesses[i].ProcessName &lt;br /&gt;                         + " (" + m_arrSysProcesses[i].Id + ") failed!"); &lt;br /&gt;                    Console.WriteLine(e);&lt;br /&gt;                    return 2;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;/p&gt;&lt;p class="mobile-post"&gt;        Console.WriteLine();&lt;br /&gt;        Console.WriteLine("There are " + total &lt;br /&gt;             + " processes using module " + m_ModuleName);&lt;/p&gt;&lt;p class="mobile-post"&gt;        return 100;&lt;br /&gt;    }&lt;br /&gt;}&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113239081080549475?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113239081080549475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113239081080549475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113239081080549475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113239081080549475'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/11/cannot-delete-filex-access-is-denied.html' title='Cannot delete fileX :Access is Denied'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-113180282175562560</id><published>2005-11-12T16:40:00.000+03:00</published><updated>2005-11-12T16:40:21.790+03:00</updated><title type='text'>(Singularity) New MS OS other than Windows</title><content type='html'>&lt;p class="mobile-post"&gt;http://research.microsoft.com/os/singularity/&lt;/p&gt;&lt;p class="mobile-post"&gt;This is just a little brief about the new OS :&lt;/p&gt;&lt;p class="mobile-post"&gt;Singularity is a new operating system being developed as a basis for more&lt;br /&gt;dependable&lt;br /&gt;system and application software [28]. Singularity exploits advances in&lt;br /&gt;programming languages&lt;br /&gt;and tools to create an environment in which software is more likely to be&lt;br /&gt;built correctly, program&lt;br /&gt;behavior is easier to verify, and run-time failures can be contained.&lt;/p&gt;&lt;p class="mobile-post"&gt;A key aspect of Singularity is an extension model based on Software-Isolated&lt;br /&gt;Processes&lt;br /&gt;(SIPs), which encapsulate pieces of an application or a system and provide&lt;br /&gt;information hiding,&lt;br /&gt;failure isolation, and strong interfaces. SIPs are used throughout the&lt;br /&gt;operating system and&lt;br /&gt;application software. We believe that building a system on this abstraction&lt;br /&gt;will lead to more&lt;br /&gt;dependable software.&lt;/p&gt;&lt;p class="mobile-post"&gt;SIPs are the OS processes on Singularity. All code outside the kernel&lt;br /&gt;executes in a SIP. SIPs&lt;br /&gt;differ from conventional operating system processes in a number of ways:&lt;br /&gt;- SIPs are closed object spaces, not address spaces. Two Singularity&lt;br /&gt;processes cannot&lt;br /&gt;simultaneously access an object. Communications between processes transfers&lt;br /&gt;exclusive&lt;br /&gt;ownership of data.&lt;br /&gt;- SIPs are closed code spaces. A process cannot dynamically load or generate&lt;br /&gt;code.&lt;br /&gt;- SIPs do not rely on memory management hardware for isolation. Multiple&lt;br /&gt;SIPs can reside&lt;br /&gt;in a physical or virtual address space.&lt;br /&gt;- Communications between SIPs is through bidirectional, strongly typed,&lt;br /&gt;higher-order&lt;br /&gt;channels. A channel specifies its communications protocol as well as the&lt;br /&gt;values&lt;br /&gt;transferred, and both aspects are verified.&lt;br /&gt;- SIPs are inexpensive to create and communication between SIPs incurs low&lt;br /&gt;overhead.&lt;br /&gt;Low cost makes it practical to use SIPs as a fine-grain isolation and&lt;br /&gt;extension&lt;br /&gt;mechanism.&lt;/p&gt;&lt;p class="mobile-post"&gt;- SIPs are created and terminated by the operating system, so that on&lt;br /&gt;termination, a SIP's&lt;br /&gt;resources can be efficiently reclaimed.&lt;br /&gt;- SIPs executed independently, even to the extent of having different data&lt;br /&gt;layouts, run-time&lt;br /&gt;systems, and garbage collectors.&lt;/p&gt;&lt;p class="mobile-post"&gt;SIPs are not just used to encapsulate application extensions. Singularity&lt;br /&gt;uses a single&lt;br /&gt;mechanism for both protection and extensibility, instead of the conventional&lt;br /&gt;dual mechanisms of&lt;br /&gt;processes and dynamic code loading. As a consequence, Singularity needs only&lt;br /&gt;one error&lt;br /&gt;recovery model, one communication mechanism, one security policy, and one&lt;br /&gt;programming&lt;br /&gt;model, rather than the layers of partially redundant mechanisms and policies&lt;br /&gt;in current systems.&lt;br /&gt;A key experiment in Singularity is to construct an entire operating system&lt;br /&gt;using SIPs and&lt;br /&gt;demonstrate that the resulting system is more dependable than a conventional&lt;br /&gt;system&lt;/p&gt;&lt;p class="mobile-post"&gt;There are a lot more in the report on the research site &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-113180282175562560?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/113180282175562560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=113180282175562560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113180282175562560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/113180282175562560'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/11/singularity-new-ms-os-other-than.html' title='(Singularity) New MS OS other than Windows'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112950277480723505</id><published>2005-10-17T01:46:00.000+03:00</published><updated>2005-10-17T01:46:14.836+03:00</updated><title type='text'>Quartz Web Designer for ASP.NET II from Microsoft</title><content type='html'>&lt;!-- Converted from text/plain format --&gt;&lt;FONT face=Arial size=2&gt;now we  can build a very powerful design model based on WPF which can now target ASP.NET  Clients&lt;/FONT&gt; &lt;P&gt;&lt;FONT size=2&gt;&lt;A  href="http://www.microsoft.com/products/expression/en/web_designer/default.aspx"&gt;http://www.microsoft.com/products/expression/en/web_designer/default.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT  color=#0000ff size=3&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face=Arial color=#000000 size=2&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;P&gt;&lt;A  href="http://husseindotnet.blogspot.com//ohttp://husseindotnet.blogspotcom/"&gt;&lt;U&gt;&lt;FONT  color=#0000ff size=1&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;FONT  face=Arial&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112950277480723505?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112950277480723505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112950277480723505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112950277480723505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112950277480723505'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/10/quartz-web-designer-for-aspnet-ii-from.html' title='Quartz Web Designer for ASP.NET II from Microsoft'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112912516267279141</id><published>2005-10-12T16:52:00.000+03:00</published><updated>2005-10-12T16:52:42.706+03:00</updated><title type='text'>Encrypting web.config without writing Code</title><content type='html'>&lt;DIV&gt;&lt;!-- Converted from text/plain format --&gt;&lt;FONT face=Arial  size=2&gt;I&amp;nbsp;think alot of people needs to encrypt their web.config sections in  an easy way . it has never been easier than ASP.NET 2.0 &lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=4&gt;&lt;STRONG&gt;1-&lt;U&gt;  Tool&lt;/U&gt;&lt;/STRONG&gt;&lt;U&gt;&amp;nbsp;:&lt;/U&gt;&lt;/FONT&gt; &lt;FONT size=3&gt;&lt;FONT  color=#800000&gt;&lt;STRONG&gt;Aspnet_regiis.exe .&lt;FONT  size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT  size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; limited to certain kind of sections . there are some  system sections like (&lt;/FONT&gt;&lt;FONT face="Times New Roman"  size=3&gt;&amp;lt;&lt;B&gt;processModel&lt;/B&gt;&amp;gt;, &amp;lt;&lt;B&gt;runtime&lt;/B&gt;&amp;gt;,  &amp;lt;&lt;B&gt;system.runtime.remoting&lt;/B&gt;&amp;gt; ) that cannot  be&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; encrypted using this tool ,  so we have to use another tool which is &lt;FONT face=Arial  color=#800000&gt;&lt;STRONG&gt;Aspnet_setreg.exe&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face=Arial  color=#800000&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face=Arial color=#800000&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=4&gt;&lt;STRONG&gt;2- &lt;U&gt;Encryption  Provider&lt;/U&gt;&lt;/STRONG&gt;&lt;U&gt; :&lt;/U&gt;&lt;/FONT&gt; &lt;FONT color=#800000  size=3&gt;&lt;STRONG&gt;RSA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;&lt;FONT size=4&gt;3- &lt;U&gt;key Storage Location  :&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt; Encryption Keys are saved in Container files&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;a- Machine Container  :&lt;/STRONG&gt; the encryption key is shared to all applications running on the same  server. ( &lt;FONT size=3&gt;\Documents and Settings\All Users\Application  Data\Microsoft\Crypto\RSA\MachineKeys&lt;/FONT&gt;&amp;nbsp;). &lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The shared Encryption key  Container : &lt;FONT color=#ff0000&gt;"&lt;STRONG&gt;&lt;FONT  size=3&gt;NetFrameworkConfigurationKey"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;b- User Container  :&lt;/STRONG&gt; the encryption key is only accesible by our application. ( &lt;FONT  size=3&gt;\Documents and Settings\{UserName}\Application Data\Microsoft\Crypto\RSA  )&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face=Arial size=4&gt;4- &lt;U&gt;Encrypting  :&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face=Arial color=#0000ff&gt;&lt;FONT color=#000000&gt;for IIS :&lt;/FONT&gt;  aspnet_regiis -pe "ParentSection/ChildSection" -app  "/WebApplication1"&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/DIV&gt; &lt;DIV&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;-pe :&amp;nbsp; the section to be encrypted like  "&lt;FONT color=#800000 size=2&gt;connectionStrings"&amp;nbsp; or  "appSettings/App1"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;-app: the virtual path to the application  &lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;-pd : for decryption&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;For the built-in web server  with Visual Studio.NET 2005&lt;/FONT&gt;&lt;/STRONG&gt; : &lt;STRONG&gt;&lt;FONT color=#0000ff  size=3&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;FONT color=#0000ff size=3&gt;aspnet_regiis.exe -pef  "ParentSection/ChildSection" C:\MyWebs\WebApp1&lt;/FONT&gt;&lt;/B&gt; &lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;-pef: section to be encrypted + physical path  &lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;-pdf: for decryption&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;For User Container Storage :&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=3&gt;&amp;lt;protectedData&amp;gt;&lt;BR&gt;&amp;nbsp;  &amp;lt;providers&amp;gt;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add  keyContainerName="NetFrameworkConfigurationKey"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;EM&gt;&lt;FONT color=#ff00ff&gt;&lt;FONT  color=#ff0000&gt;useMachineContainer="false"&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  description="Uses RsaCryptoServiceProvider to encrypt and  decrypt"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  name="MyUserRSAProtectedConfigurationprovider"  &lt;BR&gt;type="System.Configuration.RsaProtectedConfigurationProvider,SystemConfiguration,  Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"  /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/providers&amp;gt;&amp;nbsp;&amp;nbsp;  &lt;BR&gt;&amp;lt;/protectedData&amp;gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;The good news is that you dont have to write  anything special in your code to read the encrypted data .it is read by the same  way :  &lt;STRONG&gt;ConfigurationManager.ConnectionStrings("MyConn1").ConnectionString&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;BR&gt;&lt;FONT face=Arial size=4&gt;&lt;STRONG&gt;5- &lt;U&gt;ACL on the Encryption Key  :&lt;/U&gt;&lt;/STRONG&gt; &lt;FONT size=2&gt;which web application has permission to read  encrypted data&amp;nbsp;?&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT  size=3&gt;&lt;FONT size=1&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;any ASP.NET Web APP has an identity  (in IIS6 , it is the identity of the App Pool). when an ASP.NET web App tried to  read encrypted Data , ASP.NET checks if that application has the appropriate  permission by checking the NTFS ACL on the Encryption Key Container File (for  shared Machine Container it is :&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=3&gt;&lt;FONT  size=2&gt;NetFrameworkConfigurationKey) against app identity  &lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt; &lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=3&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;Access Denied  :&lt;/STRONG&gt; If your web APP doesnt have permission to access the key --&amp;gt;&amp;nbsp;  "&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT size=3&gt;Parser Error Message: Failed to decrypt using  provider 'RsaProtectedConfigurationProvider'. Error message from the provider:  The handle is invalid."&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;P&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;Grant Access to an Account:&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT  color=#0000ff size=3&gt;aspnet_regiis -pa "NetFrameworkConfigurationKey"  "MyServer\MyUser"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112912516267279141?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112912516267279141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112912516267279141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112912516267279141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112912516267279141'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/10/encrypting-webconfig-without-writing.html' title='Encrypting web.config without writing Code'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112893362070607712</id><published>2005-10-10T11:40:00.000+03:00</published><updated>2005-10-10T11:40:22.223+03:00</updated><title type='text'></title><content type='html'>&lt;H2&gt;&lt;FONT color=#800000&gt;App_Offline.htm&lt;/FONT&gt;&lt;/H2&gt;&lt;br /&gt;&lt;P&gt;very cool feature form ASP.NET II . just place a page in the root of your web app with this file "App_offline.htm" and the server will unload the web app and unload the app domain and stop processing any requestes . it just displays the contents of the htm page. this can be used&amp;nbsp;during maintenance.the only complaint is that you cannot control the name of the page in any config file coz this is executed before loading any config file ...&lt;/P&gt;&lt;br /&gt;&lt;P&gt;removing this file from the root will result in immediate normal processing for requests from the next request&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112893362070607712?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112893362070607712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112893362070607712' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112893362070607712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112893362070607712'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/10/appoffline.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112890451384918284</id><published>2005-10-10T03:35:00.000+03:00</published><updated>2005-10-10T03:35:56.560+03:00</updated><title type='text'></title><content type='html'>&lt;H2&gt;&lt;FONT color=#000080&gt;&lt;FONT color=#800000&gt;Using the HTTP.SYS Kernel Mode Cache from ASP.NET&lt;/FONT&gt; &lt;/FONT&gt;&lt;/H2&gt;&lt;br /&gt;&lt;P&gt;first question of course will be "what is the difference between Kernel mode and user mode ?" . &lt;BR&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;kernel mode is the OS mode .it is by default a&amp;nbsp;2GB piece of memory.&amp;nbsp;it is a protected area .running under elevated privilages(Local System)&amp;nbsp;. so anything running in kernel mode is actually very very fast over user mode coz they have elevated priority over anything running in User mode .&lt;BR&gt;by default User mode is 2GB peice&amp;nbsp;of memory. it is the place to run all the applications ( including IIS) &amp;nbsp;in windows OS &lt;BR&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;so one of the implications of implementing a kernel mode http listener is dramatically increase the performance .&lt;/P&gt;&lt;br /&gt;&lt;P&gt;let's have a look on caching in ASP.NET Today ,&amp;nbsp; I could take the data i need to cache&amp;nbsp; and basically store it in memory and guarantee that on subsequent requests, IIS is going to call ASP.NET; ASP.NET is going to get the choice to say, based on the URL you're asking for, I'm going to fetch this out of memory if I have it; and then I can send a response back down. But with IIS 6.0, the extra benefit you get is that rather than IIS ever having even talked to us, the request can be pushed in IIS and it can be served straight from IIS.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;so caching data in kernel mode (HTTP.SYS) avoids &lt;STRONG&gt;context switches&lt;/STRONG&gt; between user mode and kernel mode .it is dramatically increasing performance , and when talking about performance we can measure this with a very simple page built with ASP.NET on MS Application Center . the difference between no of req/sec before and after apply caching is incredible &lt;/P&gt;&lt;br /&gt;&lt;P&gt;note: to apply HTTP.SYS caching from ASP.NET&amp;nbsp; you have to add the @OutPutCache Directive to the page &lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112890451384918284?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112890451384918284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112890451384918284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112890451384918284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112890451384918284'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/10/using-http.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112889877147266559</id><published>2005-10-10T01:59:00.000+03:00</published><updated>2005-10-10T01:59:31.496+03:00</updated><title type='text'></title><content type='html'>&lt;H2&gt;&lt;FONT color=#000080&gt;Wiki&lt;/FONT&gt;&lt;/H2&gt;&lt;br /&gt;&lt;P&gt;i heard alot about wiki i always want to know what is really a wiki . &lt;BR&gt;so &lt;STRONG&gt;languistically&lt;/STRONG&gt; speaking&amp;nbsp; : wiki is a huwai'ian keyword which means "Quick"&lt;BR&gt;In Hawai'ian repeated words provide emphasis, so &lt;A onmouseover='TopicTipOn(this, "id244", event);' onmouseout=TopicTipOff(); href="http://www.flexwiki.com/default.aspx/FlexWiki/WikiWiki.html"&gt;WikiWiki&lt;/A&gt; means &lt;EM&gt;very quick&lt;BR&gt;&lt;/EM&gt;That makes a &lt;A onmouseover='TopicTipOn(this, "id245", event);' onmouseout=TopicTipOff(); href="http://www.flexwiki.com/default.aspx/FlexWiki/WikiWikiWeb.html"&gt;&lt;FONT color=#4169e1&gt;WikiWikiWeb&lt;/FONT&gt;&lt;/A&gt; a very quick way to create web-based content.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;from a Technical &lt;STRONG&gt;Technical perspective ,&lt;/STRONG&gt; you can consider a wiki like a dashboard or a white board but instead of only one person writing on it , no there can be multiplie persons from all over the world can be writing on it , and modification to the text on the white board it tracked to his modifier. so it is amix between chatting , collaboration and discussion board .&lt;/P&gt;&lt;br /&gt;&lt;P&gt;let's take an example &lt;/P&gt;&lt;br /&gt;&lt;OL&gt;&lt;br /&gt;&lt;LI&gt;go to &lt;A href="http://www.flexwiki.com/"&gt;http://www.flexwiki.com/&lt;/A&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;alomst every page you see from now on is a complete wiki and it is called a topic. for example the first link in the page in the&amp;nbsp;right section is pointing to &lt;A href="http://www.flexwiki.com/default.aspx/FlexWiki/WikiWiki.html"&gt;http://www.flexwiki.com/default.aspx/FlexWiki/WikiWiki.html&lt;/A&gt;, please click on it &lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;this opened web page now is a topic using the wiki methodologies&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;let's say you need to change the page , you need to add your own text on that page or change or delete. simply double click any where on any white space portion on that page&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;now we are inside wiki editor &lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;change the text freely and please have a look on the right pane, where you can change your contribution change "Name" and change templates and then click save&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;the previous page is back now but with your change which is exposed to any one in the world. you can try this yourself bu opening the same page now from another computer&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;for example lets say that i need to track all changes not that has happened to that page, i can simply click on show changes on the left . it will show me all the changes to that page&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;a very great feature is also the "recent changes" from the left pane , click on that . you can now see all the changes to the current namespace and you can even filter by author. let's filter by my name for example "Hussein". click in the combo box "Authors" and click "H" in the keyboard then down to "Hussein Computer"&lt;/LI&gt;&lt;/OL&gt;&lt;br /&gt;&lt;P&gt;so now for any site , we should have a wiki just to post our own comments about the site , these comments might be questions , answers , notes , summary , etc....&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112889877147266559?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112889877147266559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112889877147266559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112889877147266559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112889877147266559'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/10/wiki-i-heard-alot-about-wiki-i-always.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112656039198142250</id><published>2005-09-13T00:26:00.000+03:00</published><updated>2005-09-13T00:26:36.686+03:00</updated><title type='text'></title><content type='html'>&lt;H3&gt;&lt;FONT color=#0000ff&gt;Convert Your .NET Apps to Flash ..........&lt;/FONT&gt;&lt;/H3&gt;&lt;br /&gt;&lt;P&gt;wowwwwwwwwwwwwwwwwww&lt;/P&gt;&lt;br /&gt;&lt;P&gt;no need now for JIT or the whole CLR . i dont know what does MS Says now ?&lt;BR&gt;we can really get rid of all the framework .&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;A href="http://www.xamlon.com/software/xamlonpro/flash/"&gt;http://www.xamlon.com/software/xamlonpro/flash/&lt;/A&gt;&lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112656039198142250?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112656039198142250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112656039198142250' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112656039198142250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112656039198142250'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/09/convert-your.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-112215847201423063</id><published>2005-07-24T01:41:00.000+03:00</published><updated>2005-07-31T22:29:02.540+03:00</updated><title type='text'>a VB.NET 2003 Hall of Shame which is now fixed in 2005</title><content type='html'>&lt;h2&gt;&lt;font color="#000080"&gt;A new Solution for Another Hall Of Shame&lt;/font&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;in SQL Server CE v 2.0&amp;nbsp;. i always get this question more and more and more .&amp;nbsp; "is there any way to work online with SQL CE v 2.0 ?"&lt;/p&gt;&lt;br /&gt;&lt;p&gt;unfotunately we cannot use the ADOCE from .NET CF 1.1 since the .NET CF 1.1 doesnt have a COM INTEROP, so the only solution is to use of course the ADO.NET . but what do microsoft enforces us to use an offline behaviour in an online solution . i dont need to work with ADO.NET on .NET CF coz we have a huge number of disadvantages ( HUGE HUGE):&lt;br&gt;1- Loading a Dataset in Memory is eating the memory and i always get "OutofMemory exception"&lt;br&gt;2- going to the DataReader is like leaving one problem to a larger one. DataReaders are readonly .&lt;br&gt;3- i cannot design my DB on the Desktop(unless by a third party tools like SQL CE console)&amp;nbsp;, and this is driving alot of developers to madness.it is very difficult to create a DB and Schema on the Device itself .&lt;br&gt;4- the SQL CE v 2.0 is very Weak . it doesnt support anything except just plain tables. i cannot have views . i cannot have anything.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;and alot more...............................&lt;/p&gt;&lt;br /&gt;&lt;p&gt;unfortunately some enterprise solutions i have seen myself is totally built on XML instead of SQL Server CE v 2.0 . i asked the develoeprs there "why?" they said we have alot of functionality beyond that in the SQL CE.&lt;br&gt;Honestly , the only good things i see in SQL CE v.20 are :&lt;br&gt;1- Seek method . i have built a solution with a 350,000 records in one table and the seek method has just taken 1 second for returning a specific row in the worst case.&lt;br&gt;2- compact DB.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;font color="#800000"&gt;and now the real fun begin :&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;font color="#800000"&gt;&lt;br /&gt;&lt;p&gt;&lt;br&gt;&lt;font color="#000000"&gt;the SQL Mobile&lt;/font&gt; :&lt;br&gt;&lt;/font&gt;&lt;font color="#000000"&gt;1- Supports ResultSets so we can now (AT&amp;nbsp;LAST) work online , instead of loading all the Dataset in memory.&lt;br&gt;2- Multiple connections on the same DB . this was one of the most annoying thing for me .&lt;br&gt;3- you can design your complete solution and test it on the desktop and then deploy it to the device.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;and moreeeeee............&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-112215847201423063?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/112215847201423063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=112215847201423063' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112215847201423063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/112215847201423063'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/07/vbnet-2003-hall-of-shame-which-is-now.html' title='a VB.NET 2003 Hall of Shame which is now fixed in 2005'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-111347416570465307</id><published>2005-04-14T13:22:00.000+03:00</published><updated>2005-04-14T13:29:15.206+03:00</updated><title type='text'></title><content type='html'>&lt;h2&gt;&lt;font color="#000080"&gt;Centralized Exception handling&lt;/font&gt; &lt;font color="#000080"&gt;in Windows Forms :&lt;/font&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;can we really have a centralized exception management in windows forms apps ?&lt;br&gt;we always hear this :&lt;br&gt;1- i need a procedure to be triggered whenever any error in the applciation is fired (may be just to log and trace) without writing try and catch blocks.&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;&lt;font color="#ff0000"&gt;in VB.NET :&lt;/font&gt;&lt;/h4&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;&lt;p&gt;shared sub main()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler&lt;/font&gt;&lt;font size="2"&gt; Application.ThreadException, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;AddressOf&lt;/font&gt;&lt;font size="2"&gt; s1&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end sub&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;br /&gt;&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; s1(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Object&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; Threading.ThreadExceptionEventArgs)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Centralized Exception trapping")&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;br /&gt;&lt;h4&gt;&lt;font color="#ff0000"&gt;in C#.NET :&lt;/font&gt;&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;static void main()&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp; &lt;font size="2"&gt;Application.ThreadException += &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; ThreadExceptionEventHandler(Application_ThreadException);&lt;br&gt;&lt;/font&gt;}&lt;/p&gt;&lt;font size="2"&gt;&lt;br /&gt;&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;static&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; Application_ThreadException(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, System.Threading.ThreadExceptionEventArgs e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Centralized Exception trapping");&lt;br&gt;}&lt;/p&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-111347416570465307?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/111347416570465307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=111347416570465307' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111347416570465307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111347416570465307'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/04/centralized-exception-handling-in.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-111273353132988094</id><published>2005-04-05T23:38:00.000+03:00</published><updated>2005-04-05T23:38:51.330+03:00</updated><title type='text'></title><content type='html'>&lt;h2&gt;&lt;font color="#000080"&gt;Compile of VB &lt;font color="#0000ff"&gt;Imports&lt;/font&gt; vs. C# &lt;/font&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&amp;nbsp;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;let's look at this Console App written in VB . &lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;&lt;p&gt;Imports&lt;/font&gt;&lt;font size="2"&gt; System.Data&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Imports&lt;/font&gt;&lt;font size="2"&gt; System.Windows.Forms&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;Class&lt;/font&gt;&lt;font size="2"&gt; class1&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shared&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; Main()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Writeline("Welcome")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;br&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Class&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;open the ConsoleApplication1.exe with ILDASM and have a look in manifest . &lt;font color="#ff0000"&gt;&lt;strong&gt;UNFORTUNATELY&lt;/strong&gt;&lt;/font&gt; vb compiler generated IL still references the system.data although it is not used in our app .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#000000"&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;FORTUNATELY&lt;/font&gt;&lt;/strong&gt;&amp;nbsp; This is not the case in C#. try the same thing in C# , we find that C# compiler is smart enough to remove the unreferenced dlls from IL .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#800000"&gt;&lt;strong&gt;a point to C# against VB :-)&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-111273353132988094?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/111273353132988094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=111273353132988094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111273353132988094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111273353132988094'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/04/compile-of-vb-imports-vs.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-111193422336610544</id><published>2005-03-27T17:37:00.000+03:00</published><updated>2005-03-27T17:37:03.366+03:00</updated><title type='text'></title><content type='html'>&lt;h2&gt;&lt;font color="#000080"&gt;Cutting the Chain Of overriding&lt;/font&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;let's see how to Override a method in VB.NET&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;font size="0"&gt;&lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;Class&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial" size="2"&gt;Parent&amp;nbsp;&lt;br&gt;&lt;font color="#0000ff"&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public&lt;/font&gt; &lt;font color="#0000ff"&gt;Overridable&lt;/font&gt; &lt;font color="#0000ff"&gt;Sub&lt;/font&gt; Test()&amp;nbsp;&lt;br&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;End&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;Sub &lt;br&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;End&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;Class&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Arial" size="2"&gt;Class&lt;/font&gt;&lt;font face="Arial" size="2"&gt;Child&amp;nbsp;&lt;br&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Inherits Parent&amp;nbsp;&lt;br&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public Overrides Sub&lt;/font&gt;&lt;font face="Arial" size="2"&gt;Test()&amp;nbsp;&lt;br&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;End&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;Sub &lt;br&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;End&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;Class&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Arial" size="2"&gt;Class&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;MoreChild&amp;nbsp;&lt;br&gt;&lt;font color="#0000ff"&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Inherits&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial" size="2"&gt;Child&amp;nbsp;&lt;br&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public&lt;/font&gt; &lt;font color="#0000ff"&gt;Overrides&lt;/font&gt; &lt;font color="#0000ff"&gt;Sub&lt;/font&gt; Test()&amp;nbsp;&lt;br&gt;&lt;font color="#0000ff"&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;End&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;Sub &lt;br&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;End&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;Class&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;font size="0"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#000000" face="Arial" size="2"&gt;so can we cut the chain of permission for overriding the Test() method in Child ( i no more need anyone to be able to Override this method, my behaviour is the ultimate so i need to stop permitting my childs to override me )&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="0"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#000000" size="2"&gt;&lt;font face="Arial"&gt;we can do this in VB.NET by using &lt;strong&gt;&lt;font color="#000080"&gt;&lt;font size="4"&gt;NotOverridable&lt;span class="432112917-22032005"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="0"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#000080" face="Arial" size="2"&gt;so class child can be written like this :&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000080"&gt;&lt;font face="Arial" size="2"&gt;Class&lt;/font&gt;&lt;font color="#000000" face="Arial" size="2"&gt;Child&amp;nbsp;&lt;br&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Inherits Parent&amp;nbsp;&lt;br&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public &lt;strong&gt;NotOverridable&lt;/strong&gt; Overrides Sub&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;Test()&amp;nbsp;&lt;br&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;span class="432112917-22032005"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;End&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;Sub &lt;br&gt;End&lt;/font&gt; &lt;font color="#0000ff"&gt;Class&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Arial"&gt;&lt;font color="#000080"&gt;&lt;font size="2"&gt;so now we get a compilation error in MoreChild .&lt;span class="432112917-22032005"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="0"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#000080" face="Arial" size="2"&gt;but how can we do this in C# ?&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="0"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#000080" face="Arial" size="2"&gt;unfortunately it cant be done ............. this is another VB vs C# competetion features ...&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-111193422336610544?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/111193422336610544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=111193422336610544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111193422336610544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111193422336610544'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/03/cutting-chain-of-overriding-lets-see_27.html' title=''/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-111004084985935047</id><published>2005-03-05T19:40:00.000+03:00</published><updated>2005-03-05T19:40:49.950+03:00</updated><title type='text'>SO WHAT exactly is a variable type ?</title><content type='html'>&lt;p&gt;&lt;font face="Arial" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;I&amp;nbsp;asked &amp;nbsp;&lt;/font&gt;&lt;a title="http://www.interact-sw.co.uk/iangblog/" href="http://www.interact-sw.co.uk/iangblog/"&gt;&lt;font title="http://www.interact-sw.co.uk/iangblog/" color="#000080"&gt;&lt;font title="http://www.interact-sw.co.uk/iangblog/" face="Arial" size="2"&gt;Ian Griffiths&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt;&amp;nbsp;about "SO WHAT exactly is a variable type" ? i think it is the most important question in .NET . for me this is the most exciting question i have faced during the last 6 years about .NET .&amp;nbsp; what exactly is a variable type ?&lt;br /&gt; let's take an example : String s&amp;nbsp; = "Something " ;&amp;nbsp; so the question is "is the LHS and RHS are both of type string?"&lt;br /&gt; another example : Parent P = new Child ();&amp;nbsp; again the same question "is the type of the LHS is Parent or child ? "&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;this is Ian Answer (copy of his email) :&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;font color="#000080" size="2"&gt;&lt;font size="3"&gt;There&amp;rsquo;s one question you asked, which is actually ambiguous:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;&amp;gt;&lt;/font&gt; &lt;font size="3"&gt;So what exactly is the type of the LHS ?&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000080"&gt;&lt;font size="3"&gt;The key to understanding this issue is to understand why that question is ambiguous. And to grasp, that, I ask this question in return:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;"What do you mean by &amp;lsquo;the type&amp;rsquo;?"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;There are at least 3 answers to this question that seem reasonable, and which contradict one another:&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;font size="3"&gt;it&amp;rsquo;s the type of whatever the variable refers to, so in your examples, the type of &amp;lsquo;s&amp;rsquo; is String, and the type of &amp;lsquo;p&amp;rsquo; is Child.&lt;/font&gt;&lt;/li&gt; &lt;li&gt;&lt;font size="3"&gt;It&amp;rsquo;s the type associated with the named location the variable represents, so &amp;lsquo;s&amp;rsquo; would be String, and &amp;lsquo;p&amp;rsquo; would be Parent&lt;/font&gt;&lt;/li&gt; &lt;li&gt;&lt;font size="3"&gt;its type is something else&lt;/font&gt;&lt;/li&gt; &lt;li&gt;&lt;font size="3"&gt;it does not have a type &amp;ndash; in the .NET type system, you cannot define a type that represents what a variable is&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;font size="3"&gt;To understand why 3 or 4 might even be options, let&amp;rsquo;s look at why neither 1 nor 2 can be strictly correct.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;The interesting thing is that both 1 and 2 are useful ideas &amp;ndash; in some situations, one or other of these is the way you will want to look at the code. However, it&amp;rsquo;s clear that 1 is an approximation because it&amp;rsquo;s really looking at the type of the thing being referred to rather than the variable itself.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;But what&amp;rsquo;s wrong with 2? Well, let&amp;rsquo;s consider again your example:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;String s = "Someone";&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;According to both 1 and 2, the type of &amp;lsquo;s&amp;rsquo; is String. But it&amp;rsquo;s easy to prove that this is wrong. The String type is immutable. This is well documented &amp;ndash; there&amp;rsquo;s nothing you can do to a string to change it. All of the methods on String that look like they&amp;rsquo;re going to change it (Trim, ToUpper etc.) leave the String unmodified, and instead create a new String that is the modified version of the original.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;So, we know that String is immutable. If &amp;lsquo;s&amp;rsquo; is of type String, then it must also be immutable. But it&amp;rsquo;s not &amp;ndash; this works:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;s = "Something";&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;We can change &amp;lsquo;s&amp;rsquo;. We can&amp;rsquo;t change the String it refers to, but we can change &amp;lsquo;s&amp;rsquo; so that it refers to a whole new String.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;In other words, there are thing we can do to this variable &amp;lsquo;s&amp;rsquo; that we cannot do to a String. From this, we have to conclude that &amp;lsquo;s&amp;rsquo; is &lt;b&gt;not&lt;/b&gt; something of type String. The variable is &lt;i&gt;associated&lt;/i&gt; with type String &amp;ndash; it is a named location which is only able to hold references to String objects. But the variable itself is not a String.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;So if you consider the following two statements:&lt;/font&gt;&lt;/p&gt; &lt;ul&gt; &lt;li style="list-style: none"&gt; &lt;ul&gt; &lt;li style="list-style: none"&gt; &lt;p&gt;&lt;font size="3"&gt;This object is of type String&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;This variable is of type String&lt;/font&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;font size="3"&gt;it should now be clear that they don&amp;rsquo;t mean the same thing. If an object is of type String, we mean it&amp;rsquo;s a thing that is instance of the String class. That&amp;rsquo;s not what we mean when we say that a variable is of type String &amp;ndash; it&amp;rsquo;s a shorthand for something else. It means that the variable is a thing that is able to hold a reference to a thing that is an instance of the String class.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;So variables are &lt;i&gt;associated&lt;/i&gt; with a type &amp;ndash; it determines what they are able to refer to. But these variables themselves are distinct from the things they refer to. So do the variables themselves have a type?&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;There&amp;rsquo;s one case where variables clearly &lt;i&gt;do&lt;/i&gt; have a type &amp;ndash; and that&amp;rsquo;s when you&amp;rsquo;re using value types. Consider this:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;int i;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;In this case, the variable doesn&amp;rsquo;t refer to an int. It is an int. The value is the variable. This is true for all value types &amp;ndash; when you declare a variable of a value type, that variable is an instance of that type. In these cases, both 1 and 2 above are correct.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;So the question I originally posed only really pertains to reference types. And the essence of the question is whether it&amp;rsquo;s 3 or 4 above &amp;ndash; is there something in the type system of .NET that represents the variable itself, whose behaviour is demonstrably different from the behaviour of the type(s) it is able to refer to.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;Is that any clearer? I know I&amp;rsquo;ve still left the question unanswered. But that&amp;rsquo;s intentional &amp;ndash; I&amp;rsquo;m just trying to make it clear that the answer is not obvious. Do you see the problem now?&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-111004084985935047?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/111004084985935047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=111004084985935047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111004084985935047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/111004084985935047'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/03/so-what-exactly-is-variable-type.html' title='SO WHAT exactly is a variable type ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110960150455720388</id><published>2005-02-28T17:38:00.000+03:00</published><updated>2005-02-28T17:38:24.570+03:00</updated><title type='text'>Passing Data I/O from data Access Tier </title><content type='html'>&lt;p&gt;&lt;font face="Arial" size="2"&gt;there are 4 ways to pass data I/O from data access layer .&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;&lt;font face="Arial"&gt;&lt;strong&gt;1- Scalar Values :&lt;/strong&gt; &lt;font size="2"&gt;In this case, the caller does not need to know the&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial" size="2"&gt;structure of the entity. it is the most efficient input because only the necessary data is passed . The main disadvantage of this approach is that changes in the underlying data structure may require a corresponding change in the method signature .&lt;/font&gt; &lt;font face="Arial" size="2"&gt;If the method signature needs to be altered to take account of a new field for example , all uses of that method must be tracked down and changed.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font&gt;&lt;font size="4"&gt;&lt;strong&gt;&lt;font face="Arial"&gt;2- XML Strings :&lt;/font&gt;&lt;/strong&gt; &lt;font face="Arial" size="2"&gt;passing data by using a single&lt;/font&gt; &lt;font face="Arial" size="2"&gt;data structure .&lt;/font&gt;&lt;font face="Arial" size="2"&gt;By gathering all of the data for a&lt;/font&gt; &lt;font face="Arial" size="2"&gt;business entity , exchanges between applications become much more&lt;/font&gt; &lt;font face="Arial" size="2"&gt;efficient because data is not broken into multiple discrete units. another advantage will be that XML can be digested by almost every application . &lt;font face="Arial"&gt;The disadvantage of this technique is : tagged data introduces reduntant information .&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font face="Arial" size="4"&gt;&lt;strong&gt;3- Datasets :&amp;nbsp;&amp;nbsp;&lt;/strong&gt;&lt;font size="2"&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a-&lt;/font&gt; &lt;font size="2"&gt;has&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial"&gt;&lt;font size="2"&gt;optimistic concurrency issues built in on the contrary to ADO objects .&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b-&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;font&gt;&lt;font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;can hold collections of data corresponding to individual business entities (implemented as table rows) and are well-adapted to hierarchical data.&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c-&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;font&gt;&lt;font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;When a method accepts a&lt;/font&gt; &lt;b&gt;&lt;font face="Arial,Bold"&gt;DataSet&lt;/font&gt;&lt;/b&gt; &lt;font face="Arial"&gt;as an input type, changes to the&lt;/font&gt; &lt;b&gt;&lt;font face="Arial,Bold"&gt;DataSet&lt;/font&gt;&lt;/b&gt; &lt;font face="Arial"&gt;schema do not require changes to the method signature.&amp;nbsp;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d- &lt;font face="Arial"&gt;incorporate the advantages of XML formats because they can be quickly serialized and deserialized.&lt;br /&gt; Disadvatages : a- big object in memory resulting in high marshaling costs .&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font size="4"&gt;&lt;strong&gt;4- Custom Entity Components&lt;/strong&gt; &lt;strong&gt;:&lt;/strong&gt; &lt;font size="2"&gt;are implemented as classes or structs(which has better performance &amp;nbsp;. it is a more flexible dynamic way than datasets . they typically represents the underlying business entities (e.g Employee class representing an Employee ). they can also be serialized as XML . they can&amp;nbsp; be created to avoid the high marshaling costs of datasets while gaining the adv of strong typing .&lt;br /&gt; Disadvantages :&amp;nbsp;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a- representing these entities in Collection will need creating string typed collection or use the ArrayList , which is not the case in Datasets .&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b- the custom collections or the builtin collections in .NET doesnt represent the heirarchy , in contract to datasets&amp;nbsp;relations&amp;nbsp;and also provide filtering and sorting .&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c- binding to controls . they must implement ICollection to be able to be bounded .&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;font face="Arial" size="4"&gt;&lt;strong&gt;&lt;font color="#000080" size="5"&gt;Summary :&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;font size="4"&gt;&lt;font size="1"&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;font size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font size="4"&gt;I-&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; &amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font face="Arial"&gt;&lt;b&gt;DataSets&lt;/b&gt; are recommended if the application is primarily working&lt;/font&gt;&lt;font face="Arial"&gt;with large collections of items and needs standard sorting, filtering,&lt;/font&gt;&lt;font face="Arial"&gt;and searching capabilities. This is especially true if the data needs to&lt;/font&gt;&lt;font face="Arial"&gt;incorporate complex or hierarchical relationships.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;font face="Arial"&gt;&lt;font size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;font size="4"&gt;II-&lt;/font&gt;&lt;/strong&gt; If the application mainly works with instance data (for example, a single&amp;nbsp;&lt;b&gt;Customer&lt;/b&gt; or &lt;b&gt;Project&lt;/b&gt; object), custom business entities will normally be the better choice. There is no need&amp;nbsp;for the overhead of &lt;b&gt;DataSets&lt;/b&gt; when only one row of data is sufficient for most purposes.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p align="left"&gt;&lt;font face="Arial"&gt;&lt;font size="3"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font size="4"&gt;III-&lt;/font&gt;&lt;/strong&gt; In many cases, the time and effort of creating custom business entities will not be worth&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110960150455720388?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110960150455720388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110960150455720388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110960150455720388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110960150455720388'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/passing-data-io-from-data-access-tier.html' title='Passing Data I/O from data Access Tier '/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110915964338115748</id><published>2005-02-23T14:54:00.000+03:00</published><updated>2005-02-23T14:54:03.410+03:00</updated><title type='text'>Passing a value Type ByVal Tricky Question ?</title><content type='html'>&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;this is a small tricky question : ( Very IMP )&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" color="#0000ff" size="4"&gt;&lt;strong&gt;what is the Console.WriteLine&amp;nbsp; going to print ?&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font color="#0000ff"&gt;public class&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial"&gt;&lt;font color="#000080"&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/strong&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;struct&lt;/font&gt; &lt;strong&gt;&lt;font color="#008080"&gt;Value&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public int&lt;/font&gt; i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/font&gt; &lt;font color="#0000ff"&gt;int&lt;/font&gt; i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008000"&gt;//Not Private&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/font&gt; &lt;font color="#0000ff"&gt;int&lt;/font&gt; Prop&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;int&lt;/font&gt; Prop&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&amp;nbsp;&lt;/font&gt; {&lt;font color="#0000ff"&gt;return&lt;/font&gt; i;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff"&gt;get&amp;nbsp;&lt;/font&gt; &lt;font face="Arial"&gt;{&lt;/font&gt;&lt;font face="Arial" color="#0000ff"&gt;return&lt;/font&gt; &lt;font face="Arial"&gt;i;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&lt;/font&gt; {i = &lt;font color="#0000ff"&gt;value&lt;/font&gt;;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; set&amp;nbsp;&lt;/font&gt; &lt;font face="Arial"&gt;{i =&lt;/font&gt; &lt;font face="Arial" color="#0000ff"&gt;value&lt;/font&gt;&lt;font face="Arial"&gt;;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#008080"&gt;&lt;font face="Arial" color="#000000" size="2"&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;font color="#0000ff"&gt;&lt;font face="Arial" size="2"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;b&gt;&lt;font color="#000080"&gt;Example&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private&lt;/font&gt; &lt;b&gt;&lt;font color="#000080"&gt;Reference&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;_r; &lt;font color="#008000"&gt;// Reference type&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private&lt;/font&gt; &lt;b&gt;&lt;font color="#008080"&gt;Value&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;_v; &lt;font color="#008000"&gt;// Value type&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/font&gt; &lt;b&gt;&lt;font color="#000080"&gt;Example&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;()&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _r = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;b&gt;&lt;font color="#000080"&gt;Reference&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _v = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;b&gt;&lt;font color="#008080"&gt;Value&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/font&gt; &lt;b&gt;&lt;font color="#000080"&gt;Reference&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial" size="2"&gt;RefProp&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial"&gt;{&lt;/font&gt;&lt;font face="Arial" color="#0000ff"&gt;return&lt;/font&gt; &lt;font face="Arial"&gt;_r;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial"&gt;{_r =&lt;/font&gt; &lt;font face="Arial" color="#0000ff"&gt;value&lt;/font&gt;&lt;font face="Arial"&gt;;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/font&gt; &lt;b&gt;&lt;font color="#008080"&gt;Value&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial" size="2"&gt;ValueProp&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&amp;nbsp;&lt;/font&gt; {&lt;font color="#0000ff"&gt;return&lt;/font&gt; _v;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial"&gt;{_v =&lt;/font&gt; &lt;font face="Arial" color="#0000ff"&gt;value&lt;/font&gt;&lt;font face="Arial"&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt; &lt;b&gt;&lt;font color="#000080"&gt;Program&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static&lt;/font&gt; &lt;font color="#0000ff"&gt;void&lt;/font&gt; Main(&lt;font color="#0000ff"&gt;string&lt;/font&gt;[] args)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;&lt;font face="Arial"&gt;&lt;font color="#000080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Example&lt;/font&gt;&lt;/font&gt;&lt;/b&gt; &lt;font face="Arial"&gt;e = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;b&gt;&lt;font color="#000080"&gt;Example&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.ValueProp.i = 4;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;font color="#000080"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Console&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size="2"&gt;.WriteLine(e.ValueProp.i);&amp;nbsp; &lt;font color="#008000" size="5"&gt;&lt;strong&gt;// what is going to be printed after this line&lt;/strong&gt;&lt;/font&gt; &lt;strong&gt;&lt;font color="#008000" size="5"&gt;?&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;take care of the line :&amp;nbsp; e.ValueProp.i = 4;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;let's divide this line , e.ValueProp is going to return an instance of the Value Struct , then we go ahead and change the "i" field on this struct&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;so first part is getting the Value instance&amp;nbsp;from the ValueProp :&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color="#008080"&gt;Value&lt;/font&gt; v1 = e.ValueProp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008000"&gt;//is V1 is going to take a copy of the returned Value instance or going to reference this instance ?&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008000"&gt;// of course it is going to take a copy . coz this is a value type byVal assignment&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000" size="6"&gt;&lt;strong&gt;SO&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;v1.i = 4;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008000"&gt;//is going to change the "i" field on the copied Instance not the original&lt;/font&gt; . &lt;font color="#ff0000"&gt;so the Console.WriteLine should Print 0&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008000"&gt;// but the Compiler detects this issue and throw a compile error .&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110915964338115748?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110915964338115748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110915964338115748' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110915964338115748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110915964338115748'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/passing-value-type-byval-tricky.html' title='Passing a value Type ByVal Tricky Question ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110908829738502294</id><published>2005-02-22T19:04:00.000+03:00</published><updated>2005-04-19T20:16:10.740+03:00</updated><title type='text'>Why Do We have Different exception Classes ?</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;i still get the same question frequently . why do we have more than 1 exception class ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;isnt it enough to write code like this :&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000080;"&gt;&lt;strong&gt;try {&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000080;"&gt;&lt;strong&gt;&lt;span style="color:#008080;"&gt;// protected Code&lt;/span&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000080;"&gt;&lt;strong&gt;catch (Exception ex)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#000080;"&gt;&lt;strong&gt;{ // switch (ex)  and handle each exception separately }&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;the exception class will catch all kind of exceptions . and we can internally handle each exception separately .&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;no , this is not enough , why ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;let's take this sample&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="color:#000080;"&gt;&lt;strong&gt;try {&lt;span style="font-size:85%;"&gt;System.IO.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;File&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:85%;color:#000080;"&gt;.Delete("z:\filenotfound.txt");}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#000080;"&gt;&lt;strong&gt;catch (exception ex) { &lt;span style="color:#008080;"&gt;//what can we do here if we need to know the name of the file which is not found ?&lt;/span&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;so there must be some "Data" about the kind of exception taking place , in our case the name of the file .so that's why we have &lt;b&gt;&lt;span style="font-size:85%;color:#000080;"&gt;FileNotFoundException . so it is much more convinient to write something like this :&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;color:#000080;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;strong&gt;try {&lt;span style="font-size:85%;"&gt;System.IO.&lt;/span&gt;&lt;span style="font-size:85%;color:#000080;"&gt;File&lt;/span&gt;&lt;span style="font-size:85%;"&gt;.Delete("z:\filenotfound.txt");}&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;catch (FileNotFoundException ex) { Console.Writeline(ex.FileName);}&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;another example will be the &lt;b&gt;&lt;span style="font-size:85%;color:#000080;"&gt;ArgumentOutOfRangeException : we need to know the original value of the argument which is out of range .&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-size:85%;color:#000080;"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;color:#000080;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;strong&gt;try {&lt;span style="font-size:85%;color:#008080;"&gt;//cause some argument out of range error&lt;/span&gt;&lt;span style="font-size:85%;"&gt;;}&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;catch (ArgumentOutOfRangeException ex) { Console.Writeline(ex.&lt;span style="font-size:85%;"&gt;ActualValue&lt;/span&gt;);}&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-size:130%;color:#000000;"&gt;VS 2005 :&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;so what is new in 2005 . in VS 2005 we have all the exception classes having a new property which is : Data , that contains all the information available about this error . it looks like the event model of .NET where Microsoft encapsulates all the information about any event in the second parameter of the event "EventArgs e". so now we have "Exception.Data"&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110908829738502294?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110908829738502294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110908829738502294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110908829738502294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110908829738502294'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/why-do-we-have-different-exception.html' title='Why Do We have Different exception Classes ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110856018703985003</id><published>2005-02-16T16:23:00.000+03:00</published><updated>2005-02-16T16:23:07.076+03:00</updated><title type='text'>Why do we have 2 Comaprison Operators in VB ?</title><content type='html'>&lt;p&gt;&lt;font face="Arial" size="2"&gt;the 2 comparison operators i am talking about here are : "&lt;strong&gt;&lt;font size="4"&gt;Is&lt;/font&gt;&lt;/strong&gt;" and "&lt;strong&gt;&lt;font size="4"&gt;=&lt;/font&gt;&lt;/strong&gt;"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;actually , the existence of both of them returns to the old VB6 . coz for old classes we used to have 3 property accessors : "&lt;strong&gt;Let&lt;/strong&gt; , &lt;strong&gt;get&lt;/strong&gt; and &lt;strong&gt;set&lt;/strong&gt; " and the old mistake "&lt;strong&gt;default properties&lt;/strong&gt; "&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;so we can say simply in VB6 :&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;Label1 = "User Name : "&amp;nbsp;&amp;nbsp; which means&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;Let&lt;/font&gt; Label1 = "User Name : "&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;and we can also say&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;Label1 = new Label()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;which means&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;Set&lt;/font&gt; Label1 = new label()&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;so in the past if we say :&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;if&amp;nbsp; label1 = "User name"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &lt;font color="#008000"&gt;'do something&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this is a using of the opreator "="&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;but if we say&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Label1 = label2 then &lt;font color="#008000"&gt;'do something&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this invokes the "Is" operator .&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;we no more have "set" in VB.NET , so some people think "Is" should have been removed from the language as well and have only 1 comparison .&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font&gt;&lt;font face="Arial" size="2"&gt;but it is due to simplicity and more readability (from my point of view) that they still keep the "Is" so we still have reference comaprison as well as value comparison or else we are going to write it as the other languages&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;em&gt;Object.ReferenceEquals(a,b)&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp; . so using "Is" is much more readable and cleaner ..&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110856018703985003?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110856018703985003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110856018703985003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110856018703985003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110856018703985003'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/why-do-we-have-2-comaprison-operators.html' title='Why do we have 2 Comaprison Operators in VB ?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110847805241345525</id><published>2005-02-15T17:34:00.000+03:00</published><updated>2005-02-15T17:34:12.433+03:00</updated><title type='text'>Another Hall Of Shame </title><content type='html'>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;font color="#0000ff"&gt;Constructor for ArgumentNullException&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;font color="#0000ff"&gt;public ArgumentNullException( string paramName, string message)&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&amp;nbsp;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;font color="#0000ff"&gt;Constructor for ArgumentException&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;font color="#0000ff"&gt;public ArgumentException( string message, string paramName)&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;ArgumentNullException does not follow the constructor pattern&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110847805241345525?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110847805241345525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110847805241345525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110847805241345525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110847805241345525'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/another-hall-of-shame.html' title='Another Hall Of Shame '/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110838055584586113</id><published>2005-02-14T14:29:00.000+03:00</published><updated>2005-02-14T14:29:15.886+03:00</updated><title type='text'>Installing the msn Toolbar beta on windows 2003 Server</title><content type='html'>&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;font size="2"&gt;msiexec &lt;nobr&gt;&lt;wbr /&gt;&lt;/nobr&gt;/i MsnToolbarSuite.msi TBSDEVCODE=1&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110838055584586113?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110838055584586113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110838055584586113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110838055584586113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110838055584586113'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/installing-msn-toolbar-beta-on-windows.html' title='Installing the msn Toolbar beta on windows 2003 Server'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110831030643362735</id><published>2005-02-13T18:58:00.000+03:00</published><updated>2005-02-13T18:58:26.450+03:00</updated><title type='text'>unboxing in VB is different than C#</title><content type='html'>&lt;p&gt;&lt;font face="Arial" color="#0000ff" size="2"&gt;another point for VB against C#&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" color="#0000ff" size="2"&gt;let's do this example :&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" color="#0000ff" size="2"&gt;&lt;strong&gt;&lt;font color="#000000" size="4"&gt;in C# :&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt; i = 7;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&amp;nbsp;myObj;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;myObj = (&lt;font color="#0000ff"&gt;object&lt;/font&gt;)i; &lt;font color="#008000"&gt;//boxing&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;long&lt;/font&gt; j = (&lt;font color="#0000ff"&gt;long&lt;/font&gt;)o;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008000"&gt;//InvalidCastException&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="+0"&gt;the CLR will only let you convert it back to Integer&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;strong&gt;&lt;font size="4"&gt;in VB :&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt; i &lt;font color="#0000ff"&gt;As&lt;/font&gt; &lt;font color="#0000ff"&gt;Integer&lt;/font&gt;&lt;/font&gt; &lt;font face="Arial"&gt;= 4&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt; myobj &lt;font color="#0000ff"&gt;As&lt;/font&gt; &lt;font color="#0000ff"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;myobj = i&amp;nbsp; &lt;font color="#008000"&gt;'boxing&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt; j &lt;font color="#0000ff"&gt;As&lt;/font&gt; &lt;font color="#0000ff"&gt;Long&lt;/font&gt; = &lt;font color="#0000ff"&gt;CType&lt;/font&gt;(myobj, &lt;font color="#0000ff"&gt;Long&lt;/font&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008080"&gt;'unboxing works fine&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font color="#008080" size="2"&gt;'However&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;Dim k as long = DirectCast (myobj, Long)&amp;nbsp; 'Generates an error coz DirectCast Bypass VB Helper Funs&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;&lt;u&gt;&lt;strong&gt;How is Works :&lt;/strong&gt;&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="+0"&gt;&lt;em&gt;To make this work,&amp;nbsp;the compiler emits a&amp;nbsp;conversion from Object as a call to a helper function. The helper function takes the&amp;nbsp;Object,&amp;nbsp;looks at the type of the value contained in it and then does the appropriate conversion to the target type.&lt;/em&gt; &lt;em&gt;this means an extra step . it might be an extra step in the wrong direction in case i know the returned type , so i will only lose some performace.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="+0"&gt;&lt;em&gt;&lt;strong&gt;&lt;font color="#000080"&gt;so the Rule is :&lt;/font&gt;&lt;/strong&gt; if i know the result TYPE i would use DirectCast which bypasses the VB helper functions ,&amp;nbsp;and i get some performance gain .&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="+0"&gt;&lt;em&gt;as you see , the Default is the helper funs , so the language by default (cint , clong , ctype , etc ... ) can unbox to any type unless you need to switch off this nice feature using DirectCast .&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="+0"&gt;&lt;em&gt;this means that , it is not possible to express all VB language in IL . there are some helper functions like Late Binding ( i will take about this later in coming post) which is not found in IL . that's why we need Microsoft.visualbasic.dll in all the VB projects and we cannot remove that reference .&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110831030643362735?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110831030643362735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110831030643362735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110831030643362735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110831030643362735'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/unboxing-in-vb-is-different-than-c.html' title='unboxing in VB is different than C#'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110823573375140986</id><published>2005-02-12T22:15:00.000+03:00</published><updated>2005-02-14T12:53:26.326+03:00</updated><title type='text'>at Last i found Why don't I get an exception when I divide by zero in VB.NET?</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;of course not everyone will like this explanation coz it is deep technical , but this is the Man Behind VB.NET reply to that question&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;While &lt;a title="http://weblogs.asp.net/rosherove/posts/23853.aspx" href="http://weblogs.asp.net/rosherove/posts/23853.aspx"&gt;talking about exception handling&lt;/a&gt;, &lt;a title="http://weblogs.asp.net/rosherove" href="http://weblogs.asp.net/rosherove"&gt;Roy&lt;/a&gt; ran up against a change in behavior from VB6 to VB.NET. In VB6, if you evaluate the expression "x = x / 0", you'll immediately get a divide by zero exception. In VB.NET, if you evaluate the same expression, no exception is thrown. Instead the value of x is now NaN, also known as "Not a Number." In reality, you could get this behavior in VB6 as well - on the Compile tab of the project properties, there's an "Advanced Optimizations" button that includes an option "Remove Floating Point Error Checks." If you check that and make an exe (it doesn't affect F5 in the IDE), then the assignment will work and x will contain the value NaN.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The reason for all this is that floating point numbers (as defined by the &lt;a title="http://www.ieee.org/" href="http://www.ieee.org/"&gt;IEEE&lt;/a&gt;) support a number of special values that aren't usually surfaced to VB programmers. In addition to NaN, a floating point variable can also contain the values positive and negative infinity. Not being a numerical expert, I won't even pretend to explain what these values are for or why the IEEE felt they were important to include as part of the definition of floating point numbers. The bottom line is that they are there. By default in VB6, though, we inserted X86 instructions that checked for the various non-numerical states and would throw an exception if you encountered one. In VB.NET, however, things were complicated by the way that the CLR IL was designed, namely the fact that it doesn't support a really efficient way to check for non-numerical results. In VB 2002, we tried simulating the VB6 behavior by emitting CKFINITE opcodes after each floating point operation, but this absolutely tanked all floating point performance. So we ended up dropping the VB6 behavior, and now floating point division by zero will result in NaN instead of an exception.&lt;/p&gt;&lt;p&gt;A related issue is that most processors' FPU registers can handle floating point numbers with a higher precision than can be stored in the standard .NET Double datatype. As a result, depending on how the CLR JIT compiler enregisters variables and temporary values, it's possible that floating point operations (including comparisons) can be done at differing levels of precision. For example, the following code could print "False" instead of "True":&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;Dim d1, d2 As Double&lt;br /&gt;&lt;br /&gt;d1 = Atn(-1)&lt;br /&gt;d2 = Atn(-1)&lt;br /&gt;&lt;br /&gt;If d1 = d2 Then&lt;br /&gt;    Console.WriteLine("True")&lt;br /&gt;Else&lt;br /&gt;    Console.WriteLine("False")&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;That's because one of the variables could be left in a FPU register while the other variable is actually stored back on the stack. When you compare the two values, they aren't equal because one of the values was truncated (so it could be stored on the stack) and the other value wasn't. By default, VB6 suppressed this behavior by emitting X86 code to truncate values that were at higher precisions. (You can turn this off on the advanced optimizations page, too, under the option "Allow Unrounded Floating Point Operations.") But the CLR equivalent - inserting CONV.R8 opcodes everywhere a higher precision value might be used - had similar performance problems to the NaN checks.&lt;/p&gt;&lt;p&gt;As a result, VB.NET floating point operations are much "closer to the metal," which is either a good thing or a bad thing depending on your perspective. You definitely have to be a little more aware of what you're doing when dealing with floating point numbers...&lt;/p&gt;&lt;hr id="null"&gt;&lt;br /&gt;&lt;p&gt;In a response to my previous entry, &lt;a title="http://www.addressof.com/blog/" href="http://www.addressof.com/blog/"&gt;Cory&lt;/a&gt; asks:&lt;/p&gt;&lt;blockquote&gt;...how would you solve the comparison of two values if one is still on the stack and the other has been [stored in a register]? In other words, what would be the proper way to handle this type of situation (work around, etc.)?&lt;/blockquote&gt;&lt;p&gt;A good question, and one that I should have addressed. You can get the compiler to insert explicit CONV.R8 opcodes by using the CDbl() conversion operator. So the code example would look like:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;Dim d1, d2 As Double&lt;br /&gt;&lt;br /&gt;d1 = Atn(-1)&lt;br /&gt;d2 = Atn(-1)&lt;br /&gt;&lt;br /&gt;If CDbl(d1) = CDbl(d2) Then&lt;br /&gt;    Console.WriteLine("True")&lt;br /&gt;Else&lt;br /&gt;    Console.WriteLine("False")&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;If you look at the code this compiles to, you should see CONV.R8 opcodes after each local is loaded, and that should force the values to both be truncated&lt;/p&gt;&lt;a title="http://www.panopticoncentral.net/articles/916.aspx" href="http://www.panopticoncentral.net/articles/916.aspx"&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110823573375140986?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110823573375140986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110823573375140986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110823573375140986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110823573375140986'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/at-last-i-found-why-dont-i-get.html' title='at Last i found Why don&apos;t I get an exception when I divide by zero in VB.NET?'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110822043195868648</id><published>2005-02-12T18:00:00.000+03:00</published><updated>2005-02-12T18:00:32.010+03:00</updated><title type='text'>Can We turn OFF the background compilation for VB</title><content type='html'>&lt;p&gt;&lt;font face="Arial" size="2"&gt;no we cannot do that . there were many requests for that in VB 2002 coz huge projects were slow , but this was solved in 2003 . the main reason why MS cannot give a switch to turn off this feature is :&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font&gt;The information provided by background compilation drives Intellisense, it enables the WinForms designer (as well as all other designers), it fills the dropdowns at the top of the window, it drives the object browser, it enables go to definition, etc, etc, etc. Essentially, &lt;font color="#0000ff"&gt;without background compilation, the IDE becomes Notepad.exe with syntax coloring&lt;/font&gt;. (Coloring, interestingly enough, does &lt;em&gt;not&lt;/em&gt; require background compilation because it's entirely based off the lexical grammar of the language and requires no further knowledge of the code.)&lt;/font&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110822043195868648?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110822043195868648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110822043195868648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110822043195868648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110822043195868648'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/can-we-turn-off-background-compilation.html' title='Can We turn OFF the background compilation for VB'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110821891897430246</id><published>2005-02-12T17:35:00.000+03:00</published><updated>2005-02-12T17:35:18.986+03:00</updated><title type='text'>another Point for VB against C#</title><content type='html'>&lt;font face="Arial" size="2"&gt;&amp;nbsp;&lt;/font&gt;  &lt;p&gt;&lt;b&gt;&lt;font color="#ff0000"&gt;&lt;font size="2"&gt;this is another VB vs C# thing :&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;some people say : Given VBA's long history with Office, one might expect VB .NET to be the primary language among .NET developers using Office as a platform. But I've seen a lot of evidence that C# usage of Visual Studio Tools for Office (aka VSTO) is high.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;so programming against Office is one of those places where VB has got it over C# hands-down&lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;font size="4"&gt;1-&lt;/font&gt;&lt;/b&gt; &lt;font size="2"&gt;&lt;b&gt;C# can&amp;rsquo;t bind to Word&amp;rsquo;s Close event and VB can&lt;/b&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;in C# we cannot have :&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" color="#0000ff" size="2"&gt;private&lt;/font&gt; &lt;font face="Times New Roman" color="#0000ff" size="2"&gt;void&lt;/font&gt; &lt;font face="Times New Roman" size="2"&gt;ThisDocument_CloseEvent()&lt;/font&gt;&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;while in VB we have :&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" color="#0000ff" size="2"&gt;Private&lt;/font&gt; &lt;font face="Times New Roman" color="#0000ff" size="2"&gt;Sub&lt;/font&gt; &lt;font face="Times New Roman" size="2"&gt;ThisDocument_CloseEvent()&lt;/font&gt; &lt;font face="Times New Roman" color="#0000ff" size="2"&gt;Handles&lt;/font&gt; &lt;font face="Times New Roman" color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;font face="Times New Roman" size="2"&gt;.CloseEvent&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" color="#0000ff" size="2"&gt;End&lt;/font&gt; &lt;font face="Times New Roman" color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;font size="4"&gt;2-&lt;/font&gt; &lt;font size="2"&gt;printing a word document , since VB Supports named Arguments , :&lt;/font&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;in VB : Doc.PrintOut(Copies := 2, Collate := true)&lt;/p&gt; &lt;p&gt;in C# :&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman"&gt;object copies = 2;&lt;br /&gt; object collate = true;&lt;br /&gt; Doc.PrintOut(ref missing, ref missing, ref missing, ref missing,&lt;br /&gt; ref missing, ref missing, ref missing, ref copies,&lt;br /&gt; ref missing, ref missing, ref missing, ref collate,&lt;br /&gt; ref missing, ref missing, ref missing, ref missing,&lt;br /&gt; ref missing, ref missing);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110821891897430246?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110821891897430246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110821891897430246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110821891897430246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110821891897430246'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/another-point-for-vb-against-c.html' title='another Point for VB against C#'/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10554145.post-110728591897516284</id><published>2005-02-01T22:15:00.000+03:00</published><updated>2005-02-01T22:25:18.976+03:00</updated><title type='text'>msn search </title><content type='html'>now you can search any where&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.imagine-msn.com/search/tour/desktop.aspx"&gt;http://www.imagine-msn.com/search/tour/desktop.aspx&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10554145-110728591897516284?l=husseindotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://husseindotnet.blogspot.com/feeds/110728591897516284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10554145&amp;postID=110728591897516284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110728591897516284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10554145/posts/default/110728591897516284'/><link rel='alternate' type='text/html' href='http://husseindotnet.blogspot.com/2005/02/msn-search.html' title='msn search '/><author><name>test2512</name><uri>http://www.blogger.com/profile/07056436975058052253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
