<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6710299478360418871</id><updated>2024-10-24T20:11:36.255-07:00</updated><title type='text'>Mathew&#39;s diary of Microsoft Technologies</title><subtitle type='html'>This Blog will list various code snippets on the things I have explored on Microsoft .Net Technologies like Asp.net with C#, Microsoft Office sharepoint Server 2007, WCF and hopefully lots more to come.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-3887623882049082090</id><published>2010-04-27T03:57:00.001-07:00</published><updated>2012-02-24T04:43:08.824-08:00</updated><title type='text'>Health care for Rural India – A presentation at IBM Developer Works</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Health care for rural India is a dream for the government of India. India is fast growing towards implementing the Unique Identification mechanism for all its citizens and a bright idea that came up in my mind was the use of IT especially cloud computing to bring expert medical advice to the doorsteps of rural people who are less fortunate to get medical advice and proper diagnosis. &lt;br /&gt;
&lt;br /&gt;
The advent of 3G mobile technology has brought up various opportunities and opened up doors to various innovations that could revolutionize health care and information sharing.&lt;br /&gt;
&lt;br /&gt;
Citizens will have a unique identification number and medical records can be linked to the unique id to effectively manage medical history. &lt;br /&gt;
&lt;br /&gt;
All villages and small towns could have a computer terminal connected to a cloud via the 3g services being offered by Wireless mobile service providers. 3g offers high speed internet connectivity and high density data transfer.&lt;br /&gt;
&lt;br /&gt;
Patient can come up to this medical kiosks and can use the web conferencing facility hosted on the cloud which links up to various medical colleges, hospitals and renowned clinics to interact with the patient and share x-ray , scanned medical test reports with the expert medical practitioners. &lt;br /&gt;
&lt;br /&gt;
This data relating to every patient can be stored on Databases, linked to individual patients via the Unique Id, available on the cloud. The data can then be used for analysis by medical colleges and the doctor’s bench for proper diagnosis and prescription.&lt;br /&gt;
&lt;br /&gt;
Citizens could donate their used desktops and laptops for such kiosks and can again promote the Green Initiative by making proper use of available resources. &lt;br /&gt;
&lt;br /&gt;
The benefits include a) low cost of implementation compared to implementing a whole system at each kiosk b) Centralized data for medical history management and information sharing. c) High quality medical advice without setting up a whole hospital and spending in-out to maintain it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPwwIRaJyq_ZWWOTvIr06Fd_BDR7xzpy_hW0wOB4DdTuTBTJRor8jYLPB1zIKIYz6M5agfbH46TxVMaf6VwaToqIoW3vzM51ffWE1OZitdYe7lCrZ90Gy9Us1Nc7HH6yf3AtuZUUP-crc/s1600/rural-healthcare.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;472&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPwwIRaJyq_ZWWOTvIr06Fd_BDR7xzpy_hW0wOB4DdTuTBTJRor8jYLPB1zIKIYz6M5agfbH46TxVMaf6VwaToqIoW3vzM51ffWE1OZitdYe7lCrZ90Gy9Us1Nc7HH6yf3AtuZUUP-crc/s640/rural-healthcare.PNG&quot; tt=&quot;true&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/3887623882049082090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/3887623882049082090' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/3887623882049082090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/3887623882049082090'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2010/04/health-care-for-rural-india.html' title='Health care for Rural India – A presentation at IBM Developer Works'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPwwIRaJyq_ZWWOTvIr06Fd_BDR7xzpy_hW0wOB4DdTuTBTJRor8jYLPB1zIKIYz6M5agfbH46TxVMaf6VwaToqIoW3vzM51ffWE1OZitdYe7lCrZ90Gy9Us1Nc7HH6yf3AtuZUUP-crc/s72-c/rural-healthcare.PNG" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-540877508648277329</id><published>2009-12-01T04:23:00.000-08:00</published><updated>2009-12-01T05:30:51.564-08:00</updated><title type='text'>Making .Net Applications UAC compliant (Vista,Server 2008, etc)</title><content type='html'>&lt;div&gt;UAC(User access control) is a feature which users started feeling the pain of :) in Vista and this legacy will continue in most of the microsoft products which will be released in subsequent future. Take for eg windows 2008, windows 7 etc. they all will feature those popups which prompt you when an application is started. Sometimes i think...&quot;Why does it ask me for some action i have taken in all good sense&quot;... well i havent got a good answer yet and just as i started working on making software UAC compatible.... I got a good chance to explore it. So here I am trying to share the experience and the knowledge in as small an article as much i can shorten.&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;Before embarking on making a software for the UAC feature rich vista or Os&#39;s to come, we have to know about what a Standard User is. A standard user is any system user who doesnt need to know about anything except use the box and leave it. Actually 90% of users of a system are supposed to be Standard users and a few must be eligible to be Admin powered users. So whats the difference between a standard user and an admin user. A standard user has limited rights... since he is not supposed to do a variety of things like,,,, accessing the registry, changing it... create files where you are not authorized, trying to delete files made by other users, trying to rename a file created by some other user, peeping around dark corners in your PC etc. More over the security features revolving around UAC also restrict applications to doing any write/create/delete/update IO operation in Program Files. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Rule 1.&lt;/span&gt; If your application writes to any file/folder within &quot;Program Files&quot;... its gonna fail. So change this to a location which is common for any kind of a user (especially our so dear Standard User). &lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Rule 2.&lt;/span&gt;&lt;/strong&gt; If your application needs to store user specific data then use &lt;strong&gt;%userprofile%&lt;/strong&gt; location. Programatic access can be found by using the &lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)&lt;/span&gt;&lt;/strong&gt; method in C#. This would give you the current user&#39;s application data path.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Rule 3.&lt;/span&gt;&lt;/strong&gt; Rule 1 and Rule 2 are as a result of the virtualization that takes place in Vista and server 2008. The writes to any directory in C:\program files is directed to a user specific store. Tring to save a txt file to c:\Program Files will prompt the user to save it to My documents folder for eg:&lt;br /&gt;
C:\Users\rmathew\Documents. &lt;br /&gt;
&lt;br /&gt;
To re-route the reads and writes which occur at the program files directory to a common path we should consider the &lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)&lt;/span&gt;&lt;/strong&gt; folder. This will Get the folder named &quot;ProgramData&quot; in Vista and 2k8. A common path on vista would look like&lt;span style=&quot;background-color: white;&quot;&gt; &lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;C:\ProgramData&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;. Developers wanting to share common data across all users on a sytem for a specific application, will have to store their data at this specific location. All reads and writes which occured at &lt;strong&gt;C:\Program Files &lt;/strong&gt;folder structure will have to be redirected to the CommonApplicationData folder. Read writes would include log files, config files, xml files generated on the fly etc. Developers will have to give FULL RIGHTS to &quot;&lt;strong&gt;EveryOne&lt;/strong&gt;&quot; user on this folder and all files must&amp;nbsp;inherit security attributes from the above folder.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Rule 4.&lt;/span&gt;&lt;/strong&gt; Add a Manifest file to your Application. The manifest file is used by the OS to read the specifics of the application requesting to start execution. The effective authorization and rights of the applications are specified in the manfiest file. Embed the same as resource. If the name of the executable is Abc.exe, the manifest will be Abc.exe.manifest. These manifest files are generated in visual Studio 2008 by default but in previous versions of visual studio this manifes file needs to be added as a post build event.&lt;br /&gt;
In Visual Studio 2005 a Post Build Event can be fired&amp;nbsp; to add the assembly manifest file &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&quot;C:\Program Files\Microsoft Visual Studio 8\VC\bin\mt.exe&quot; -manifest &quot;$(ProjectDir)$(TargetName).exe.manifest&quot; -outputresource:&quot;$(TargetDir)$(TargetName).exe;#1&quot;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Rule 5.&lt;/span&gt;&lt;/strong&gt; Give the ACL(Access control list) to specific folders where write operations have to be performed. &lt;br /&gt;
&lt;br /&gt;
if (!Directory.Exists(initialCachePath))&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Creating Directory&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DirectoryInfo dirinf= Directory.CreateDirectory(&amp;lt;&lt;em&gt;some directory you need to create&lt;/em&gt;&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; //Get the access control list on the created directory&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DirectorySecurity dSecurity = dirinf.GetAccessControl();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Adding accessing rights for &quot;Everyone&quot; on that folder with full control&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; dSecurity.AddAccessRule(new FileSystemAccessRule(&quot;Everyone&quot;, FileSystemRights.FullControl,&amp;nbsp;&amp;nbsp;InheritanceFlags.ContainerInherit &lt;br /&gt;
InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));&lt;br /&gt;
&lt;br /&gt;
//apply permissions to directory(s)&lt;br /&gt;
dirinf.SetAccessControl(dSecurity);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;Rule 6.&lt;/span&gt;&lt;/strong&gt; Test Test and retest. &lt;br /&gt;
&lt;div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/540877508648277329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/540877508648277329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/540877508648277329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/540877508648277329'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2009/12/making-net-applications-uac-compliant.html' title='Making .Net Applications UAC compliant (Vista,Server 2008, etc)'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-7502867618808202906</id><published>2009-10-01T03:31:00.000-07:00</published><updated>2009-10-13T02:58:19.979-07:00</updated><title type='text'>Common FAQs - App configs, NLog, UAC, Folder Enumeration etc</title><content type='html'>Although App configs bring flexibity and configurability to our applications, working with it can be quite confusing. I will clear atleast two most common questions that arise in our minds&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #993300;&quot;&gt;a) Can we load a windows application App.Config from a different Location ?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Answer: Yes. We do not necessarily need to have the app config in the same directory as the executable. We know that every windows app has atleast one app domain to run in, so we fool the app domain by setting one of its internal variables to locate to a web config from a different location.&lt;br /&gt;
&lt;br /&gt;
Use the following line of code to do so.&lt;br /&gt;
&lt;span style=&quot;color: #3366ff;&quot;&gt;AppDomain.CurrentDomain.SetData(&quot;APP_CONFIG_FILE&quot;, _path );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3366ff;&quot;&gt;Here _path = path to your distant location App.config.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #993300;&quot;&gt;b) How to Make my Windows App re-read my App config or Reload my App config without restarting the application?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Answer: Use the following piece of code, which sets a private variable reflectively and fools the configuration manager to reload the config file.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3366ff;&quot;&gt;RuntimeFieldHandle initStateFieldHandle = typeof(System.Configuration.ConfigurationManager).GetField(&quot;s_initState&quot;, (BindingFlags.NonPublic BindingFlags.Static BindingFlags.ExactBinding)).FieldHandle; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3366ff;&quot;&gt;&lt;br /&gt;
FieldInfo fi = FieldInfo.GetFieldFromHandle(initStateFieldHandle);&lt;br /&gt;
// retrieve reference to registered client variable&lt;br /&gt;
fi.SetValue(null, 0);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;c) Can we set the Log File Directory dynamically in NLog?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Answer: As we know NLog is a great component for Logging in .Net applications. It aliveates the users from the hassles of creating the infrastructure to enable logging in .net applications. I came across a similar issue while working on UAC stuff to create a Log File in a different directory based upon the Operating system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nlog has provided us with some functionality to inject the programatically generated Path/Log file location into the configuration specifed in config files. Take a look at the highlighted piece of code in the following configuration section. We could see a variable &lt;span style=&quot;color: orange;&quot;&gt;&lt;strong&gt;gdc:logdirectory. &lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;This pertains to a variable name logdirectory which has been set somewhere globally.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;xsi:type=&quot;File&quot; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;layout=&quot;${message}&quot; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;filename=&quot;${gdc:logdirectory}/Log/MyLogFileName.log&quot;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
archiveFileName=&quot;${gdc:logdir}/Log/MyLogFileName.{##}.log&quot; archiveAboveSize=&quot;1048576&quot; archiveNumbering=&quot;Rolling&quot; concurrentWrites=&quot;true&quot; maxArchiveFiles=&quot;20&quot; keepFileOpen=&quot;false&quot; encoding=&quot;iso-8859-2&quot; /&amp;gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
To Set the variable we must use the following piece of code at an appropriate location eg: Static constructor, class initializer.Etc. so that before the logging code is called, we have&amp;nbsp;the&amp;nbsp;value set.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3366ff;&quot;&gt;NLog.GDC.Set(&quot;logdirectory&quot;, ComputedLogDirectory);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
c) Can we merge two configs ??&lt;br /&gt;
Answer: Aha... that goes for a blog of itself.... watchout for my next blog.</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/7502867618808202906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/7502867618808202906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/7502867618808202906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/7502867618808202906'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2009/10/common-app-config-faqs.html' title='Common FAQs - App configs, NLog, UAC, Folder Enumeration etc'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-8295188131417712095</id><published>2009-07-29T01:30:00.000-07:00</published><updated>2009-12-01T05:33:56.912-08:00</updated><title type='text'>.Net Application Performance Profiling, Performance metrics, Performance Monitoring and Optimization Part 1</title><content type='html'>Profiling, Performance metrics.&lt;br /&gt;
&lt;br /&gt;
Application performance is a core element of any software&#39;s success. People spend all the time writing code and developing solutions but when it comes to performance, raising an eyebrow is the first expression that&#39;s is evident on every team members face.&lt;br /&gt;
&lt;br /&gt;
Performance tuning, performance optimization, performance review, profiling are the jargon which people are wary about. Its psychological that any developer would not like to be the person who&#39;s code did the most amount of work and contributed extensively towards making the application slow, but an honest introspection is something that gives a definitive edge.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wisdom in terms of software development comes by retrospection, code review and facts which establish that writing a certain piece of code has definitive measurable impact on performance.&lt;br /&gt;
&lt;br /&gt;
Let me stop this verbal jugglery and try to show you some facts and figures which i came across while performance tuning a critical application.&lt;br /&gt;
&lt;br /&gt;
I had the massive task of improving the start up time and performance of an application that had to be used in a critical situation. Errors, flaws, ignorance, exceptions, exclusions are strictly unacceptable. As a matter of fact they are Lethal to existence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSocV0qKofN6YkcdVjqGrzWrQEF-KM7sLxe2CqDLi4Lu3LPVVUXPj4M55IsgN0foZNbJVSLAgbsOOBucM4dhHzQASQJEFc0hG6P1LWnp0hOkfzYM0hezeX-6qHmsy12NJSvZZMxYmfkAg/s1600-h/CLR-Profiler_2.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5366403974681869970&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSocV0qKofN6YkcdVjqGrzWrQEF-KM7sLxe2CqDLi4Lu3LPVVUXPj4M55IsgN0foZNbJVSLAgbsOOBucM4dhHzQASQJEFc0hG6P1LWnp0hOkfzYM0hezeX-6qHmsy12NJSvZZMxYmfkAg/s200/CLR-Profiler_2.png&quot; style=&quot;cursor: hand; float: left; height: 121px; margin: 0px 10px 10px 0px; width: 200px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
I started with the CLR profiler and got some startling facts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its bang on. It will show u your code&#39;s mettle. how much memory is allocated and how does it contribute to the application memory allocation.&lt;br /&gt;
&lt;br /&gt;
a) Use RuntimeMethodHandle, RuntimeFieldHandle etc in place of MethodInfo. Method handles are lightweight, efficient and fast. Check out&lt;br /&gt;
&lt;br /&gt;
b) Try to use BeginInvoke instead of Invoke. The difference being that one is synchronous call and the other is an async call.&lt;br /&gt;
&lt;br /&gt;
c) Try to use Async calls. Eventing is a very good strategy. It may be a little confusing to follow in code but it establishes a decent async method call routine and is considered robust. Sequential flow must be broken down to such eventing mechanisms where after a step an event in raised and the second event would then commence. Beware of updating a User interface on a BeginInvoke method since in WPF only the main thread is the UI thread and any other thread updating the UI is considered a villain.&lt;br /&gt;
&lt;br /&gt;
d) String operations and concatenations are killers. Replace them with string builders.&lt;br /&gt;
&lt;br /&gt;
e) The foreach on a List is slower than the for loop with count. Try to use the FOR loop instead of the FOREACH loop for mission critical places where performance is needed. Etc startups etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
d) Locking and multi threaded scenarios. For multi threaded scenarios where there are chances for a raise condition or for a deadlock condition we use the LOCK construct in C#. It has to be noted that Lock will slow the application since when two threads simultaneously try to access a resource there would be one thread which succeeds and the other will wait until the first thread leaves the lock. This can be tested in load testing scenarios for eg, try to write to a Hashtable or array with 200 users load on a load test. There will be exceptions that occur.&lt;br /&gt;
&lt;br /&gt;
The solution. Don&#39;t use a lock for READING from a hashtable. Use the LOCK for Writing to a HashTable and release it as soon as possible.&lt;br /&gt;
&lt;br /&gt;
eg: &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;INCORRECT USAGE &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Hashtable hs = new Hashtable();&lt;br /&gt;
object lockObj = new object()&lt;br /&gt;
lock(lockObj)&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;font-size: 85%;&quot;&gt;//read the object from hashtable.&lt;/span&gt;&lt;br /&gt;
object readObject = hs[&quot;key&quot;];&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 85%;&quot;&gt;//Create new object and write to the hashtable.&lt;/span&gt;&lt;br /&gt;
hs.Add(&quot;writeKey&quot;,&quot;WriteVALUE&quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;CORRECT USAGE &lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 85%;&quot;&gt;//We wont use the lock for reading&lt;/span&gt;&lt;br /&gt;
object readObj = hs[&quot;key&quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 85%;&quot;&gt;//We will use the lock for writing.&lt;/span&gt;&lt;br /&gt;
lock(lockObj)&lt;br /&gt;
{&lt;br /&gt;
hs.Add(&quot;writeKey&quot;,&quot;WriteValue&quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
f) Remove un-necessary references from your project. Adding references which are not useful or not used anywhere will increase time in loading these assemblies on startup. Make sure that the reference are updated when u remove the &quot;using ----&quot; statement.&lt;br /&gt;
&lt;br /&gt;
g) Remember that loading an assembly in memory is not = JITTIng assembly. Assembly JITTING is a costly affair and takes CPU cycles. Loading an assembly would just load it in memory but JIT is performed when any method in the loaded assembly is called.&lt;br /&gt;
&lt;br /&gt;
h) Make sure that object creation is not costly and time consuming. What happens is that we clutter the constructor of a class with lots of code which have a catastrophic impact on the speed of an application. The application cannot create instance of the class or it may take time instantiating the class hence the application is now slow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i) For WPF applications, Try not to make extra overheads and wrappers around in-build controls. They can tremendously slow your application. So try to use the controls provided in .net framework as much as possible and try to avoid un-necessary wrappers around them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
j) App domains are an interesting topic of discussion and they are extremely useful for application development. If you are creating an application, which would host other applications, or other assemblies, then it does make a lot of sense to use loader optimization. AppDomain creation is a costly process, assemblies are loaded into the newly created app-domain and the loading takes place in spite of some of the common assemblies already being loaded into the default appdomain. So use LoaderOptimization Attribute.&lt;br /&gt;
&lt;br /&gt;
For WPF applications delete the file named App.XAML and App.Xaml.cs. Now use the following piece of code&lt;br /&gt;
&lt;br /&gt;
public partial class App: Application&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[STAThread]&lt;br /&gt;
[LoaderOptimization(LoaderOptimization.MultiDomainHost)]&lt;br /&gt;
static void Main()&lt;br /&gt;
{&lt;br /&gt;
App app = new App();&lt;br /&gt;
app.InitializeComponent();&lt;br /&gt;
app.Run();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
k) Use tools like CLR Profiler and .Net Performance analysis wizard to analyze memory allocation. I have tried to use JetBrains DotTrace and found it to be quite good. You could get a trial for 30 days and could buy it if u like it,&lt;br /&gt;
&lt;br /&gt;
l) Although these are some of the ways we could improve the performance of ,net applications it has to been seen that constant review, constant change, constant trials are the only way to improvise on it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I wish to blog in detail about other aspects of application performance improvement and will do so in the next sessions. If you like or dislike this article, i would like to listen to your feedback and thoughts.</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/8295188131417712095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/8295188131417712095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/8295188131417712095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/8295188131417712095'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2009/07/net-application-performance-profiling.html' title='.Net Application Performance Profiling, Performance metrics, Performance Monitoring and Optimization Part 1'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSocV0qKofN6YkcdVjqGrzWrQEF-KM7sLxe2CqDLi4Lu3LPVVUXPj4M55IsgN0foZNbJVSLAgbsOOBucM4dhHzQASQJEFc0hG6P1LWnp0hOkfzYM0hezeX-6qHmsy12NJSvZZMxYmfkAg/s72-c/CLR-Profiler_2.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-2707018557714853839</id><published>2008-08-21T06:49:00.000-07:00</published><updated>2008-08-22T03:10:50.552-07:00</updated><title type='text'>Some Basics of Regular Expressions (For beginners)</title><content type='html'>Regular expressions are extremely useful when dealing with lots of data and filtering out what you want exactly... Its like asking for a needle in the hay stack...&lt;br /&gt;The use of this is marred by the difficulty and the learning curve associated with learning Regular expressions....&lt;br /&gt;Developers of Perl are familiar with Regular expressions generally since they do deal with the symbols and expressions whereas a developer coming from a Microsoft technology background will find it hell to understand and develop similiarly.&lt;br /&gt;&lt;br /&gt;I will try to easy some pain for the beginners here by discussing about the basics of Regular Expressions since understanding the bits and pieces of the Regular expressions will make it easy in developing the same....&lt;br /&gt;&lt;br /&gt;1) Regular expressions start with the ^ or Carat symbol so for ex: ^abcd means find all the words that start with &#39;a&#39; and have &#39;abcd&#39; in it.... it means it will match  &#39;abcd-1234&#39; and &#39;abcd&#39; but will not match &#39;ab&#39; and &#39;1212abcd&#39; since the match specifies to find aa words/string starting with &#39;a&#39; and and is followed with &#39;bcd&#39; and anything else at the end of it.&lt;br /&gt;&lt;br /&gt;Always remember to put the Carat symbol while starting the regular expression to match else could result in serious flaws.&lt;br /&gt;&lt;br /&gt;The $ symbol i.e Dollar symbol is used to notify the end of the string to match. for eg ^abcd$ will only match for &#39;abcd&#39;. It will match only the words which start with &#39;a&#39; end with &#39;d&#39; and has &#39;bc&#39; in the same order as in the expression. So the words &#39;abcd-123&#39; will not match &#39;12abcd&#39; will not match too.&lt;br /&gt;&lt;br /&gt;Remember to put the $ symbol at the end to indicate the end letter/number for matching&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The * symbol matches the preceding character zero or more times. For example &quot;to*n&quot; matches &quot;ton&quot;, &quot;toon&quot; or &quot;tn&quot; the + symbol must match one or more times.&lt;br /&gt;&lt;br /&gt;To match a range of repeated characters we use the [] symbols, for eg &quot;spo[1-2]n&quot; will match spoon and spon but will not match spooon.&lt;br /&gt;? = making a character  optional.&lt;br /&gt;&lt;br /&gt;+ = {1,}&lt;br /&gt;? = {0,1}&lt;br /&gt;&lt;br /&gt;Remember in the format {a,b} there should be no space betwen the comma and the number.&lt;br /&gt;&lt;br /&gt;x|y matches either x or y&lt;br /&gt;so (m|s)ad matches mad or sad.&lt;br /&gt;&lt;br /&gt;\d will match any numeric digit&lt;br /&gt;\D will match any NON-digit character&lt;br /&gt;&lt;br /&gt;\b = word boundary&lt;br /&gt;eg man\b matches : heman but does not match manchester&lt;br /&gt;&lt;br /&gt;\B = non-word boundary&lt;br /&gt;&lt;br /&gt;\s matches any white space character including space tab and form-feed.&lt;br /&gt;\w matches any word character including underscore. [A-Za-z0-9_]&lt;br /&gt;\W [^A-Za-z0-9_]&lt;br /&gt;&lt;br /&gt;\k is called back referencing character.... for eg: the word &#39;little&#39; has 2 t&#39;s hence the regular expression will reach the letter t in the above word and find if there is another t that precedes it. so it looks back to find immediate occurances of the letter/character which it is processing currently.</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/2707018557714853839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/2707018557714853839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/2707018557714853839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/2707018557714853839'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2008/08/some-basics-of-regular-expressions-for.html' title='Some Basics of Regular Expressions (For beginners)'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-5669656287168852108</id><published>2008-08-11T01:47:00.000-07:00</published><updated>2008-08-11T02:07:16.836-07:00</updated><title type='text'>The &quot;Default&quot; keyword in C# Generics</title><content type='html'>Generics are very useful while creating reusable components and ensuring type safety. There may be times where one is unsure whether the type of T is a value type or a reference type.In such circumstances we could use the &lt;strong&gt;&quot;default&quot;&lt;/strong&gt; keyword being provided by c#.&quot;default&quot; will return null in case of reference types and will return 0 in case if value types. For structures &quot;default&quot; will initialise each item of an enum to null or 0 based on whether its a reference type or value type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;for eg: &lt;br /&gt;Class GenericComparerClass&lt;T&gt; where T: IComparable&lt;br /&gt;{&lt;br /&gt;public T t1;&lt;br /&gt;public T t2;&lt;br /&gt;&lt;br /&gt;public GenericComparerClass(T t1Type, T t2Type)&lt;br /&gt;{&lt;br /&gt;t1= t1Type;&lt;br /&gt;t2= t2Type;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public T MaxT()&lt;br /&gt;{&lt;br /&gt;if(t1.CompareTo(t2)&gt;0)&lt;br /&gt;return T1;&lt;br /&gt;else&lt;br /&gt;&lt;strong&gt; &lt;em&gt; default(T);&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Happy coding....</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/5669656287168852108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/5669656287168852108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/5669656287168852108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/5669656287168852108'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2008/08/default-keyword-in-c-generics.html' title='The &quot;Default&quot; keyword in C# Generics'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-2411560634461530881</id><published>2007-12-21T01:29:00.000-08:00</published><updated>2008-08-06T01:45:21.578-07:00</updated><title type='text'>Mundane get() set() got smart in the Framework 3.5</title><content type='html'>In this Blog Feature i will explain the New concepts of Framework 3.5 and the Visual Studio 2008 IDE.&lt;br /&gt;&lt;br /&gt;The following are the new features of the framework 3.5&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) Automatic Property Setter.&lt;br /&gt;&lt;br /&gt;eg:&lt;br /&gt;&lt;br /&gt;pulbic class Person&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;private string _name;&lt;br /&gt;private string _address;&lt;br /&gt;private int _age;&lt;br /&gt;&lt;br /&gt;// Normal Getter Sertter Logic For the Properties&lt;br /&gt;&lt;br /&gt; public string Name&lt;br /&gt; {&lt;br /&gt;   get{ return _name;}&lt;br /&gt;   set{ _name=value;}&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public string Address&lt;br /&gt; {&lt;br /&gt;   get{return _address;}&lt;br /&gt;   set{ _address=value;}&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public int Age&lt;br /&gt; {&lt;br /&gt;   get{ return _age}&lt;br /&gt;   set{ _age=value;}&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;After the New visual studio 2008 with the new framework we would do this in the following way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class Person&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public string Name {get;set;}&lt;br /&gt;&lt;br /&gt;public string Address{get;set;}&lt;br /&gt;&lt;br /&gt;public int age {get;set;}&lt;br /&gt;&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/2411560634461530881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/2411560634461530881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/2411560634461530881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/2411560634461530881'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2007/12/whats-new-in-framework-35-and-visual.html' title='Mundane get() set() got smart in the Framework 3.5'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-8475855266112264297</id><published>2007-12-05T00:51:00.000-08:00</published><updated>2007-12-05T00:52:58.256-08:00</updated><title type='text'>Problem with svcutil.exe while using Visual Studio Beta 2</title><content type='html'>Running some WCF-based project templates results in a crash of svcutil.exe crashing due to a signing issue &lt;br /&gt;&lt;br /&gt;Running some WCF-based project templates starts the service in WCF Service Host and opens a test form to debug operations on the service. Because of a signing problem, this results in a crash of svcutil.exe and the test form does not work. &lt;br /&gt;&lt;br /&gt;To resolve this issue: &lt;br /&gt;&lt;br /&gt;Disable strong name signing for svcutil.exe by opening a Visual Studio Command Prompt. At the command prompt run: sn -Vr &quot;&lt;program files&gt;\Microsoft SDKs\Windows\v6.0A\Bin\SvcUtil.exe&quot;  (replace &lt;program files&gt; with your program files path - ex: c:\Program Files)</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/8475855266112264297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/8475855266112264297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/8475855266112264297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/8475855266112264297'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2007/12/problem-with-svcutilexe-while-using.html' title='Problem with svcutil.exe while using Visual Studio Beta 2'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6710299478360418871.post-2681707456788755071</id><published>2007-12-02T10:30:00.001-08:00</published><updated>2007-12-04T03:51:57.383-08:00</updated><title type='text'>Programming in Moss 2007 object Model</title><content type='html'>The names microsoft put are distinctive and catchy....thats why microsoft developers never seem to pull their hair in remembering the name of the last software they used and found it good.&lt;br /&gt;&lt;br /&gt;The MOSS 2007 or Microsoft Office Sharepoint Server 2007 is the rechristened version of the SharePoint Server 2003. It has got a majority of features that made 2003 a nightmare for developers and UI developers.&lt;br /&gt;&lt;br /&gt;The MOSS2007 creates and arranges data in the form of Lists or so called libraries (although this may be just a beginner description) .&lt;br /&gt;The Heirarchy follows as under&lt;br /&gt;&lt;br /&gt;Site&lt;br /&gt;Web&lt;br /&gt;ListItemCollection&lt;br /&gt;List Item&lt;br /&gt;FieldCollection&lt;br /&gt;Field.&lt;br /&gt;&lt;br /&gt;Such a classification makes the understanding and development using MOSS Object Model easier.&lt;br /&gt;&lt;br /&gt;The following piece of code will Loop through the List of users of a particular web site on MOSS and return the datatable of data regarding its users.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public DataTable getListOfUsers(string siteUrl)&lt;br /&gt;{&lt;br /&gt;SPSite myCollections = new SPSite(siteUrl);&lt;br /&gt;DataTable odtSiteUsers = new DataTable();&lt;br /&gt;foreach (SPWeb site in myCollections.AllWebs)&lt;br /&gt;{&lt;br /&gt;SPUserCollection oSPUser = site.SiteUsers;&lt;br /&gt;if (site.Name == &quot;SharepointBuzzRajiv&quot;)&lt;br /&gt;{&lt;br /&gt;DataRow drUserRow;&lt;br /&gt;odtSiteUsers.Columns.Add(new DataColumn(&quot;UserName&quot;, typeof(string)));&lt;br /&gt;odtSiteUsers.Columns.Add(new DataColumn(&quot;Email&quot;, typeof(string)));&lt;br /&gt;odtSiteUsers.Columns.Add(new DataColumn(&quot;isSiteAdmin&quot;, typeof(string)));&lt;br /&gt;foreach (SPUser oUser in oSPUser)&lt;br /&gt;{&lt;br /&gt;drUserRow = odtSiteUsers.NewRow();&lt;br /&gt;drUserRow[0] = oUser.Name;&lt;br /&gt;drUserRow[1] = oUser.Email;&lt;br /&gt;drUserRow[2] = oUser.IsSiteAdmin.ToString();&lt;br /&gt;odtSiteUsers.Rows.Add(drUserRow);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return odtSiteUsers;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have got much more to blog in detail....but that will follow later on....</content><link rel='replies' type='application/atom+xml' href='http://mathewrajiv.blogspot.com/feeds/2681707456788755071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6710299478360418871/2681707456788755071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/2681707456788755071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6710299478360418871/posts/default/2681707456788755071'/><link rel='alternate' type='text/html' href='http://mathewrajiv.blogspot.com/2007/12/programming-in-moss-2007-object-model.html' title='Programming in Moss 2007 object Model'/><author><name>Rajiv Mathew</name><uri>http://www.blogger.com/profile/03098221705195739132</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>