<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Subbu's Tech blog</title><description></description><managingEditor>noreply@blogger.com (Subramanya P)</managingEditor><pubDate>Sat, 14 Sep 2024 08:25:03 -0700</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">56</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://subbusspace.blogspot.com/</link><language>en-us</language><item><title>ServiceKnownType on WCF</title><link>http://subbusspace.blogspot.com/2011/02/serviceknowntype-on-wcf.html</link><category>ServiceKnownType on WCF</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Mon, 7 Feb 2011 04:50:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-5535567285404785848</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;Back after a long time! Work keeps me off from all other work that I “want” to do &lt;span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Ok, on this post I would be explaining on a wcf data contract which is not used on any of the methods. Wondering what is special? When you have a data contract and not used for any messages, the client proxy will not create that class at all. That means, either you create that class on your client to use it or find a way to get that method on your proxy class. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;I had a situation where I had a method which would accept parameter as Object. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;And based on another parameter I decide on object which is passed by the client. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: 8.0pt;"&gt;Account&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt; GetAccount(&lt;span style="color: #2b91af;"&gt;GetAccountBy&lt;/span&gt; by, &lt;span style="color: blue;"&gt;object&lt;/span&gt; value);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;So if by parameter is Name, I was expecting name of Account and the Type of account to search. So my Datacontract &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;[&lt;span style="color: #2b91af;"&gt;DataContract&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: #2b91af;"&gt;Serializable&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;AccountName&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; AccountName()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; AccountName (&lt;span style="color: blue;"&gt;string&lt;/span&gt; name, &lt;span style="color: #2b91af;"&gt;AccountType&lt;/span&gt; type)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.Name = name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.Type = type;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: #2b91af;"&gt;DataMember&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Name { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[&lt;span style="color: #2b91af;"&gt;DataMember&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;AccountType&lt;/span&gt; Type { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;When I add GetAccount method on my service and expose to client, the AccountName was never getting reflected on the client proxy.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This was because it’s not referred directly on any of the methods and client doesn’t know how to pick that. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;To get this class on client, I had to add an attribute &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 8.0pt;"&gt;[&lt;span style="color: #2b91af;"&gt;ServiceKnownType&lt;/span&gt;(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;AccountName&lt;/span&gt;))]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;On the service and regenerate the proxy. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;You can read about &amp;nbsp;ServiceKnownTypes at&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx&lt;/a&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Branching strategy for Team Foundation Server 2010</title><link>http://subbusspace.blogspot.com/2010/11/branching-strategy-for-team-foundation.html</link><category>TFS 2010</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Mon, 8 Nov 2010 22:55:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-7597385592970460959</guid><description>If you are planning to start with TFS 2010, here are few decks and videos help you on branching&lt;br /&gt;
&lt;br /&gt;
http://intovsts.files.wordpress.com/2010/06/techdays2010_branchingandmergingwithtfs2010.pdf&lt;br /&gt;
&lt;a href="http://channel9.msdn.com/blogs/liese/techdays-2010--branching--merging-strategies-with-team-foundation-server-2010"&gt;http://channel9.msdn.com/blogs/liese/techdays-2010--branching--merging-strategies-with-team-foundation-server-2010&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>How do you monitor your service?</title><link>http://subbusspace.blogspot.com/2010/11/how-do-you-monitor-your-service.html</link><category>wcf performance counter</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Wed, 3 Nov 2010 03:46:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-9166072233270898202</guid><description>&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;Many times we may not even know how many hits we get on the service or which methods are getting the highest hits. We may have some information on logs that tells us what kind of request came in and what happened to the request but how much time did the request take to process etc. may not be available on log. For an enterprise application it is very critical that we have a monitoring in place.&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;We can create our own performance categories and create counters that would tell us what’s going on our service and how much time is it taking etc. We will look at how we can adopt performance counters on our wcf service.&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;if you haven’t used perf monitor, take a look here http://technet.microsoft.com/en-us/library/cc749249.aspx&lt;/div&gt;&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Lets do a sample wcf service and see how we can include perf counters on it &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Create a console app which will create counters that we need to use on our service.&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Make sure you have included &lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; System.Diagnostics;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: green; font-family: Consolas; font-size: 9.5pt;"&gt;//define perf category&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; categoryName = &lt;span style="color: #a31515;"&gt;"My Demo Service"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//counter that we going to use&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; CounterName = &lt;span style="color: #a31515;"&gt;"Get Data calls per sec"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// if exists delete the category Note that you will need to have admin rights to create or delete categories/counters&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;PerformanceCounterCategory&lt;/span&gt;.Exists(categoryName))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;&lt;span style="color: #2b91af;"&gt;PerformanceCounterCategory&lt;/span&gt;.Delete(categoryName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: green;"&gt;//create counters base that we will be using on this category&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; counterDataCollection = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CounterCreationDataCollection&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; callspersecCounter = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;CounterCreationData&lt;/span&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;CounterName = CounterName,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;CounterHelp = &lt;span style="color: #a31515;"&gt;"Get Data calls per sec"&lt;/span&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;CounterType = &lt;span style="color: #2b91af;"&gt;PerformanceCounterType&lt;/span&gt;.RateOfCountsPerSecond32 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;// you can refer help for detailed explanation on different types&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;counterDataCollection.Add(callspersecCounter);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//create the Category&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;&lt;span style="color: #2b91af;"&gt;PerformanceCounterCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;.Create(categoryName, &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;&lt;span style="color: #a31515;"&gt;"My Demo Service"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;, &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;&lt;span style="color: #2b91af;"&gt;PerformanceCounterCategoryType&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;.SingleInstance, counterDataCollection);&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Once you run above code, open perfmon from Administrative tools&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;When you click on App, below pop up will be opened and now you can identify the new category we just added&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIoGT6V7lHySTaZB-vj8xCWGe3vp1yNOGasdwSXXMbAKzFZCeO6g0TnXzLnZHQXq_CLiapvDUbidyebKMwJGslDxh0I7sHgOVZ4uRSWcPQcmM8nu7em1nDHKxJjv-s2uEChUkv617vBQmX/s1600/perf1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIoGT6V7lHySTaZB-vj8xCWGe3vp1yNOGasdwSXXMbAKzFZCeO6g0TnXzLnZHQXq_CLiapvDUbidyebKMwJGslDxh0I7sHgOVZ4uRSWcPQcmM8nu7em1nDHKxJjv-s2uEChUkv617vBQmX/s320/perf1.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Select the counter and click on “OK”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;The perf mon will show something like below&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBzi5PLY34uMfv_eD47wPQrFkQwZLCSSQMxlCqxu7LXMoKuoYWeO-Mc0AlZZD9Z2bFELQV_f73GdhfsEcYDfT-1JMdaPOQ6hnPMLPbuddwJuVK-OTeD2nOvW_bxbvhkwUL1T5Ucj0t9Sp_/s1600/perf2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBzi5PLY34uMfv_eD47wPQrFkQwZLCSSQMxlCqxu7LXMoKuoYWeO-Mc0AlZZD9Z2bFELQV_f73GdhfsEcYDfT-1JMdaPOQ6hnPMLPbuddwJuVK-OTeD2nOvW_bxbvhkwUL1T5Ucj0t9Sp_/s320/perf2.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Since there is no activity the graph looks blank.&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Lets use this counter on our service &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;Create a service method as below&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; GetData(&lt;span style="color: blue;"&gt;int&lt;/span&gt; value)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;var&lt;/span&gt; counter = &lt;span style="color: blue;"&gt;new&lt;/span&gt; System.Diagnostics.&lt;span style="color: #2b91af;"&gt;PerformanceCounter&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"My Demo Service"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"Get Data calls per sec"&lt;/span&gt;, &lt;span style="color: blue;"&gt;false&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;counter.Increment();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; &lt;span style="color: #a31515;"&gt;"data "&lt;/span&gt; + value.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;}&lt;/span&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black;"&gt;This method would just increment the counter and return the same text which is passed. Now lets refer this method and call this for couple of time. &lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;span class="Apple-style-span" style="font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 100; i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;ServiceReference2.&lt;span style="color: #2b91af;"&gt;Service1Client&lt;/span&gt; obj = &lt;span style="color: blue;"&gt;new&lt;/span&gt; ServiceReference2.&lt;span style="color: #2b91af;"&gt;Service1Client&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; retString = obj.GetData(i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (i % 3 == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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; &lt;/span&gt;System.Threading.&lt;span style="color: #2b91af;"&gt;Thread&lt;/span&gt;.Sleep(400);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;MessageBox&lt;/span&gt;.Show(&lt;span style="color: #a31515;"&gt;"Completed"&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black;"&gt;I am going to call the same method many times with some delays so that we can identify the patterns on the monitor. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="color: black; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The monitor would show something like this now&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZB18PR4D7mKjyQzhHKAjx61P63bGJICsUyLOylM1eXAKUUBwara1K35iphB1GjV-hAJ70RDjRQfU-rjaqD-lcgcPxe45hbDJrZOoN33U5bAKU45oB4YPyRoPG6hXsa1NeIBD7oGcxxMzA/s1600/perf3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZB18PR4D7mKjyQzhHKAjx61P63bGJICsUyLOylM1eXAKUUBwara1K35iphB1GjV-hAJ70RDjRQfU-rjaqD-lcgcPxe45hbDJrZOoN33U5bAKU45oB4YPyRoPG6hXsa1NeIBD7oGcxxMzA/s320/perf3.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black;"&gt;This shows how many calls we got on each second. This also helps us to identify if we need to optimize the service or where we need to concentrate on performance related issues.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 13.5pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIoGT6V7lHySTaZB-vj8xCWGe3vp1yNOGasdwSXXMbAKzFZCeO6g0TnXzLnZHQXq_CLiapvDUbidyebKMwJGslDxh0I7sHgOVZ4uRSWcPQcmM8nu7em1nDHKxJjv-s2uEChUkv617vBQmX/s72-c/perf1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Intro on Claims Based Authentication</title><link>http://subbusspace.blogspot.com/2010/10/intro-on-claims-based-authentication.html</link><category>claims based auth</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Tue, 19 Oct 2010 03:36:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-8869306905079110780</guid><description>&lt;div class="MsoNormal"&gt;I had a great opportunity to present a future state of authentication that can be adopted on many enterprise applications. Will try to explain some of the authentication related concepts and how that can help on enterprise applications. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;If you have read/worked on Windows Identity Foundation or Single Sign on products like PING, you might have heard about claims based authentication. What does that mean? Why is it called claims based? How applications can get anything from this? These are some of common questions that I would try to explain here. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;First of all let’s clear on what are some of the key concepts or words that you come across:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Identity&lt;/b&gt; - Set of attributes that describe a principal (e.g. an user) such as name,gender, age, email address, driving license number, group membership&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnOS12vgFQ1T63Ex1lo6Tayd04eg73mhyphenhyphenK1GqKyMGnTSs3LYVHXEXSqZdh4XN7TIvbF48bPCJTcDNYrbrSKTFWSQYJ9xSLZuybjUGrrFO8gOi9cqAGmXsjfAPdD642ZTqbhyphenhyphenILHP-ZJ06/s1600/identity.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnOS12vgFQ1T63Ex1lo6Tayd04eg73mhyphenhyphenK1GqKyMGnTSs3LYVHXEXSqZdh4XN7TIvbF48bPCJTcDNYrbrSKTFWSQYJ9xSLZuybjUGrrFO8gOi9cqAGmXsjfAPdD642ZTqbhyphenhyphenILHP-ZJ06/s320/identity.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;If you look at above image, it shows different attributes describes a user/person. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Identity Provider&lt;/b&gt; – If you look at real life example and above image, who could be the Identity provider? It will be either any of Government office or any trusted agencies. E.g Passport office &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Claims&lt;/b&gt; - An attribute about an identity issued by an authority.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Will explain in detail why it is called claim. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Relying party&lt;/b&gt; - Application that makes authorization decisions based on claims&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;Token&lt;/b&gt; - A token consists of a set of claims about the principal, and signed by an authority&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;So why are we calling attributes as claims not as attributes itself? Let’s look at a scenario below.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLmMFL0k_b5o7NWHSjBTeHyGI1cwI4d0lkqmJ7V_vhfe_MqdZnGkA1a1sSk5lP9K7zscc8BYPLeWdGdOLmRnL16Xyg5UpqAyl0EdhJF6y-UENRRJs8eVCoKC_5vlTF2f1DHet7YFF84N6u/s1600/claims.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLmMFL0k_b5o7NWHSjBTeHyGI1cwI4d0lkqmJ7V_vhfe_MqdZnGkA1a1sSk5lP9K7zscc8BYPLeWdGdOLmRnL16Xyg5UpqAyl0EdhJF6y-UENRRJs8eVCoKC_5vlTF2f1DHet7YFF84N6u/s320/claims.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;If you look at above image, I can have identities on multiple identity providers. And the attributes could be completely different between them. As you can see on the image, age on govt records is 32 while on facebook is 18. As a relying party, if I have to decide based on these attributes, it’s just the &lt;b&gt;Trust &lt;/b&gt;depends on scenario not on technical capability&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;So when I say, user has associated attributes from the identity provider, he is claiming that those are the attributes associated to him and valid. Its upto relying party to decide whether to trust the claims or not. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;When the relying party requests the Identity provider to authenticate the user, it authenticates and provides all the user attributes as claims. The token will consist of all the claims that belong to the user. The Security Token Service would be responsible to authenticate the user and provide all the claims as a token.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="text-align: left;"&gt;Most of the authentication concepts on federated authentication, SAML, openID, Oauth are all based on claims. I will try to explain each of them in coming days and how they are different from each other.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPnOS12vgFQ1T63Ex1lo6Tayd04eg73mhyphenhyphenK1GqKyMGnTSs3LYVHXEXSqZdh4XN7TIvbF48bPCJTcDNYrbrSKTFWSQYJ9xSLZuybjUGrrFO8gOi9cqAGmXsjfAPdD642ZTqbhyphenhyphenILHP-ZJ06/s72-c/identity.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Are you storing “strong” passwords real strong?</title><link>http://subbusspace.blogspot.com/2010/09/are-you-storing-strong-passwords-real.html</link><category>Storing strong passwords</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Tue, 28 Sep 2010 05:42:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-5897909454771806438</guid><description>&lt;div class="MsoNormal"&gt;Confused with the above line? Well, have seen many applications which ask users to enter strong password which includes special character and numeric or combination etc. But while storing the password most of the time we convert the password text to hash which is known to be a secure way to store. This approach may be secure in last centuries not any more.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Check out &lt;a href="http://en.wikipedia.org/wiki/Rainbow_table"&gt;http://en.wikipedia.org/wiki/Rainbow_table&lt;/a&gt; the mapping function from hash strings to any possible combinations of keyboard characters (alphanumeric, punctuations, etc.) have rendered this password storage / validation method insecure&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;Check this post &lt;a href="http://www.codinghorror.com/blog/2007/09/rainbow-hash-cracking.html"&gt;http://www.codinghorror.com/blog/2007/09/rainbow-hash-cracking.html&lt;/a&gt; it says “&lt;span class="apple-style-span"&gt;&lt;span style="color: #333333; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"&gt;The multi-platform password cracker&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color: #333333; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="color: #333333; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"&gt;&lt;a href="http://ophcrack.sourceforge.net/"&gt;&lt;span style="color: #0066cc;"&gt;Ophcrack&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color: #333333; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="color: #333333; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"&gt;is incredibly fast. How fast?&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color: #333333; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-hansi-font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #333333; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;It can crack the password "Fgpyyih804423" in 160 seconds&lt;/span&gt;”&lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;How do we strengthen storing password?&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;Simply provide a random salt while hashing password. Also iterate through many loops which requires extra computing burden to match the password. Normally keep the iteration count to 1000. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;Here is how we can achieve that in C# &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="mso-spacerun: yes;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 9.5pt;"&gt;using&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; (&lt;span style="color: #2b91af;"&gt;Rfc2898DeriveBytes&lt;/span&gt; derivedBytes = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Rfc2898DeriveBytes&lt;/span&gt;(input, salt, hashIterations))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] hash = derivedBytes.GetBytes(desiredHashBitSize / 8);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&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;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; hash;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Check &lt;a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes.aspx&lt;/a&gt; for details on &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;Rfc2898DeriveBytes&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Bitwise computation with C#</title><link>http://subbusspace.blogspot.com/2010/09/bitwise-computation-with-c.html</link><category>Bitwise computing C#</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Fri, 24 Sep 2010 01:54:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-2919757450364026192</guid><description>&lt;div class="MsoNormal"&gt;If you have written programs in C or C++ , I'm sure you might have used bitwise operators very often. We can use the same thing even in C#. I'm not going to explain the bitwise operators but would take an example of “&amp;amp;” operator and see how it can be used in our programs effectively. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;For details on &amp;amp; operator you can check &lt;a href="http://msdn.microsoft.com/en-us/library/sbf85k1c.aspx"&gt;http://msdn.microsoft.com/en-us/library/sbf85k1c.aspx&lt;/a&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;Let us take an example of logging class where we would need to log based on the configuration. The easiest method to keep the configuration is to specify the highest level of logging required. i.e if we are planning to log exceptions, warnings, Info, Detailed messages then if we specify Detailed messages on the config that indicates all the categories below this level should be considered for logging. If we decide not to log detailed messages and we are okay with info level, then it should log except Detailed messages. How do we do this? We can approach different solutions but easiest one in terms of program maintenance and configuration is to keep the highest level of logging required on configuration and write the program accordingly. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;Let us see how we can do this with our C# code.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; System.Linq;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; System.Text;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;namespace&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Diagnostics&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;enum&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; { None = 0,Exception = 1,Error = 3,Warning = 7,Info = 15 }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Log()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel = 7; &lt;/span&gt;&lt;span style="color: green;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// read from configuration&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; LogLevel { &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Info(&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Info) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Info)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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;/span&gt;&lt;/span&gt;&lt;span lang="IT" style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Info, message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span lang="IT" style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Info(&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;params&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;[] parameters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Info) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Info)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Info, message, parameters);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Warning(&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Warning) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Warning)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Warning, message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Warning(&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;params&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;[] parameters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Warning) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Warning)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Warning, message, parameters);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Error(&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Error) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Error)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Error, message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Error(&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;params&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;[] parameters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Error) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Error)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Error, message, parameters);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Exception(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Exception&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; err)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Exception) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Exception)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; errMessage = err.Message;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Exception, errMessage, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Exception(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Exception&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; err, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;params&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;[] parameters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ((&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Log&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.LogLevel &amp;amp; &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Exception) == &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Exception)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; errMessage = err.Message;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&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; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.Exception, errMessage, parameters);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; Write(&lt;/span&gt;&lt;span style="color: #2b91af;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;LogCategory&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; ctgy, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; message, &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;params&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;[] parameters)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// write to text or DB &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;If you look at above class, the log category is defined as 0, 1, 3, 7, 15 … this is actually the bit representation to identify if we need to consider category level. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;The bit representation of these numbers as below&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;0 – 0000 0000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;1 – 0000 0001&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;3 – 0000 0011&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;7 – 0000 0111&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;15 – 0000 1111&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;So if we need to add another level it would be 31 which will represent as &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;31 – 0001 1111&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;Hope this will explain why we have these numbers on the enum. Now, let’s look at other methods which are written for logging the messages. All the methods use “&amp;amp;” to check if the message needs to be logged. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;If the configuration specifies that we need to log only till warning, and when we try to log info this is what happens&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;Config = 7&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;Log&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;.LogLevel &amp;amp; &lt;span style="color: #2b91af;"&gt;LogCategory&lt;/span&gt;.Info&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;0000 0111 - 7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;0000 1111 - 15&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 13px; line-height: 14px;"&gt;0000 0111&lt;/span&gt;&amp;nbsp;– result – that means the Info is not configured here&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;What happens for Exception when the Log level is set as Warning&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;Log&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;.LogLevel &amp;amp; &lt;span style="color: #2b91af;"&gt;LogCategory&lt;/span&gt;.Exception) == &lt;span style="color: #2b91af;"&gt;LogCategory&lt;/span&gt;.Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;0000 0111 - 7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;0000 0001 – 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt; line-height: 115%;"&gt;0000 0001 – result – the exception is matching and its allowed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;br /&gt;
&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;I had never used this before and very much interested when I was discussing with one of our developer. Really want to thank him for showing me this amazing piece.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Problem opening CHM file?</title><link>http://subbusspace.blogspot.com/2010/09/problem-opening-chm-file.html</link><author>noreply@blogger.com (Subramanya P)</author><pubDate>Thu, 9 Sep 2010 07:27:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-1607028612741333318</guid><description>I had this problem many times whenever I download chm file from internet. Most of the time when I download the file and open it, it says "Navigation to the webpage was canceled" and for a moment I get annoyed thinking how to fix it. The fix is to go to property of the file and unblock the file.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE66b7pZVt1vLQElLY9O6tHde6ewRQs0juo0RFtrbKRrb2BoHtdXFA-B_pa_6Nj8wI__hpaJef_Ktt-bziXadrFB1rgMMtkWKZsTlRPwVR0KCmM_etJzJauGD0ehy7JZMuRRbaz5inrqJA/s1600/unblock.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE66b7pZVt1vLQElLY9O6tHde6ewRQs0juo0RFtrbKRrb2BoHtdXFA-B_pa_6Nj8wI__hpaJef_Ktt-bziXadrFB1rgMMtkWKZsTlRPwVR0KCmM_etJzJauGD0ehy7JZMuRRbaz5inrqJA/s320/unblock.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE66b7pZVt1vLQElLY9O6tHde6ewRQs0juo0RFtrbKRrb2BoHtdXFA-B_pa_6Nj8wI__hpaJef_Ktt-bziXadrFB1rgMMtkWKZsTlRPwVR0KCmM_etJzJauGD0ehy7JZMuRRbaz5inrqJA/s72-c/unblock.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Limit Sql data access from Applications using "EXECUTE AS"</title><link>http://subbusspace.blogspot.com/2010/08/limit-sql-data-access-from-applications.html</link><author>noreply@blogger.com (Subramanya P)</author><pubDate>Mon, 30 Aug 2010 12:58:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-7896996008695869500</guid><description>&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;When you have to retrieve SQl data from the applications, you would create login and connect using that to the sql server. Any user, who has the permissions to execute the stored procedure, runs the stored procedure under the Database's dbo user (which means it can do anything in the database, but nothing at the server-level nor on other databases). If you only allow your Logins to execute stored procedures (and not touch the tables directly), then you've effectively limited the Logins to code you've written. If you don't write any DELETE statements, then Logins can't delete anything.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;With Sql 2005 and above, there is a new feature EXECUTE AS OWNER which is a great way to limit the permissions of a sql server login. Lets look at how this can be used effectively to limit the access. &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;This feature allows you to impersonate another user in order to validate the necessary permissions that are required to execute the code without having to grant all of the necessary rights to all the underlying objects and commands.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The EXECUTE AS clause can be added to stored procedures, functions, DML triggers, DDL triggers, queues as well as a standalone clause to change the user’s context.&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Syntax:&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;"&gt; &lt;span style="color: blue;"&gt;PROCEDURE&lt;/span&gt;&lt;span style="color: grey;"&gt;.&lt;/span&gt;[proc_GetAliasByID]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-no-proof: yes;"&gt;&lt;span style="mso-tab-count: 1;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;@ID &lt;span style="color: blue;"&gt;bigint&lt;/span&gt; &lt;span style="color: grey;"&gt;=&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"&gt;WITH&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"&gt; &lt;span style="color: blue;"&gt;EXECUTE&lt;/span&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt; &lt;span style="color: red;"&gt;'AppDMLUser'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;More details:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://technet.microsoft.com/en-us/library/ms188354.aspx"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;http://technet.microsoft.com/en-us/library/ms188354.aspx&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>SQL Change Tracking Vs CDC</title><link>http://subbusspace.blogspot.com/2010/08/sql-change-tracking-vs-cdc.html</link><category>Sql auditing</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Thu, 26 Aug 2010 13:48:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-743240326996006407</guid><description>I had posted about SQL change tracking couple of weeks ago. There is one more option available on SQL for capturing the data and can be used for auditing. That is called as CDC – Change Data Capture&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the comparison on these two features&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Change Tracking (CT)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Change Tracking is a synchronous mechanism which modifies change tracking tables as part of ongoing transactions to indicate when a row has been changed. It does not record past or intermediate versions of the data itself, only that a change has occurred&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Change Data Capture (CDC)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Change Data Capture is asynchronous and uses the transaction log in a manner similar to replication. Past values of data are maintained and are made available in change tables by a capture process, managed by the SQL Agent, which regularly scans the T-Log. As with replication, this can prevent re-use of parts of the log. This Tracks when data has changed and includes the values as well. Entire table or subset of columns can be captured.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Universal Data Link (UDL) files</title><link>http://subbusspace.blogspot.com/2010/08/universal-data-link-udl-files.html</link><category>udl files</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Tue, 17 Aug 2010 09:37:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-4293345718395015071</guid><description>If you have worked with VB or ADODB objects, I am sure you will have used this earlier. Even though we have many ways to keep the connection strings in configuration I still use UDL many times even now. &amp;nbsp;Keeping connectionstring on configuration is a common requirement but to get that string we can use UDL that &amp;nbsp;keeps it simple to get the connectionstring right away from the notepad without worrying about format etc.&lt;br /&gt;
&lt;br /&gt;
Here is how I normally do to get the connection string or to test the connection.&lt;br /&gt;
· &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Open a note pad&lt;br /&gt;
· &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Save it as “x.udl”&lt;br /&gt;
· &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Close the notepad&lt;br /&gt;
· &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Now open the UDL file&lt;br /&gt;
· &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Configure your connection and save it&lt;br /&gt;
· &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Open the UDL file in note pad again. Now you get the connectionstring&lt;br /&gt;
&lt;br /&gt;
Simple way to check the connection to servers and helps to debug the connection issues</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>TFS 2010 for agile scrum development</title><link>http://subbusspace.blogspot.com/2010/08/tfs-2010-for-agile-scrum-development.html</link><author>noreply@blogger.com (Subramanya P)</author><pubDate>Sun, 15 Aug 2010 22:27:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-90625633853478219</guid><description>We have started using TFS 2010 for our scrum :-) . I found&amp;nbsp;TFS 2010 has lot of features to work with scrum agile methodology. It has capabilities to create user stories, product backlogs, and sprints etc. This can also be used for daily scrum updates. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The TFS team portal provides access to users to update the tasks and many reporting capabilities. &lt;br /&gt;
&lt;br /&gt;
Here is one of the nice ppt I found Scrum with TFS 2010 which has detailed explanation how we can make use of TFS for scrum methodology. &lt;a href="http://www.slideshare.net/aaronbjork/scrum-with-tfs-2010"&gt;http://www.slideshare.net/aaronbjork/scrum-with-tfs-2010&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Happy reading!!&amp;nbsp;:-)</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>SQL - Change tracking</title><link>http://subbusspace.blogspot.com/2010/07/sql-change-tracking.html</link><category>Sql change tracking</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Wed, 28 Jul 2010 23:25:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-2530664763808640081</guid><description>Most of the applications which I worked till now, had one or the other requirement to handle auditing feature to track the changes on data. There are different ways to achieve this. Very often we use triggers to update another table whenever there is a change on primary table. Or handle it on the stored proc which is used for inserting or updating data. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, with Sql 2008, this made very easy. The new feature introduced on SQL 2008 “Change tracking” which enables change tracking without any coding required. &lt;br /&gt;
&lt;br /&gt;
First, to enable this change tracking, we need to update the setting on DB&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiID1ktrST-QsxqQp1hMuYNRGv3jc5fhsyoXAorCG053OfKfYl4t6oBO9nIN4d32s_Z-V-GOZj11n6Ih1T_9dLa1EX8o38R2BEAAgrO4qE7qHn7bL6szdrveZ4zA8MbjkYhk94pVcKmBgFv/s1600/change+track+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiID1ktrST-QsxqQp1hMuYNRGv3jc5fhsyoXAorCG053OfKfYl4t6oBO9nIN4d32s_Z-V-GOZj11n6Ih1T_9dLa1EX8o38R2BEAAgrO4qE7qHn7bL6szdrveZ4zA8MbjkYhk94pVcKmBgFv/s320/change+track+1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;After that we need to enable this on the table whichever needs to be tracked. &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZA9X-eiqNIa37NuZwp24eY5LB9kdMYJmdEBmXFjWpedc3AMUDX5NxI_-K88qjxEW7PnfvFGdkD8pgXXkz3CjXD453paa4fIWlamGzwfA8RNrvYnDkV7tv3OSzqaQdPAnrjL-TPSeq0hWA/s1600/change+track+2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" bx="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZA9X-eiqNIa37NuZwp24eY5LB9kdMYJmdEBmXFjWpedc3AMUDX5NxI_-K88qjxEW7PnfvFGdkD8pgXXkz3CjXD453paa4fIWlamGzwfA8RNrvYnDkV7tv3OSzqaQdPAnrjL-TPSeq0hWA/s320/change+track+2.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Once the table is enabled with tracking, you will be able to track the changes by version. &lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
We can get all the changes by using function called CHANGETABLE. sample use of function will look like below. &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT * FROM CHANGETABLE &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;(CHANGES dbo.Employees,0) as CT&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This query will provide details with SYS_CHANGE_VERSION, SYS_CHANGE_OPERATION, SYS_CHANGE_COLUMNS, SYS_CHANGE_CONTEXT, ID columns. &lt;br /&gt;
&lt;br /&gt;
Take a look at this article &lt;a href="http://www.sql-server-performance.com/articles/audit/change_tracking_2008_p1.aspx"&gt;http://www.sql-server-performance.com/articles/audit/change_tracking_2008_p1.aspx&lt;/a&gt; &amp;nbsp;which talk about this article in detail.</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiID1ktrST-QsxqQp1hMuYNRGv3jc5fhsyoXAorCG053OfKfYl4t6oBO9nIN4d32s_Z-V-GOZj11n6Ih1T_9dLa1EX8o38R2BEAAgrO4qE7qHn7bL6szdrveZ4zA8MbjkYhk94pVcKmBgFv/s72-c/change+track+1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>TDE (Transparent Data Encryption) on Sql 2008</title><link>http://subbusspace.blogspot.com/2010/07/tde-transparent-data-encryption-on-sql.html</link><category>Sql Server security</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Thu, 22 Jul 2010 01:43:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-3240842677160643418</guid><description>Most of the Db design, we consider about security on data level. What are the critical data, if need to save them encrypted or hashed etc. There are somethings which might need more attention than just storing the data. What if the backup taken been stolen by someone? If someone gets mdf file, they can easily restore the data on to any server and get access to the data. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the new feuture introduced with Sql 2008 deals with this security. This is called transparent data encryption. This stores the mdf and ldf files encrypted. Data is encrypted while writing to disk and decrypted while read form the disk. The "transparent" aspect of TDE is that the encryption is performed by the database engine and SQL Server clients are completely unaware of it&lt;br /&gt;
&lt;br /&gt;
Here is more details on how we can use that on our DBs &lt;a href="http://msdn.microsoft.com/en-us/library/bb934049.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb934049.aspx&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>WCF Exceptions and faults</title><link>http://subbusspace.blogspot.com/2010/07/wcf-exceptions-and-faults.html</link><category>WCF faults</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Mon, 19 Jul 2010 03:03:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-2380515561682201297</guid><description>The exception handling is an integral part of any application. It depends on the situations and the severity of the exception that defines what we want to do with the exception. When working on webservices, especially while interacting with third party application, I always thought its better idea to catch any exception in method and return that as string. But this doesn’t really work if we have to return some other datatype and also we need to insist client apps to check for Error string to get the error message. There are chances that client apps don’t care about the Error string that was returned by service. So the exception thrown on service will still be treated as valid process on the client apps. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When I started working with WCF, I could find different ways to handle the exceptions.&lt;br /&gt;
&lt;br /&gt;
• Catch the exception on service and return as string. (I have already explained what the part of using this way)&lt;br /&gt;
&lt;br /&gt;
• Throw the exception directly. But how does this effect on client apps&lt;br /&gt;
&lt;br /&gt;
• And convert the exceptions to Faults which client apps can understand.&lt;br /&gt;
&lt;br /&gt;
Let’s see if throwing exceptions on service really help us &lt;br /&gt;
&lt;br /&gt;
If there is any exception on wcf service, the client app will always receive a fault exception as “&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &amp;lt;serviceDebug&amp;gt; configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs&lt;/span&gt;.” This does not provide any information about the exception. If we enable the detail on server , it will expose implementation details to the client. &lt;br /&gt;
&lt;br /&gt;
As a summary exposing exceptions to client has many limitations, so it’s always a better idea to map the exceptions on the wcf service to faults and let the client apps to deal with it.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Method overloading in WCF service</title><link>http://subbusspace.blogspot.com/2010/07/method-overloading-in-wcf-service.html</link><category>Overloading WCF method</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Fri, 16 Jul 2010 03:42:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-2654316803811706680</guid><description>Consider a scenario where we need to expose&amp;nbsp;the service method GetAccount. The method can accept accountid in some cases or username or some other reference. One way to create this on wcf is to create different methods as GetAccountbyID, GetAccountByName etc. But creating overloading methods provides better way of handling it. &lt;br /&gt;
&lt;br /&gt;
When we were using webservice, the only way to specify the alias name in webmethod attribute but the client app has to refer the service with alias name. So this doesn’t really qualify as overloaded method on client side but it’s an overloading method on the server side. &lt;br /&gt;
&lt;br /&gt;
Sample overloaded method on webservice&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;[WebMethod(MessageName="GetAccountByID")]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;public string GetAccount(int accountID)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;//return account data&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;[WebMethod(MessageName="GetAccountByName")]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;public string GetAccount (string userName)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;//return account data&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now let’s see how we can do this with WCF service methods. Let’s consider the approach of webservice here. The WCF service would look like &lt;br /&gt;
&lt;br /&gt;
My service interface would look like below&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;[OperationContract(Name = "GetAccountByID")]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;string GetAccount(int value);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;[OperationContract(Name = "GetAccountByName")]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;string GetAccount(string userName);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and the service class will follow as &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;public string GetAccount(int value)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;return string.Format("You entered: {0}", value);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;public string GetAccount(string username)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;return string.Format("You entered: {0}", username);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets refer this service on client side and see how we can consume it&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbx9OLtd-r7adieO8ONuDqfBvEvGyBhVBx8NxxnLe3d7J6If91hSg-9hlrOLyFKqL4hHfED5PzguJtBi4ipZPVA5k-daZB1EUht3ceDgx595or_qydGh4dA0Pqpvi49u7WokrZoD9feX5R/s1600/wcf1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" hw="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbx9OLtd-r7adieO8ONuDqfBvEvGyBhVBx8NxxnLe3d7J6If91hSg-9hlrOLyFKqL4hHfED5PzguJtBi4ipZPVA5k-daZB1EUht3ceDgx595or_qydGh4dA0Pqpvi49u7WokrZoD9feX5R/s320/wcf1.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;As you can see, it is split as different methods on client side. So one thing clear here is that&amp;nbsp;the method which is referred on the client side is referring to the name attribute defined on operationcontract.</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbx9OLtd-r7adieO8ONuDqfBvEvGyBhVBx8NxxnLe3d7J6If91hSg-9hlrOLyFKqL4hHfED5PzguJtBi4ipZPVA5k-daZB1EUht3ceDgx595or_qydGh4dA0Pqpvi49u7WokrZoD9feX5R/s72-c/wcf1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>GDI memory leak in Windows applications</title><link>http://subbusspace.blogspot.com/2010/07/gdi-memory-leak-in-windows-applications.html</link><category>GDI Memory leak</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Wed, 14 Jul 2010 23:37:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-7840068307170044261</guid><description>I have had many bitter experiences with memrory leaks on winwos applications. Had spent many day and nights figuring out the actual issues. This can occur due to many reasons. Most of the time came to conclusion that it was either Bitmap objcts or any COM objects. &lt;br /&gt;
&lt;br /&gt;
Found a very interesting article which explains one of the approaches to handle this error &lt;a href="http://megakemp.wordpress.com/2009/02/25/gdi-memory-leak-in-windows-forms/"&gt;http://megakemp.wordpress.com/2009/02/25/gdi-memory-leak-in-windows-forms/&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Uniqueidentifier (GUID) on SQL</title><link>http://subbusspace.blogspot.com/2010/07/uniqueidentifier-guid-on-sql.html</link><category>Uniqueidentifier on SQL</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Fri, 2 Jul 2010 07:41:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-8581097446472726070</guid><description>Uniqueidentifiers are alternate way to have them as primary keys. Till recent past, I always used to recommend Identity column&amp;nbsp;on our SQL designs . So I was curious to find out what are the advantages and limitations of using uniqueidentifiers than using identity. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only advantage I could find by using uniqueidentifier is that the number which is generated is unique throughout the world. Another advantage is that you don’t have rely on SQL to create this uniqueidentifier, we could even generate using out C# code and insert to sql tables. The value which is generated by C# and SQL will be unique anyways. &lt;br /&gt;
&lt;br /&gt;
Is uniqueidentifier suitable for primary key?&lt;br /&gt;
&lt;br /&gt;
The uniqueidentifier can be used as primary key but we need to consider some of the conditions.&lt;br /&gt;
&lt;br /&gt;
• The primary key will have clustered index by default which doesn’t work very well for uniqueidentifier. The uniqueueidentfier doesn’t create the ids in sequential order unless we use newsequentialid() (which is available from sql 2005 onwards). When we create clustered index, the records will be physically sorted. This means that, if you put a clustered index on a column that does not sequentially grow, SQL Server will have some work making sure that the records are correctly ordered physically when you insert new records.&lt;br /&gt;
&lt;br /&gt;
• Some of the applications expect the identifier of last inserted record. E.g if we are using identity column, we can get the last inserted value using scope_identity or @@identity. We will not be able to get the uniqueidentifier value unless using a query to get the latest record.&lt;br /&gt;
&lt;br /&gt;
Above considerations are also kinds of limitations for some of the DB designs. Another important note here is that the uniqueueidentifier column stores 16 byte so it bigger than int. &lt;br /&gt;
&lt;br /&gt;
But if you consider replicating the database and having identity column in your tables, it would create lot of issues. So I would say uniqueidentifier really helpful on the DB’s which requires replications.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Hierarchyid data type on Sql 2008</title><link>http://subbusspace.blogspot.com/2010/06/hierarchyid-data-type-on-sql-2008.html</link><category>Hierarchyid on Sql 2008</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Thu, 17 Jun 2010 01:55:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-341495797926840221</guid><description>The new data type introduced on SQL 2008 Hierarchy ID is very useful when working with tree based structures. Check out this link &lt;a href="http://blogs.msdn.com/b/manisblog/archive/2007/08/17/sql-server-2008-hierarchyid.aspx"&gt;http://blogs.msdn.com/b/manisblog/archive/2007/08/17/sql-server-2008-hierarchyid.aspx&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>OpenID integration to website</title><link>http://subbusspace.blogspot.com/2010/06/openid-integration-to-website.html</link><category>OpenID Integration</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Mon, 14 Jun 2010 23:44:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-1743366837648722494</guid><description>I started using my openid for different websites a while ago. Recently, I was curious to check how that can be integrated with any of the websites.&amp;nbsp;In this post I will just put some of the points which would give a basic understanding of what is openID is all about. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
As a common internet user, many times we walk away form the website just because we have to register. Registering in all the sites and remembreing login info is major tasks especially who already have many accounts. Another problem is that we many not be able to use unique username and password in all the websites and it may not be a good idea as well. When we share our password with some website how do we trust the party that our password is secure and noone can misuse it? these are all the problems can be avoided when we use openId. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;What is OpenID?&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
OpenID is an open, decentralized standard for authenticating users &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Allows users to log on to different services with the same digital identity where these services trust the authentication body. &lt;br /&gt;
&lt;br /&gt;
OpenID replaces the common log on process that uses a login-name and a password, by allowing a user to log in once and gain access to the resources of multiple software systems. &lt;br /&gt;
&lt;br /&gt;
You may choose to associate information with your OpenID that can be shared with the websites you visit, such as a name or email address. &lt;br /&gt;
&lt;br /&gt;
With OpenID, your password is only given to your identity provider, and that provider then confirms your identity to the websites you visit. &lt;br /&gt;
&lt;br /&gt;
Other than your provider, no website ever sees your password, so you don’t need to worry about an unscrupulous or insecure website compromising your identity. &lt;br /&gt;
&lt;br /&gt;
OpenID is rapidly gaining adoption on the web, with over one billion OpenID enabled user accounts and over 50,000 websites accepting OpenID for logins. Several large organizations either issue or accept OpenIDs, including Google, Yahoo!, Microsoft, AOL and many more&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6G8ZcklX-esh2j1eLo9VSRdQdNBqoOEk0sgnkQ74DvC7Uo6S8KyAWZJj9X6AKVUE3hjgHLUUONHU2YNwgyugAj7vTOiOTOLURvIeLmeW5Y-5lO8FsiDWj8Rs1hqG99dKpTXEF9YzCiTDF/s1600/openid.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qu="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6G8ZcklX-esh2j1eLo9VSRdQdNBqoOEk0sgnkQ74DvC7Uo6S8KyAWZJj9X6AKVUE3hjgHLUUONHU2YNwgyugAj7vTOiOTOLURvIeLmeW5Y-5lO8FsiDWj8Rs1hqG99dKpTXEF9YzCiTDF/s320/openid.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;OpenID protocol overview:&lt;/strong&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
The end user initiates authentication (Initiation) by presenting a User-Supplied Identifier to the Relying Party via their User-Agent. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After normalizing (Normalization) the User-Supplied Identifier, the Relying Party performs discovery (Discovery) on it and establishes the OP Endpoint URL that the end user uses for authentication&lt;br /&gt;
&lt;br /&gt;
The Relying Party and the OP establish an association (Establishing Associations) -- a shared secret established using Diffie-Hellman Key .The OP uses an association to sign subsequent messages and the Relying Party to verify those messages; this removes the need for subsequent direct requests to verify the signature after each authentication request/response. &lt;br /&gt;
&lt;br /&gt;
The Relying Party redirects the end user's User-Agent to the OP with an OpenID Authentication request (Requesting Authentication). &lt;br /&gt;
&lt;br /&gt;
The OP establishes whether the end user is authorized to perform OpenID Authentication and wishes to do so. &lt;br /&gt;
&lt;br /&gt;
The OP redirects the end user's User-Agent back to the Relying Party with either an assertion that authentication is approved (Positive Assertions) or a message that authentication failed (Negative Assertions). &lt;br /&gt;
&lt;br /&gt;
The Relying Party verifies (Verifying Assertions) the information received from the OP including checking the Return URL, verifying the discovered information, checking the nonce, and verifying the signature by using either the shared key established during the association or by sending a direct request to the OP&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Advantages:&lt;/strong&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
Users can use single identity among different trusted sites &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Provides a single sign on, in particularly for people who are having many accounts&lt;br /&gt;
&lt;br /&gt;
The openId server provides basic info about the user, saving the need to write down the usual basic info every time (depends on user’s settings with their providers)&lt;br /&gt;
&lt;br /&gt;
Moves trust of honesty from multiple parties to only one&lt;br /&gt;
&lt;br /&gt;
Minimize in re-registration and forgot password situations&lt;br /&gt;
&lt;br /&gt;
For the user who keep the same password among all the sites, they don’t need to share password with many people. They can choose their trusted provider and use their identity.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;strong&gt;Disadvantages:&lt;/strong&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
We still have to provide normal registration for those who are not willing to go with openID &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the people register in our site is more than the size of people who use openID, this idea would just go away &lt;br /&gt;
&lt;br /&gt;
The OpenID provider can track user’s habits as they receive all auth requests. &lt;br /&gt;
&lt;br /&gt;
I have created a sample application to try this and it works fine even when I run an application with localhost. I have tried with Google, Yahoo and myopenid accounts. Will post my sample application and also compare openID with SAML in coming posts. &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6G8ZcklX-esh2j1eLo9VSRdQdNBqoOEk0sgnkQ74DvC7Uo6S8KyAWZJj9X6AKVUE3hjgHLUUONHU2YNwgyugAj7vTOiOTOLURvIeLmeW5Y-5lO8FsiDWj8Rs1hqG99dKpTXEF9YzCiTDF/s72-c/openid.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>System.Web.AspNetHostingPermission on IIS7 Win 7</title><link>http://subbusspace.blogspot.com/2010/06/systemwebaspnethostingpermission-on.html</link><author>noreply@blogger.com (Subramanya P)</author><pubDate>Wed, 9 Jun 2010 05:13:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-1962766789951189344</guid><description>I had downloaded one of the open source and trying out something. When I started application, it was throwing a security error. &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I checked folder permission and allowed fulltrust permission etc. Even then I was keep getting the same error. After a while found that IIS application pool “Load User Profile” was set to false. After setting that value to true, the problem got fixed. &lt;br /&gt;
&lt;br /&gt;
Details on "load user profile" can be found at &lt;a href="http://msdn.microsoft.com/en-us/library/bb762281(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb762281(VS.85).aspx&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Modify your XML document using SQL</title><link>http://subbusspace.blogspot.com/2010/06/modify-your-xml-document-using-sql.html</link><category>sql and xml</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Wed, 2 Jun 2010 05:23:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-4944678230523961611</guid><description>Many of the situations, we will have to modify the xml that is passed on to the sql server. &lt;br /&gt;
&lt;div&gt;Some of the common operations you might need to handle in SQL are&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;adding an element&lt;/li&gt;
&lt;li&gt;adding an attribute&lt;/li&gt;
&lt;li&gt;updating an attribute&lt;/li&gt;
&lt;li&gt;delete an element&lt;/li&gt;
&lt;li&gt;delete an attribute&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt;&amp;nbsp;Let us try this with a sample document. &lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Declare @myXML xml&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT @myXML = '&amp;lt;CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Raja" LName="Rao" City="Bangalore" State="KA" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;/CUSTOMERSDATA&amp;gt;'&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Add an Element &lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @myXML.modify('insert &amp;lt;CUSTOMER FName="Ravi" LName="Krishna" City="Chicago" State="IL" /&amp;gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;into (/CUSTOMERSDATA)[1]') ;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;select @myXML&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Raja" LName="Rao" City="Bangalore" State="KA" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Ravi" LName="Krishna" City="Chicago" State="IL" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;/CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Add an attribute&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @myXML.modify('insert attribute Phone {"333-333-3333" }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;into (/CUSTOMERSDATA/CUSTOMER[@FName="Ravi"])[1]') ;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;select @myXML&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Raja" LName="Rao" City="Bangalore" State="KA" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Ravi" Phone="333-333-3333" LName="Krishna" City="Chicago" State="IL" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;/CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Updating an attribue&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @myXML.modify('replace value of (/CUSTOMERSDATA/CUSTOMER[@FName="Ravi"]/@Phone)[1] with "444-444-4444"') ;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;select @myXML&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Output:&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Raja" LName="Rao" City="Bangalore" State="KA" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Ravi" Phone="444-444-4444" LName="Krishna" City="Chicago" State="IL" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;/CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Delete attribue&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @myXML.modify('delete (/CUSTOMERSDATA/CUSTOMER[@FName="Ravi"]/@Phone)[1]') ;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;select @myXML&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Output: &lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Raja" LName="Rao" City="Bangalore" State="KA" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Ravi" LName="Krishna" City="Chicago" State="IL" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;/CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Delete Element&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @myXML.modify('delete (/CUSTOMERSDATA/CUSTOMER[@FName="Ravi"])[1]') ;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;select @myXML&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMERSDATA&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;CUSTOMER FName="Raja" LName="Rao" City="Bangalore" State="KA" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;/CUSTOMERSDATA&amp;gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Insert into a table from dynamic sql</title><link>http://subbusspace.blogspot.com/2010/05/insert-into-table-from-dynamic-sql.html</link><category>dynamic sql</category><category>Sql Server</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Wed, 12 May 2010 03:44:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-4016111215555428150</guid><description>I have had many situations to put the dynamic sql data to a temp table but first thought was to pass the temp table as parameter or create temp table on dynamic sql itself. But none of these methods would work on SQL. When we create a temp table on dynamic sql, it will not be available outside of dynamic sql scope. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try this out&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;DECLARE @tablename VARCHAR(10)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @tablename = 'tk'&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;DECLARE @strQuery NVARCHAR(1000)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SET @strQuery = 'select name from sys.tables where name like ''' + @tablename + '%'''&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;DECLARE @tablenames TABLE (tblname VARCHAR(100))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;INSERT INTO @tablenames&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;EXEC &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sp_executesql @strQuery&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SELECT * FROM @tablenames&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Easy method to dump all your data from dynamic sql!</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is wrong with WCF HTTP Activation?</title><link>http://subbusspace.blogspot.com/2010/05/what-is-wrong-with-wcf-http-activation.html</link><category>WCF HTTP Activation</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Tue, 11 May 2010 07:41:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-5527875687088399157</guid><description>&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version 3.0.0.0, Culture=neutral….&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This error started occurring all of a sudden. I was using IIS 7 and .net 4.0. The page was working fine and it broke when I checked it next day. What is wrong with my asp.net pages? Well, it’s not problem with asp.net pages or IIS. It looks like a problem when you install WCF HTTP activation module after you install .net 4.0. I installed WCF HTTP activation module to try something else which caused this problem. Take a look at http://msdn.microsoft.com/en-us/library/aa751852.aspx &lt;br /&gt;
&lt;br /&gt;
Fix: &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Run aspnet_regiis.exe -i –enable&lt;/span&gt; on VS 2010 command prompt.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Forms authentication integrated with IIS7</title><link>http://subbusspace.blogspot.com/2010/05/forms-authentication-integrated-with.html</link><category>Forms authentication</category><category>IIS7 Integrated pipeline</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Fri, 7 May 2010 09:30:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-2766446320021256451</guid><description>If you have worked on ASP.net application, you would have definitely used forms authentication in your applications. The new IIS7 brings a new feature which integrates forms authentication with IIS. On IIS 6 you could see authentication options of anonymous, Basic, Digest and Windows. On IIS7 you could also find Forms authentication when you have ASP.Net components installed. Let us look at how to make use of this for our application. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Forms Authentication and Membership providers:&lt;br /&gt;
&lt;br /&gt;
In a brief, forms authentication and membership providers are integrated from the .net 2.0 version. When you set up your application to use membership provider, it take care of all membership related functionalities also the member validations. &lt;br /&gt;
&lt;br /&gt;
I will set up a sample app to use the forms authentication with IIS7 integrated pipeline and see how we can take advantage of this feature. &lt;br /&gt;
&lt;br /&gt;
Lets create a Web Project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create 3 pages: About.aspx, Login.aspx, Default.aspx&lt;br /&gt;
Set up the application to use sql Membership provider. The detailed explanation on how to set up sql membership provider is available on http://msdn.microsoft.com/en-us/library/ff649314.aspx &lt;br /&gt;
&lt;br /&gt;
On Our login page, lets add a login control&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;asp:LoginView ID="LoginView" runat="server"&amp;gt;&lt;br /&gt;
&amp;lt;AnonymousTemplate&amp;gt;&lt;br /&gt;
&amp;lt;asp:Login ID="Login" runat="server" DestinationPageURL="About.aspx" &lt;br /&gt;
onloggedin="Login_LoggedIn" /&amp;gt;&lt;br /&gt;
&amp;lt;/AnonymousTemplate&amp;gt;&lt;br /&gt;
&amp;lt;LoggedInTemplate&amp;gt;&lt;br /&gt;
&amp;lt;asp:LoginName ID="LoginName" runat="server" /&amp;gt;&lt;br /&gt;
&amp;lt;asp:LoginStatus ID="Logout" runat="server" /&amp;gt;&lt;br /&gt;
&amp;lt;asp:ChangePassword ID="ChangePwd" runat="server" /&amp;gt;&lt;br /&gt;
&amp;lt;/LoggedInTemplate&amp;gt;&lt;br /&gt;
&amp;lt;/asp:LoginView&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you login using login.aspx, the login control internally invoke sql membership provider ValidateUser method and set the authentication cookie. These are all done by ASP.NET and you don’t have to do anything from your code. If you need any custoim logic to be appended on login process, then you need to inherit MemberShip class and build your own custom Membership provider. For now let us just use the sql DB provider. &lt;br /&gt;
&lt;br /&gt;
OK. We are all set with the application side to use the forms authentication. With IIS 6, we had to use Anonymous access, so that any user can hit the page and ASP.Net would validate the cookie and authenticate the users. With IIS7 this part is moved over to IIS itself. Here is how we can do it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go to IIS manager&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIyGVQ8T3FN9RD3x5zB-t_-F_5wy2pO5_cB969JmorJw7enhL5j0qfu2nNx8h4w1Jp2R9hmavE9g6umqoW9B1E71yCS_0eb1T1pO7XsB4_CbpBSI3-E3QwWraKlPXhWx202pBsKDxDtxpd/s1600/formsauth+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIyGVQ8T3FN9RD3x5zB-t_-F_5wy2pO5_cB969JmorJw7enhL5j0qfu2nNx8h4w1Jp2R9hmavE9g6umqoW9B1E71yCS_0eb1T1pO7XsB4_CbpBSI3-E3QwWraKlPXhWx202pBsKDxDtxpd/s320/formsauth+1.jpg" tt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;Select Authentication &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_iN6xuVnqKkwvjhC7mNlVbBTDg_FOLJL7N9g28b3Lyn0x_4RZ_SidzaqSwIeoiicEpoIRpE8FiB9yxg1m93o9VIrXT7Jj95j8TxjjBcUuh73bUJmSr_24WA7RgeVyLP48V6SGofro6YcC/s1600/formsauth+2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_iN6xuVnqKkwvjhC7mNlVbBTDg_FOLJL7N9g28b3Lyn0x_4RZ_SidzaqSwIeoiicEpoIRpE8FiB9yxg1m93o9VIrXT7Jj95j8TxjjBcUuh73bUJmSr_24WA7RgeVyLP48V6SGofro6YcC/s320/formsauth+2.jpg" tt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Here keep forms authentication as enabled and disable rest of the authentication methods. Now if you try to browse any of your pages, you will get below error&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfPRoUNHk4w1wp7Sucx1DQ-SIxnlbUW9CD6v7XdleVdNrcT66P2HR_zf7vv2kyVHZwhN0g6HFP0AozRdGiLbdpsKU64LhX47KjfHoPOnOqEpyAn3EOCAHkRbNpCyZAE8Tmdo_jx71iqfly/s1600/formsauth+3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfPRoUNHk4w1wp7Sucx1DQ-SIxnlbUW9CD6v7XdleVdNrcT66P2HR_zf7vv2kyVHZwhN0g6HFP0AozRdGiLbdpsKU64LhX47KjfHoPOnOqEpyAn3EOCAHkRbNpCyZAE8Tmdo_jx71iqfly/s320/formsauth+3.jpg" tt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;So even if you have configured login.aspx as your login page, the IIS doesn’t allow you to go to login.aspx since IIS cannot find authentication token for any request and anonymous access is restricted. &lt;/div&gt;&lt;br /&gt;
Let us allow login.aspx for anonymous access. Go to content view, select login.aspx . Right click and Select Switch to feature view and allow anonymous access&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28jF39mDz5e4SCjlGofdyt2S6y4Bywi6TtfJSzBCkBX3827aCejHTj9LTVit-l10UehBs9zoEo7f5F5xaj-93OxLte2YQXX3dNqOYHiWe7noGn-1tvIc3407cRHp74za0RojkIdQOxERJ/s1600/formsauth+4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28jF39mDz5e4SCjlGofdyt2S6y4Bywi6TtfJSzBCkBX3827aCejHTj9LTVit-l10UehBs9zoEo7f5F5xaj-93OxLte2YQXX3dNqOYHiWe7noGn-1tvIc3407cRHp74za0RojkIdQOxERJ/s320/formsauth+4.jpg" tt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;
Now browse the site, you will be redirected to login.aspx if you have not logged in to the site. If you have logged in, the site will allow you to browse other pages. &lt;br /&gt;
&lt;br /&gt;
Another factor you need to remember to get this working is that you need to select integrated mode on application pool for the web site which is configured. &lt;br /&gt;
&lt;br /&gt;
There is couple of disadvantages when we plan to deploy it on different server and use the application on load balancer. The authentication ticket which is created by Asp.net and used by IIS to determine the authentication of user is actually encrypted using machine key. So if the request is sent to different server, the token will not be valid. The only way to get that working on different server is to keep the machinekey same.</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIyGVQ8T3FN9RD3x5zB-t_-F_5wy2pO5_cB969JmorJw7enhL5j0qfu2nNx8h4w1Jp2R9hmavE9g6umqoW9B1E71yCS_0eb1T1pO7XsB4_CbpBSI3-E3QwWraKlPXhWx202pBsKDxDtxpd/s72-c/formsauth+1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Comparison XPathDocument, XmlReader, XLINQ, XmlDocument</title><link>http://subbusspace.blogspot.com/2010/05/comparison-xpathdocument-xmlreader.html</link><category>Comparison XPathDocument XmlReader XLINQ XmlDocument</category><category>XML</category><author>noreply@blogger.com (Subramanya P)</author><pubDate>Thu, 6 May 2010 07:23:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-210951494042177551.post-7582300329803839757</guid><description>&lt;div class="separator" style="clear: both; text-align: left;"&gt;From the days of .net 1.0 many of us use XmlDocument for parsing and writing xml in our .Net code. If you ask anyone who started with .Net 3.0 or above, they might say Xlinq is the best method to work with XML. Well, when we conclude on the method that we are going to use in our applications, we also need to see how it will impact on our application or if there is any better method to use. &lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Let us consider an XMl which I need to just parse and get the data out of it. If I am using .Net 3.5 or 4.0, first thought that comes to mind is that use Xlinq. I did a small test just to check which method would be better to read the xml and parse through the value and the result was really surprising. &lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Here is my Test program&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;class Program&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;static void Main(string[] args)&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Stopwatch sw = new Stopwatch();&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;string xmlinput = "&amp;lt;Customer&amp;gt;&amp;lt;Item desc=\"item1 desc\" id=\"1\" /&amp;gt;&amp;lt;Item desc=\"item2 desc\" id=\"2\" /&amp;gt;&amp;lt;Item desc=\"item3 desc\" id=\"3\" /&amp;gt;&amp;lt;Item desc=\"item4 desc\" id=\"4\" /&amp;gt;&amp;lt;Item desc=\"item5 desc\" id=\"5\" /&amp;gt;&amp;lt;Item desc=\"item1 desc\" id=\"1\" /&amp;gt;&amp;lt;Item desc=\"item2 desc\" id=\"2\" /&amp;gt;&amp;lt;Item desc=\"item3 desc\" id=\"3\" /&amp;gt;&amp;lt;Item desc=\"item4 desc\" id=\"4\" /&amp;gt;&amp;lt;Item desc=\"item5 desc\" id=\"5\" /&amp;gt;&amp;lt;Item desc=\"item1 desc\" id=\"1\" /&amp;gt;&amp;lt;Item desc=\"item2 desc\" id=\"2\" /&amp;gt;&amp;lt;Item desc=\"item3 desc\" id=\"3\" /&amp;gt;&amp;lt;Item desc=\"item4 desc\" id=\"4\" /&amp;gt;&amp;lt;Item desc=\"item5 desc\" id=\"5\" /&amp;gt;&amp;lt;Item desc=\"item1 desc\" id=\"1\" /&amp;gt;&amp;lt;Item desc=\"item2 desc\" id=\"2\" /&amp;gt;&amp;lt;Item desc=\"item3 desc\" id=\"3\" /&amp;gt;&amp;lt;Item desc=\"item4 desc\" id=\"4\" /&amp;gt;&amp;lt;Item desc=\"item5 desc\" id=\"5\" /&amp;gt;&amp;lt;/Customer&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XmlReader objReader = System.Xml.XmlReader.Create(new System.IO.StringReader(xmlinput));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Start();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;for (int i = 0; i &amp;lt; 1000; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;Program.NavigateXPathNavigate(objReader);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Stop();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine("XPATH ----- " + sw.ElapsedTicks.ToString());&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine(" ");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Reset();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Start();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;for (int i = 0; i &amp;lt; 1000; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Program.NavigateXmlDocument(xmlinput);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Stop();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine("XMLDOC ------ " + sw.ElapsedTicks.ToString());&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine(" ");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Reset();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Start();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;for (int i = 0; i &amp;lt; 1000; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Program.NavigateXmlReader(xmlinput);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Stop();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine("XML Reader ------ " + sw.ElapsedTicks.ToString());&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine(" ");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Reset();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Start();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;for (int i = 0; i &amp;lt; 1000; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Program.NavigateXlinq(xmlinput);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;sw.Stop();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine("XLINQ ------ " + sw.ElapsedTicks.ToString());&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.WriteLine(" ");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Console.ReadKey();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;private static void NavigateXPathNavigate(XmlReader xmlinput)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XPathDocument xpathDoc = new XPathDocument(xmlinput);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XPathNavigator xpathNavig = xpathDoc.CreateNavigator();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XPathNodeIterator pgItereator = xpathNavig.Select("/Customer/Item");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;foreach (XPathNavigator n in pgItereator)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;string val = n.GetAttribute("id", "");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;private static void NavigateXmlReader(string xmlinput)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XmlReader objReader = System.Xml.XmlReader.Create(new System.IO.StringReader(xmlinput));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;while (objReader.Read())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;if (objReader.NodeType == XmlNodeType.Element)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;if (objReader.Name == "Item")&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;objReader.MoveToAttribute("id");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;string id = objReader.Value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;private static void NavigateXmlDocument(string xmlinput)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XmlDocument objdoc = new XmlDocument();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;objdoc.LoadXml(xmlinput);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XmlNodeList objlist = objdoc.SelectNodes("/Customer/Item");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;foreach (XmlNode n in objlist)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp; string val = n.Attributes["id"].Value.ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;private static void NavigateXlinq(string xmlinput)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;XElement obj = XElement.Parse(xmlinput);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;IEnumerable&lt;xelement&gt; oldItem = (from c in obj.Elements("Item")&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;select c);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;foreach (XElement ele in oldItem)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp; string val = ele.Attribute("id").Value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have kept the watcher for each method to get the time taken to process the method. Here is the output of my program&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWeORuitpOrzfhADtQaxWop-tKgok_FdDZaU0F_E4rB-gvhQjPSTzJV9T9t2UZvQRwwNjKJyABExNmwBolToSi4T7qv32y8IRsxdHHP2oBfyccbxuqbLC9NoWzOuLcfQ9qB5juF8SBS3gr/s1600/xml+1.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWeORuitpOrzfhADtQaxWop-tKgok_FdDZaU0F_E4rB-gvhQjPSTzJV9T9t2UZvQRwwNjKJyABExNmwBolToSi4T7qv32y8IRsxdHHP2oBfyccbxuqbLC9NoWzOuLcfQ9qB5juF8SBS3gr/s320/xml+1.jpg" wt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The XPathDocument was always much lower than any other methods. And the performance of the method always fall into below order&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
• XPATHDocument&lt;br /&gt;
• XMlReader&lt;br /&gt;
• XLinq&lt;br /&gt;
• XMLDocument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is purely based on my sample test and it may differ based on the situation. For any enterprise applications, where the number hits and concurrent users are huge, we need to definitely consider on these methods as you can see a drastic difference on the process time.</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWeORuitpOrzfhADtQaxWop-tKgok_FdDZaU0F_E4rB-gvhQjPSTzJV9T9t2UZvQRwwNjKJyABExNmwBolToSi4T7qv32y8IRsxdHHP2oBfyccbxuqbLC9NoWzOuLcfQ9qB5juF8SBS3gr/s72-c/xml+1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>