<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2567960203349165079</id><updated>2012-02-16T06:21:37.783-08:00</updated><category term='Broken Link'/><category term='rigths'/><category term='MOSS 2007'/><category term='foreign Key Constraint'/><category term='security'/><category term='code level access'/><category term='Actions'/><category term='SharePoint'/><category term='DataTable'/><category term='privileges'/><category term='.NET Reflection'/><category term='Soft Delete'/><category term='Data Acces Layer'/><category term='DTC Service and Table Adapters'/><category term='Add to My Links'/><category term='SOA'/><category term='Table Adapter Advantages and Disadvantages'/><category term='Typed DataSet'/><category term='Development'/><category term='SaaS'/><category term='Transactions and Table Adapters'/><category term='Software Engineer'/><category term='Maintaining Integrity in Soft Deletes'/><category term='MOSS'/><category term='asp.net 2.0'/><category term='impersonaton'/><category term='Large File Uploading Issue'/><category term='Problem'/><category term='Web Service Software Factory'/><category term='asp.net 3.5'/><category term='.NET 2.0'/><category term='.NET'/><title type='text'>Faheem Zafar's Blog</title><subtitle type='html'>Its all about Technology!!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-4440473926132644656</id><published>2010-07-09T00:43:00.000-07:00</published><updated>2010-07-09T00:51:52.544-07:00</updated><title type='text'>Branding in Microsoft Office SharePoint Server 2007</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;In MOSS (Microsoft Office SharePoint server 2007) word Branding is used the refer the process of changing the look and feel of the sharepoint main landing pages of mainly root sites and/or first level sites (normally sub sites are not exclusively branded. If have to then they use the same layout of their parent sites).&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;Though branding involved lot of graphics work and a SharePoint developer assumes to get a readymade html template from his/her graphic designer but  actual Branding is needed to be done only by SharePoint developer as GD mostly don’t have server side programming skill set.&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;Branding mainly consists of three parts.&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;1. Creating a SharePoint Site’s master page. (Master page, HTML, CSS, images etc)&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;&lt;br /&gt;2. Creating Page Layouts (SharePoint Page Layouts (.aspx pages)&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;&lt;br /&gt;3. Creating actual site pages based on page layout that contains the actual content to be shown.&lt;br /&gt;&lt;/span&gt; &lt;span style="font-family:verdana;"&gt;&lt;br /&gt;Andrew Connell wrote a very good article on the technical details of branding/customization. Article is of two parts. In first part he is explaining the planning and requirement gathering needs to accomplish the branding task easily and without repeated iterations. In second phase he is actually explaining the technical in depths details. He started with the renowned minimal.master page and start placing the SharePoint controls on custom master pages. For a newbie this is a great article.&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee354191.aspx"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;a style="font-family: times new roman;" href="http://msdn.microsoft.com/en-us/library/ee354191.aspx"&gt;Real World Branding with SharePoint Server 2007 Publishing Sites (Part 1 of 2)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-4440473926132644656?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/4440473926132644656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=4440473926132644656' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/4440473926132644656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/4440473926132644656'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2010/07/branding-in-microsoft-office-sharepoint.html' title='Branding in Microsoft Office SharePoint Server 2007'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-2343896311452734114</id><published>2010-06-09T05:12:00.000-07:00</published><updated>2010-06-09T05:28:19.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Problem'/><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Large File Uploading Issue'/><category scheme='http://www.blogger.com/atom/ns#' term='Broken Link'/><category scheme='http://www.blogger.com/atom/ns#' term='Add to My Links'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Actions'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>My First Microsoft Office SharePoint Server 2007 Project Issues</title><content type='html'>&lt;span style="font-family:Calibri;"&gt;Hi to all &lt;/span&gt;&lt;br /&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;Recently I worked on a MOSS 2007 project. During the development I faced lot of issues as I was very new on the technology but thanks GOD I survived. &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;Two of the issues I specially want to discuss here. &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;First, a strange link redirection problem and second large file corruption or failure while uploading in the Document Libraries.&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="font-family:Calibri;"&gt;Issue No. 1:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;I have a Site Collection in which there are lots of Sites for different company departments. I was facing a very strange issue that if user click on any List/Library’s &lt;b style="mso-bidi-font-weight: normal"&gt;“Actions” &lt;/b&gt;Menu&lt;b style="mso-bidi-font-weight: normal"&gt; &gt; Add to My Links” &lt;/b&gt;then user redirects to development server where the portal initially created. This was a really very strange problem for me because user’s My Site and Add to My Links at the top was working cent percent fine. First I thought it’s because of the backup and restore of the Site. But then after struggling a little bit I found a configuration entry in Root Level Site settings. Follow these steps to fix them. &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;Navigate to Root level site of your application’s site collection. &lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;Click &lt;b style="mso-bidi-font-weight: normal"&gt;Site Actions &gt; Site Settings &gt; Site Collection Administration &gt; Portal Site Connection.&lt;/b&gt; Verify that the link to the main content site and its name is correctly specified here.&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;u&gt;&lt;span style="font-family:Calibri;"&gt;Issue No. 2:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;Second issue was more painful as some of the files while uploading to the server either got corrupt or didn’t upload at all. I was receiving &lt;b style="mso-bidi-font-weight: normal"&gt;Page not found&lt;/b&gt; error. I Started with 1 MB file . Bingo… it’s successfully uploaded. Then I tried to upload a near 50 MB file(but less then 50 MB). Ohh k. I got Page not found error. This mean the problem Is with large files. I check the &lt;b style="mso-bidi-font-weight: normal"&gt;Central Administration &gt; Application Management &gt; Site collection general settings&lt;/b&gt; and found that max file size is defined as 50 MB. After doing some Google I found that it’s the IIS issue and not the SharePoint problem. &lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;There is an special configuration entry needs to be defined in web.config to allow IIS to upload files more than 28 MB in size. Below is the entry needs to be defined inside the configuration&lt;b style="mso-bidi-font-weight: normal"&gt; &lt;/b&gt;tag&lt;b style="mso-bidi-font-weight: normal"&gt; &lt;/b&gt;region of the web.config file of web application.&lt;/span&gt;&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_t-RUL2Oz210/TA-Ieo7i_wI/AAAAAAAAAF4/HIfvYqpwVS8/s1600/New+Bitmap+Image.bmp"&gt;&lt;img style="WIDTH: 415px; HEIGHT: 124px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5480749331497811714" border="0" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/TA-Ieo7i_wI/AAAAAAAAAF4/HIfvYqpwVS8/s400/New+Bitmap+Image.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-2343896311452734114?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/2343896311452734114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=2343896311452734114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/2343896311452734114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/2343896311452734114'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2010/06/my-first-microsoft-office-sharepoint.html' title='My First Microsoft Office SharePoint Server 2007 Project Issues'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_t-RUL2Oz210/TA-Ieo7i_wI/AAAAAAAAAF4/HIfvYqpwVS8/s72-c/New+Bitmap+Image.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-6160048389421233327</id><published>2010-03-21T05:36:00.000-07:00</published><updated>2010-03-22T14:37:09.148-07:00</updated><title type='text'>Sharepoint Custom Webparts Development</title><content type='html'>If you are new on sharepoint and havn't started the custom Webpart development yet (except creating data view/data form and other OTB[out of the box] webparts) read the below article on msdn . its great for sharepoint newbies :)&lt;br /&gt;&lt;br /&gt;http://msdn.micrsoft.com/en-us/library/ms452873.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-6160048389421233327?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/6160048389421233327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=6160048389421233327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/6160048389421233327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/6160048389421233327'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2010/03/sharepoint-custom-webparts-develpment.html' title='Sharepoint Custom Webparts Development'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-431748381634481871</id><published>2010-02-03T02:51:00.000-08:00</published><updated>2010-07-09T00:56:03.176-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='rigths'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='privileges'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='code level access'/><category scheme='http://www.blogger.com/atom/ns#' term='impersonaton'/><title type='text'>Different ways of doing Impersonation in ASP.NET</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;When I first started working on asp.net I thought there is only one way of doing impersonation to level up the privileges of an asp.net thread request. But after really dealing with the real time issues in different projects I understand there are four different ways to do so and one should choose one or more of them keeping in mind the exact needs and usage scenarios.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Following are the four different ways i am talking about.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Impersonate the IIS Authenticated Account or User&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;script type="text/javascript"&gt;                 loadTOCNode(2, 'moreinformation');              &lt;/script&gt;&lt;span style="font-size:0;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;To impersonate the Microsoft Internet Information Services (IIS) authenticating user on every request for every page in an ASP.NET application, you must include an tag in the Web.config file of this application and set the impersonate attribute to true. like:&lt;- identity impersonate ="true" &gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;identity&gt;I&lt;span class="Apple-style-span"  style="font-family:Georgia, serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;mpersonate a Specific User for All the Requests of an ASP.NET Application&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/identity&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;script type="text/javascript"&gt;                 loadTOCNode(2, 'moreinformation');              &lt;/script&gt;&lt;span style="font-size:0;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;To impersonate a specific user for all the requests on all pages of an ASP.NET application, you can specify the userName and password attributes in the tag of the Web.config file for that application. For example: &lt;- identity impersonate ="true" username="myuser" password="mypwd"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;identity&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, serif;"&gt;&lt;/span&gt;&lt;/identity&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;p class="MsoNormal"&gt;&lt;identity username="accountname" password="password" impersonate="true"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Impersonate the Authenticating User in Code&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;script type="text/javascript"&gt;                 loadTOCNode(2, 'moreinformation');              &lt;/script&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;To impersonate the authenticating user (User.Identity) only when you run a particular section of code, you can use the code to follow. This method requires that the authenticating user identity is of type WindowsIdentity.&lt;br /&gt;System.Security.Principal.WindowsImpersonationContext impersonationContext;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;impersonationContext = &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;//Insert your code that runs under the security context of the authenticating user here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;impersonationContext.Undo();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Impersonate a Specific User in Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;script type="text/javascript"&gt;                 loadTOCNode(2, 'moreinformation');              &lt;/script&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;To impersonate a specific user only when you run a particular section of code, use the following code:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public const int LOGON32_LOGON_INTERACTIVE = 2;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public const int LOGON32_PROVIDER_DEFAULT = 0;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;WindowsImpersonationContext impersonationContext; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;[DllImport("advapi32.dll")]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static extern int LogonUserA(String lpszUserName, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;String lpszDomain,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;String lpszPassword,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;int dwLogonType, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;int dwLogonProvider,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ref IntPtr phToken);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;[DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static extern int DuplicateToken(IntPtr hToken, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;int impersonationLevel, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ref IntPtr hNewToken);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;[DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static extern bool RevertToSelf();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;[DllImport("kernel32.dll", CharSet=CharSet.Auto)]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static extern bool CloseHandle(IntPtr handle);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public void Page_Load(Object s, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if(impersonateValidUser("username", "domain", "password"))&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;//Insert your code that runs under the security context of a specific user here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;undoImpersonation();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;//Your impersonation failed. Therefore, include a fail-safe mechanism here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;private bool impersonateValidUser(String userName, String domain, String password)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;WindowsIdentity tempWindowsIdentity;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IntPtr token = IntPtr.Zero;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IntPtr tokenDuplicate = IntPtr.Zero;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if(RevertToSelf())&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if(LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;LOGON32_PROVIDER_DEFAULT, ref token) != 0)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if(DuplicateToken(token, 2, ref tokenDuplicate) != 0) &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;tempWindowsIdentity = new WindowsIdentity(tokenDuplicate);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;impersonationContext = tempWindowsIdentity.Impersonate();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if (impersonationContext != null)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CloseHandle(token);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CloseHandle(tokenDuplicate);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;return true;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if(token!= IntPtr.Zero)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CloseHandle(token);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if(tokenDuplicate!=IntPtr.Zero)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CloseHandle(tokenDuplicate);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;return false;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;private void undoImpersonation()&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;impersonationContext.Undo();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-431748381634481871?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/431748381634481871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=431748381634481871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/431748381634481871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/431748381634481871'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2010/02/impersonation-at-different-levels-in.html' title='Different ways of doing Impersonation in ASP.NET'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-2109038923453055653</id><published>2009-02-20T08:38:00.000-08:00</published><updated>2009-02-20T08:51:16.577-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Service Software Factory'/><category scheme='http://www.blogger.com/atom/ns#' term='SaaS'/><title type='text'>Accessing Object's Properties at Run Time using .NET Reflection</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="--"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:shapedefaults ext="edit" spidmax="1026"&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:shapelayout ext="edit"&gt;   &lt;o:idmap ext="edit" data="1"&gt;  &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size:100%;"&gt;Hi to All.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size:100%;"&gt;In my last project suddenly during design face I came across some what a different scenerio. It was something like that my UI Layer invoked Service Layer (generated by MS Software factory-Modeling E dition) which then invoked Business Layer. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;Between UI and Service Layer I had Service object s&lt;span style=""&gt;  &lt;/span&gt;(i-e Data contracts) and between Service and Business Layer there were business objects. The Problem was that there were some common fields in &lt;span style=""&gt; &lt;/span&gt;all of my service objects for audit purpose and I dind’t want to explicity set these fields for each insert and update operation from UI. Since the Service objects were &lt;span style=""&gt; &lt;/span&gt;actually Data contracts that were generated by a tool so I also didn’t want to alter the generated code because tool overrided the code each time someone regenerated the data contracts. I didn’t find any inheretance feature between data contracts so otherwise I would have gone for Base/Child pattern.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt; &lt;/span&gt;So what to do ?? I have objects that all are of different types and have common fields that needed to be set from a single location. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;The Solution is .Net Reflection. Using reflection one can access objects properties and any other meta data information at run time yes right at run time.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;Consider the code below it will tell you the whole story by itself.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt; &lt;/span&gt;public void AddAuditInformation(object entityObject, bool isNewRecord, int userID)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;if (entityObject != null)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;PropertyInfo propertyInfo = null;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;//if entity is new. Mean we have to insert Createdby and Createddate fields as well.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;if (isNewRecord)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;propertyInfo = entityObject.GetType().GetProperty("CreatedBy");&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;propertyInfo.SetValue(entityObject, userID, null);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;                   &lt;/span&gt;propertyInfo = entityObject.GetType().GetProperty("CreationDate");&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;propertyInfo.SetValue(entityObject, System.DateTime.Now, null);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;propertyInfo = entityObject.GetType().GetProperty("LastUpdatedBy");&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;propertyInfo.SetValue(entityObject, userID, null);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;propertyInfo = entityObject.GetType().GetProperty("LastUpdateDate");&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;propertyInfo.SetValue(entityObject, System.DateTime.Now, null);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-2109038923453055653?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/2109038923453055653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=2109038923453055653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/2109038923453055653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/2109038923453055653'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2009/02/accessing-objects-properties-at-run.html' title='Accessing Object&apos;s Properties at Run Time using .NET Reflection'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-8239105831126681427</id><published>2008-05-23T04:40:00.000-07:00</published><updated>2008-11-20T04:24:00.182-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintaining Integrity in Soft Deletes'/><category scheme='http://www.blogger.com/atom/ns#' term='foreign Key Constraint'/><category scheme='http://www.blogger.com/atom/ns#' term='Soft Delete'/><title type='text'>Maintaing Soft Delete</title><content type='html'>&lt;div align="justify"&gt;Hi, if you are a developer dude you must know the very first concept of Foreign Key Constraint. While writing software applications which access the database, you do not need to worry about the foreign key constraint. DBMS maintains it for you and if you try to delete any row which belongs to a table (which doesn’t have cascade delete check enabled), you get a foreign key violation Exception and beengo!! You can catch the exception and show it to the user. Also it will be just the level of implementation you want, you can also catch the exception’s error code and can show a friendly message on the basis of that error code.&lt;br /&gt;&lt;br /&gt;But what if your client belongs to some genius category and told you to make an application in which no record should be removed from the system. But application must also have the delete functionality so that user can delete the record from application but in database the record must be marked as “Deleted”. What you just have to do is to have an “Is_Deleted” bit column in each of your table. You will simply update its value to “True” on user delete action. At the same time all of your select queries must also include the check to get only those rows which have Is_Deleted equals to “False”.&lt;br /&gt;But here comes a problem.&lt;br /&gt;What if you a have a record in master table and that master table record also associate to some child table records. Marking that master table record as deleted will make your data inconsistent because now you will have some child records in your database whose master records are no more application level exists. Or in other words you have to maintain foreign key constraint on yourself.&lt;br /&gt;A good but complete approach is to first check all child tables before marking any master table record as deleted. And if any of the child table records exists based on that master record then throw a custom exception from the delete sp/query.&lt;br /&gt;Here is a simple sample procedure to accomplish the desired task&lt;br /&gt;&lt;br /&gt;PS: My table’s IS Deleted Column’s name is “ISACTIVE_FLAG”&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE [dbo].[sp_CORE_NA_SEAT_Delete]&lt;br /&gt;(&lt;br /&gt;@Original_NA_SEAT_ID int,&lt;br /&gt;&lt;br /&gt;/***********Params required for Auditing*********/&lt;br /&gt;@LAST_UPDATE_DATE datetime,&lt;br /&gt;@LAST_UPDATED_BY bigint,&lt;br /&gt;@IP nvarchar(1024),&lt;br /&gt;@AUDIT_1 nvarchar(1024),&lt;br /&gt;@AUDIT_2 nvarchar(1024),&lt;br /&gt;@LOCATION nvarchar(1024)&lt;br /&gt;/************************************************/&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;AS&lt;br /&gt;SET NOCOUNT OFF;&lt;br /&gt;&lt;br /&gt;IF EXISTS(&lt;br /&gt;SELECT * FROM CORE_NA_SEAT INNER JOIN (SELECT * FROM CORE_ELECTORAL_AREA WHERE ISACTIVE_FLAG = 1) as E&lt;br /&gt;on CORE_NA_SEAT.NA_SEAT_ID = E.NA_SEAT_ID&lt;br /&gt;AND CORE_NA_SEAT.NA_SEAT_ID = @Original_NA_SEAT_ID)&lt;br /&gt;OR&lt;br /&gt;EXISTS(&lt;br /&gt;SELECT * FROM CORE_NA_SEAT INNER JOIN VM_VOTER&lt;br /&gt;on CORE_NA_SEAT.NA_SEAT_ID = VM_VOTER.NA_SEAT_ID&lt;br /&gt;AND CORE_NA_SEAT.NA_SEAT_ID = @Original_NA_SEAT_ID)&lt;br /&gt;OR&lt;br /&gt;EXISTS(&lt;br /&gt;SELECT * FROM CORE_NA_SEAT INNER JOIN VM_VOTER_REMOVAL_RECORD&lt;br /&gt;on CORE_NA_SEAT.NA_SEAT_ID = VM_VOTER_REMOVAL_RECORD.NA_SEAT_ID&lt;br /&gt;AND CORE_NA_SEAT.NA_SEAT_ID = @Original_NA_SEAT_ID)&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;RAISERROR ('National Assembly Seat can''t be deleted because it is being used by some other records.', 16, 1);&lt;br /&gt;END&lt;br /&gt;ELSE&lt;br /&gt;&lt;br /&gt;UPDATE [CORE_NA_SEAT] SET [ISACTIVE_FLAG] = 0,&lt;br /&gt;LAST_UPDATE_DATE = @LAST_UPDATE_DATE,&lt;br /&gt;LAST_UPDATED_BY = @LAST_UPDATED_BY,&lt;br /&gt;IP = @IP, AUDIT_1 = @AUDIT_1, AUDIT_2=@AUDIT_2,&lt;br /&gt;LOCATION=@LOCATION&lt;br /&gt;&lt;br /&gt;WHERE ([NA_SEAT_ID] = @Original_NA_SEAT_ID)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-8239105831126681427?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/8239105831126681427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=8239105831126681427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/8239105831126681427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/8239105831126681427'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2008/05/maintaing-soft-delete.html' title='Maintaing Soft Delete'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-2976754669847174004</id><published>2008-02-11T05:13:00.000-08:00</published><updated>2008-02-15T05:39:07.562-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataTable'/><category scheme='http://www.blogger.com/atom/ns#' term='Typed DataSet'/><category scheme='http://www.blogger.com/atom/ns#' term='Transactions and Table Adapters'/><category scheme='http://www.blogger.com/atom/ns#' term='Table Adapter Advantages and Disadvantages'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Acces Layer'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='DTC Service and Table Adapters'/><title type='text'>The hidden power of Table Adapters (.NET 2.0)</title><content type='html'>Hi to all.&lt;br /&gt;We used table adapters to create DAL (Data Access Layer) in our last project so I decided to right a blog on their advantages and disadvantages. We were using SQL Server 2005 as RDMS. We had different choices for DAL but our lead decided to go for table adapters. Although it was looking silly at the start to work with them but at the end we find table adapters, a robust and modern approch for creating DAL.(i know there are lot of modern DAL generators available) The beauty of Table Adapters was in their one click re-configuration flexibility. Basically Table adapter is automatically created when you add a new typed Dataset in your project. Each table adapter is associated with a dataset and performs DB operations only on that dataset.With all their beauties Table Adapters also have some ugly thing. I hope these thing will be fix in next release of .net&lt;br /&gt;I will explain you how you can use table adapters to generate DAL for your project. So here is how you will go. Open VS 2005 and create a new website with language C#. I named it as "Table_Adapter_Test_Site".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166064079589634658" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_t-RUL2Oz210/R7GL6M7YcmI/AAAAAAAAADM/zhJptQRraww/s400/1.bmp" border="0" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In website solution add a new project of type "Class Library" and named it as "blog.DAL".&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166046534648230146" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_t-RUL2Oz210/R7F7887YcQI/AAAAAAAAAAc/DgzyHl0-1lU/s400/2.bmp" border="0" /&gt;&lt;br /&gt;Add a new Dataset in bog.DAL project and named it as "CORE_PROVINCE.xsd".&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166046543238164754" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_t-RUL2Oz210/R7F79c7YcRI/AAAAAAAAAAk/LBK0bcTM-Hw/s400/3.bmp" border="0" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After adding the Dataset you will see a blue color blank, screen something like this.&lt;br /&gt;It indicates that currently there is no data table in this typed dataset. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166046564713001250" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7F7-s7YcSI/AAAAAAAAAAs/9vu8dnICYTY/s400/4.bmp" border="0" /&gt; To add a data table in this typed dataset you need a connection with the database. If server explorer window is not open then open it from View&gt;Server Explorer&lt;br /&gt;In server explorer right click the "Data Connections" and click on "Add Connection..." tab. you will Add Connection screen like this. Provide data source, server name, credentials, DB name to connect to your database (MS SQL). Click on "Test Connection" button to verify that everything is ok till now.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166046590482805042" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_t-RUL2Oz210/R7F8AM7YcTI/AAAAAAAAAA0/UqUL6sezzL0/s400/5.bmp" border="0" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;You will see your newly added connection in the Data Connection list of Server Explorer. Expand Tables and drop any table on the Dataset. I dropped Province Table (states of Pakistan) on my dataset.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166046616252608834" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7F8Bs7YcUI/AAAAAAAAAA8/zYGOJhc4nfc/s400/6.bmp" border="0" /&gt;Note that a table adapter is automatically created with this data table and is attached in the bottom of the table. The newly generated table adapter (CORE_ProvinceTableAdapter) has two default Query based methods, Fill and GetData and both are used to SELECT data from data base.&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5166048377189200210" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_t-RUL2Oz210/R7F9oM7YcVI/AAAAAAAAABE/4Lngj2GGaEU/s400/7.bmp" border="0" /&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;At this stage you can directly use this table adapter to perform CRUD operations but to see what is inside running in this table adapter you can right click on the table adapter and click on "Configure..." tab.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166048381484167522" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_t-RUL2Oz210/R7F9oc7YcWI/AAAAAAAAABM/kRYumqF2CCo/s400/8.bmp" border="0" /&gt; &lt;/p&gt;You will see Select Statement for CORE_PROVINCE table. You can change the select statement and if required you can also use the Query Builder to generate complex (joined) select statements.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166048385779134834" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7F9os7YcXI/AAAAAAAAABU/6bCkFjDwtKQ/s400/9.bmp" border="0" /&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;After clicking the next button you can change the names of the default select function of this table adapter. On the same window you can also see that table adapter also has generated direct method for CRUD operation on this DB table. Click next and then Finsh.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166048385779134850" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7F9os7YcYI/AAAAAAAAABc/vdRhVUv6tUo/s400/10.bmp" border="0" /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5166048390074102162" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_t-RUL2Oz210/R7F9o87YcZI/AAAAAAAAABk/zCppya1mXE4/s400/11.bmp" border="0" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Rebuild the blog.DAL project, DAL for CORE_PROVINCE table is ready. Now you can explore methods which Typed Data Set provides for you. But i will more concentrate on user define DAL functions. Now consider if a user wants to add a complex update statement which involves CRUD operations on many DB tables as a single DB operation, he can add this functionality in some clicks. For example I have a update stored procedure defined in my Database and I want o use this procedure with this table adapter. Note that you can have much complex stored procedure and of any type. I created a stored proceduren amed as Update_Province_By_English_Name. This sp takes single parameter and returns number of rows affected. The sp is something like this.&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166050584802390482" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7F_os7YcdI/AAAAAAAAACE/0EJwen98bcs/s400/15.bmp" border="0" /&gt;&lt;/p&gt;&lt;p&gt;Now to use this sp as a function of table adapter right click on table adapter and Click on "Add Query" tab.&lt;img id="BLOGGER_PHOTO_ID_5166050571917488546" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_t-RUL2Oz210/R7F_n87YcaI/AAAAAAAAABs/ghBLe9JaLZM/s400/12.bmp" border="0" /&gt;&lt;br /&gt;On this window select "No Value" option and click next.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_t-RUL2Oz210/R7GHB87YcfI/AAAAAAAAACU/Er4v7e_yh38/s1600-h/17.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5166058715175481842" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_t-RUL2Oz210/R7GHB87YcfI/AAAAAAAAACU/Er4v7e_yh38/s400/17.bmp" border="0" /&gt;&lt;/a&gt;On the next window, select "Use existing Stored Procedure" and click next.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166050576212455858" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_t-RUL2Oz210/R7F_oM7YcbI/AAAAAAAAAB0/lhyn31gu86Y/s400/13.bmp" border="0" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You will see the list of all stored procedures defined in the database. Select the sp that you want to use.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5166050584802390498" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7F_os7YceI/AAAAAAAAACM/bbCw6JwgxTs/s400/16.bmp" border="0" /&gt;&lt;br /&gt;Provide the name of function which will execute this procedure. By default it is the same as of sp name.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_t-RUL2Oz210/R7GHCM7YcgI/AAAAAAAAACc/i9EuMcVQ8Qo/s1600-h/18.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5166058719470449154" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_t-RUL2Oz210/R7GHCM7YcgI/AAAAAAAAACc/i9EuMcVQ8Qo/s400/18.bmp" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_t-RUL2Oz210/R7GHCc7YchI/AAAAAAAAACk/VyiPa_RLVWI/s1600-h/19.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5166058723765416466" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_t-RUL2Oz210/R7GHCc7YchI/AAAAAAAAACk/VyiPa_RLVWI/s400/19.bmp" border="0" /&gt;&lt;/a&gt;Now u can see your newly added function in you table adapter.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_t-RUL2Oz210/R7GHCc7YciI/AAAAAAAAACs/ml8qc_490qo/s1600-h/20.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5166058723765416482" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_t-RUL2Oz210/R7GHCc7YciI/AAAAAAAAACs/ml8qc_490qo/s400/20.bmp" border="0" /&gt;&lt;/a&gt;Using this function is a piece of a cake.&lt;br /&gt;Note that each table adapter created a new namespace so to use any table adapter, you have to add its namespace in your code file. You can expand the image below to get the idea of how to use this function.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_t-RUL2Oz210/R7GHCs7YcjI/AAAAAAAAAC0/lIu1S9qquNc/s1600-h/21.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5166058728060383794" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7GHCs7YcjI/AAAAAAAAAC0/lIu1S9qquNc/s400/21.bmp" border="0" /&gt;&lt;/a&gt; Now we will discuss disadvantages of Table Adapters.&lt;br /&gt;1. The major drawback of table adapter is that it stores Database name as a prefix in the XML definition of each function you added in it and also with the default Fill and GetData functions.&lt;br /&gt;The problem occurs when you create a project using one database and eventually you need to change its name Now when u change the database name and try table adapter to execute that function you will get error.&lt;br /&gt;To Solve this problem you can remove the database name prefix from the XML file of dataset (XSD). To do so Find "DBObjectName" in the DAL project. &lt;img id="BLOGGER_PHOTO_ID_5166060171169395266" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_t-RUL2Oz210/R7GIWs7YckI/AAAAAAAAAC8/O7iH_y0w3Vc/s400/22.bmp" border="0" /&gt;&lt;br /&gt;You will see all of your table adapter's default and user defined functions have Database name as the prefix in their names. Remove all DB name prefixes from DBObjectName attributes and build your project again.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5166060214119068242" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_t-RUL2Oz210/R7GIZM7YclI/AAAAAAAAADE/Z45mkgImLJk/s400/prob_dbobjectName.bmp" border="0" /&gt;&lt;br /&gt;2. The second disadvantage of Table Adapters is that each table adapter uses a different connection object so if you want to combine two or more table adapter functions in a single Transaction scope (.net Transactions) then either you have to start DTC service (Distributed transaction coordinator) on your MS SQL Server or to follow the following work around.&lt;br /&gt;In order to solve this problem without starting the DTC service, you have to write a function in all of your table adapter classes to assign a single connection object to all of their Commands.&lt;br /&gt;To do so add a new partial class file (.cs) in your dataset (.xsd) and write the following code&lt;br /&gt;&lt;/p&gt;&lt;p&gt;namespace Kalsoft.ECP.CERS.DataAccess.CORE_PROVINCETableAdapters&lt;br /&gt;{&lt;br /&gt;public partial class CORE_PROVINCETableAdapter&lt;br /&gt;{&lt;br /&gt;public void AssignConnection(DbConnection sameCon)&lt;br /&gt;{&lt;br /&gt;if (sameCon != null)&lt;br /&gt;{&lt;br /&gt;SqlConnection sqlConn = sameCon as SqlConnection;&lt;br /&gt;this._connection = sqlConn;&lt;br /&gt;if ((this.Adapter.InsertCommand != null))&lt;br /&gt;{&lt;br /&gt;this.Adapter.InsertCommand.Connection = sqlConn;&lt;br /&gt;}&lt;br /&gt;if ((this.Adapter.DeleteCommand != null))&lt;br /&gt;{&lt;br /&gt;this.Adapter.DeleteCommand.Connection = sqlConn;&lt;br /&gt;}&lt;br /&gt;if ((this.Adapter.UpdateCommand != null))&lt;br /&gt;{&lt;br /&gt;this.Adapter.UpdateCommand.Connection = sqlConn;&lt;br /&gt;}&lt;br /&gt;for (int i = 0; (i &lt; i =" (i" connection =" sqlConn;"&gt; &lt;p&gt;This method will assign the provided connection object to all commands present in this table adapter. Before calling the DB operation of any table adapter in a particular Transaction scope you need to call AssignConnection method.&lt;br /&gt;3. The third and the last problem with the table adapters is that if you change the default schema of their CRUD operations, it does a very silly thing with DateTime ISNULL parameters of its update procedure.&lt;br /&gt;Consider you have a DateTime parameter named as "UpdateDate" and this field is also nullable. Eventually you need to change the schema of delete procedure mean you have your own delete procedure and you want to execute that delete procedure when a row deletes from the data table. You can do it by right click the configure and assign required procedure to call upon when adapters update function call on a deleted mark row.&lt;br /&gt;Everything will work fine but if you change any rows values and try to call update you will see an error that&lt;br /&gt;"Failed to Convert Int32 from DataTime"&lt;br /&gt;what happened ??&lt;br /&gt;Actually table adapter marked IsUpdateDateNull parameter of its update procedure as DateTime but in actual, it expects int32.&lt;br /&gt;To solve this problem, select table adapter &gt; open properties window &gt; click update Command &gt; Open Parameter Collection &gt; Change IsUpdateDateNull field type as int32. Rebuild the DAL and try again. It will surely fix this problem.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-2976754669847174004?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/2976754669847174004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=2976754669847174004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/2976754669847174004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/2976754669847174004'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2008/02/hidden-power-of-table-adapters-net-20.html' title='The hidden power of Table Adapters (.NET 2.0)'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_t-RUL2Oz210/R7GL6M7YcmI/AAAAAAAAADM/zhJptQRraww/s72-c/1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2567960203349165079.post-6863065800479351486</id><published>2008-02-11T04:41:00.000-08:00</published><updated>2008-02-11T05:33:01.455-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software Engineer'/><title type='text'>Welcome to my blog</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;Dear knowledge seeker.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;First of all i would to tell something about me. My name is Muhammad Faheem Zafar. I did my BS from University of Karachi and currently i am working as the Software Engineer in a reputable software house of pakistan since april, 2007 .&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;I am passionate about software coding techniques and technologies and also would like to share my knowledge with other.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;I hope you will find my blog interested and valuable at the same.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2567960203349165079-6863065800479351486?l=dcsian.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcsian.blogspot.com/feeds/6863065800479351486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2567960203349165079&amp;postID=6863065800479351486' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/6863065800479351486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2567960203349165079/posts/default/6863065800479351486'/><link rel='alternate' type='text/html' href='http://dcsian.blogspot.com/2008/02/welcome-to-my-blog.html' title='Welcome to my blog'/><author><name>Muhammad Faheem Zafar</name><uri>http://www.blogger.com/profile/05901191992250103208</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://3.bp.blogspot.com/_t-RUL2Oz210/SSVXWGbXKXI/AAAAAAAAADc/5-7cEN1zY4o/S220/personel.JPG'/></author><thr:total>1</thr:total></entry></feed>
