<?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-1788044772731985891</id><updated>2011-11-27T15:33:41.054-08:00</updated><category term='.Net Latest features'/><category term='ASP.Net'/><category term='FAQs'/><category term='.Net'/><category term='SQL Server'/><title type='text'>Microsoft-Onestop</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-5155380307867129576</id><published>2009-11-14T11:12:00.001-08:00</published><updated>2009-11-14T11:29:05.033-08:00</updated><title type='text'>Error connecting to TFS Server from client Server</title><content type='html'>&lt;strong&gt;PRoblem&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;when connect to TFS server from Visual studio 2008 to Team foundation server, we get the below error&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------Microsoft Visual Studio---------------------------&lt;br /&gt;&lt;br /&gt;Error&lt;br /&gt;Team Foundation Server USNBKU183P does not exist or is not accessible at this time.&lt;br /&gt;Technical information (for administrator):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HTTP code 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;---------------------------OK ---------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This problem is due to the proxy settings in IE. Please check the settings in the IE in the client machine.&lt;br /&gt;&lt;br /&gt;Open IE (tools -&gt; options -&gt; connections -&gt; lan settings) and change the proxy settings. Restart Visual studio and this worked for me.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Problem #2&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Team Project creation failed With Error&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Error TF30004&lt;/strong&gt;: The New Team Project Wizard encountered an unexpected error while initializing the Microsoft.ProjectCreationWizard.Reporting plug-in.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explanation TF30171&lt;/strong&gt;: The Microsoft.ProjectCreationWizard.Reporting plug-in used to create the new team project could not be initialized and returned the following error: TF30224: Failed to retrieve projects from the report server. Please check that the SQL Server Reporting Services Web and Windows services are running and you have sufficient privileges for creating a project..&lt;br /&gt;User Action Contact your Team Foundation Server administrator.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also Unable to connect to Reports node from Visual studio team system as shown in the image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_hu29p1S-YC4/Sv8ENRUbgSI/AAAAAAAAAFM/4a03XjaXaSM/s1600-h/TFSIssue.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5404042703901786402" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 500px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_hu29p1S-YC4/Sv8ENRUbgSI/AAAAAAAAAFM/4a03XjaXaSM/s320/TFSIssue.JPG" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Solution #2&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;           Install Visual studio 2008 Service pack 1 in the client machine to solve this issue.  Required Team Explorer version to connect at client side or higher vesions&lt;br /&gt; Microsoft Visual Studio 2008 Team ExplorerVersion &lt;strong&gt;9.0.30729.1&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-5155380307867129576?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/5155380307867129576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=5155380307867129576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/5155380307867129576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/5155380307867129576'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/11/error-connecting-to-tfs-server-from.html' title='Error connecting to TFS Server from client Server'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_hu29p1S-YC4/Sv8ENRUbgSI/AAAAAAAAAFM/4a03XjaXaSM/s72-c/TFSIssue.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-6282893112325694900</id><published>2009-05-12T11:31:00.000-07:00</published><updated>2009-05-12T11:42:45.306-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net'/><title type='text'>Windows Authentication(Active Directory/LDAP) in ASP.Net</title><content type='html'>&lt;span style="color:#000000;"&gt;Sometimes, there may be requirement to get user name from end user information and authenticate against active directory group/LDAP in ASP.Net.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;strong&gt;Following are the ways to achieve that&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;can be accomplished by enabling windows Integrated authentication in IIS server  and disabling Anonymous access for this application. By doing the above config changes in IIS server, the user will be shown a Login window in the browser and prompting for windows user credentials. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Alternate way is to get the logon crdentials using C# code and validate again user information. Below is the code snippet which is used to capture the login info using windows integrated authentication and validate against AD group. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;Write the following code sample in the Session start event and based on user validation, session will be started&lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000099;"&gt;using&lt;/span&gt; System.Security.Principal;&lt;br /&gt;&lt;span style="color:#000099;"&gt;using&lt;/span&gt; System.Security.Permissions; &lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;protected void&lt;/span&gt; Session_Start(&lt;span style="color:#00cccc;"&gt;Object&lt;/span&gt; sender, &lt;span style="color:#00cccc;"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{  &lt;br /&gt;&lt;span style="color:#009900;"&gt;// Get the current loged in User information&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;WindowsPrincipal&lt;/span&gt; user = (&lt;span style="color:#000099;"&gt;WindowsPrincipal&lt;/span&gt;)Thread.CurrentPrincipal;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;//Storing the user name in the session. If you remove the domain name, u can get user name alone&lt;/span&gt;   &lt;br /&gt;Session["&lt;span style="color:#990000;"&gt;userName&lt;/span&gt;"] =user.Identity.Name.&lt;span style="color:#000099;"&gt;Replace&lt;/span&gt;("&lt;span style="color:#990000;"&gt;DOMAINName\\&lt;/span&gt;",string.Empty);   &lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;// This session variable is used further to verify the user&lt;/span&gt;&lt;br /&gt;Session["&lt;span style="color:#990000;"&gt;SecurityIsApproved&lt;/span&gt;"] = "&lt;span style="color:#990000;"&gt;false&lt;/span&gt;";  &lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;// Check for valid user in the AD group&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;if&lt;/span&gt;(user.&lt;span style="color:#000000;"&gt;IsInRole&lt;/span&gt;("&lt;span style="color:#990000;"&gt;Active Directory group name&lt;/span&gt;"))  &lt;br /&gt; {    &lt;br /&gt; Session["&lt;span style="color:#990000;"&gt;SecurityIsApproved&lt;/span&gt;"] = "&lt;span style="color:#990000;"&gt;true&lt;/span&gt;";   &lt;br /&gt; }   &lt;br /&gt;&lt;span style="color:#000099;"&gt;else&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#000099;"&gt;throw new&lt;/span&gt; &lt;span style="color:#339999;"&gt;Exception&lt;/span&gt;("&lt;span style="color:#990000;"&gt;Invalid user&lt;/span&gt;");&lt;br /&gt;}  &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-6282893112325694900?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/6282893112325694900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=6282893112325694900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/6282893112325694900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/6282893112325694900'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/05/windows-authenticationactive.html' title='Windows Authentication(Active Directory/LDAP) in ASP.Net'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-8122290666688314935</id><published>2009-05-11T10:21:00.000-07:00</published><updated>2009-05-11T18:32:49.387-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net'/><title type='text'>Authentication in ASP.Net</title><content type='html'>The article explains different types of Authentication available in ASP.Net framework and it's functionalities. This explains the various authentication options supported by .net and their features. Each has their own advantages as well as dis-advantages and decision of the Authentication depends on the application.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Forms authentication&lt;/strong&gt; A system by which unauthenticated requests are redirected to an HTML form using HTTP client-side redirection. The user provides credentials and submits the form. If the application authenticates the request, the system issues a cookie that contains the credentials or a key for reacquiring the identity. Subsequent requests are issued with the cookie in the request headers; they are authenticated and authorized by an ASP.NET event handler using whatever validation method the application developer specifies.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Passport authentication&lt;/strong&gt; Centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Windows authentication&lt;/strong&gt; ASP.NET uses Windows authentication in conjunction with Microsoft Internet Information Services (IIS) authentication. Authentication is performed by IIS in one of three ways: basic, digest, or Integrated Windows Authentication. When IIS authentication is complete, ASP.NET uses the authenticated identity to authorize access.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To enable an authentication provider for an ASP.NET application, you only need to create an entry for the application configuration file as follows.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#660000;"&gt;authentication&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;mode&lt;/span&gt;= &lt;span style="color:#000099;"&gt;"[WindowsFormsPassportNone]&lt;/span&gt;"/&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;The different authentication Methods are&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;u&gt;&lt;strong&gt;Anonymous Authentication&lt;/strong&gt;:&lt;/u&gt; Used for public areas of Internet sites.Used for public areas of Internet sites. This is supported by all browsers and uses IUSR_computername account.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;u&gt;Basic Authentication:&lt;/u&gt;&lt;/strong&gt; This requires a user name and password and Transmits &lt;strong&gt;password unencrypted&lt;/strong&gt;.Assumption here is that the connection between the client and server computers is secure and can be trusted. Specifically, the credentials are passed as &lt;strong&gt;plaintext and could be intercepted&lt;/strong&gt; easily.One advantage of the basic access authentication is that it is supported by all popular web browsers.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;u&gt;Digest authentication&lt;/u&gt;&lt;/strong&gt; addresses many of the weaknesses of basic authentication.Usable across &lt;strong&gt;proxy servers and other firewalls&lt;/strong&gt;.Digest Authentication offers single &lt;strong&gt;sign-on only to a single Web URL&lt;/strong&gt; protection space. If users navigate to a different Web site, or even to a different server in the same site, they will usually be prompted to enter credentials again.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;u&gt;Integrated Windows Authentication:&lt;/u&gt;&lt;/strong&gt; Used for private areas of intranets.Secure form of authentication because the user name and password are not sent across the network.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;u&gt;Certificates&lt;/u&gt;&lt;/strong&gt;: Widely used for secure transactions over Internet.Obtain server certificates. Configure certificate trust lists (CTLs) (for first use only).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;u&gt;Forms authentication:&lt;/u&gt;&lt;/strong&gt; used for personalization, where content is customized for a known user.This is achieved using SQL Server membership provider and active directory membership provider.Controls like ASP.Net login controls are used to implement forms authentication.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Differences between NTLM and Kerberos in Windows authentication&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;NTLM Authentication&lt;/strong&gt; is the well-known and loved challenge-response authentication mechanism. That is the default authentication protocol of Windows NT 4.0 and earlier Windows versions. For backward compatibility reasons, Microsoft still supports NTLM in Windows Vista, Windows Server 2003.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Kerberos&lt;/strong&gt;, on the other hand, is a more complex ticket-based authentication mechanism that authenticates the client to the server and authenticates the server to the client. While Kerberos is more secure, it can be a bit challenging to set up properly.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Kerberos has the following key advantages that make it worth consideration&lt;/strong&gt;.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt; - Kerberos caches information about the client after authentication. This means that it can perform better than NTLM particularly in large farm environments.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Delegation&lt;/strong&gt; - Kerberos can delegate the client credentials from the SharePoint (For Example) front-end web server to other back-end servers like SQL Server. As an example, consider a web part that access a SQL Server database and uses a connection string that relies on the end-user credentials (i. e., “Integrated Security=SSPI”). If the targeted SQL Server is not on the same physical server as SharePoint, the database log in will fail under NTLM authentication. This is the dreaded “double-hop” scenario that affects not only SharePoint, but ASP.NET applications as well. Under Kerberos, however, the log in will succeed.&lt;/li&gt;&lt;li&gt;Kerberos supports for smart card logon where as NTLM is not.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-8122290666688314935?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/8122290666688314935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=8122290666688314935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/8122290666688314935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/8122290666688314935'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/05/types-of-authentication-in-aspnet.html' title='Authentication in ASP.Net'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-5431640660990664535</id><published>2009-05-08T12:31:00.000-07:00</published><updated>2009-05-08T13:32:10.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FAQs'/><title type='text'>Frequently asked interview questions in SQL Server 2005</title><content type='html'>This article explains the frequently asked (FAQs) interview questions in SQL Server 2005 with answers. This covers basic and advanced concept of SQL Server&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;1. What are the differences between User Defined function (UDF) and Stored Procedure?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Stored Procedure is pre compiled execution plan where as functions are not.&lt;/li&gt;&lt;li&gt;Stored Procedure returns more than one value at a time while function returns only one value at a time.&lt;/li&gt;&lt;li&gt;We can call the UDFs in sql statements (select max (sal) from emp) whereas SP is not so&lt;/li&gt;&lt;li&gt;Function parameters are always IN, no OUT is possibleFunctions MUST return a value, procedures need not be&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;2. How to Create and Run a CLR SQL Server User-Defined Function?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a SQL Server Project in Visual Studio&lt;/li&gt;&lt;li&gt;From the Project menu, select Add New Item.&lt;/li&gt;&lt;li&gt;Select User-Defined Function in the Add New Item Dialog Box.&lt;/li&gt;&lt;li&gt;Type a Name for the new user-defined function.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;using&lt;/span&gt; System.Data.SqlTypes;&lt;/p&gt;&lt;span style="color:#000099;"&gt;using&lt;/span&gt; Microsoft.SqlServer.Server;&lt;br /&gt;&lt;span style="color:#339999;"&gt;public partial&lt;/span&gt; &lt;span style="color:#000099;"&gt;class&lt;/span&gt; UserDefinedFunctions{&lt;br /&gt;[&lt;span style="color:#339999;"&gt;SqlFunction&lt;/span&gt;()]&lt;br /&gt;&lt;span style="color:#339999;"&gt;public static&lt;/span&gt; &lt;span style="color:#000099;"&gt;SqlDouble&lt;/span&gt; addTax(&lt;span style="color:#339999;"&gt;SqlDouble&lt;/span&gt; originalAmount) {&lt;br /&gt;SqlDouble taxAmount = originalAmount * .3;&lt;br /&gt;&lt;span style="color:#000099;"&gt;return&lt;/span&gt; originalAmount + taxAmount;&lt;br /&gt;}}&lt;br /&gt;&lt;br /&gt;Select Deploy project from the Build menu&lt;br /&gt;Note : The common language runtime (CLR) integration feature is turned off by default in Microsoft SQL Server and must be enabled in order to use SQL Server project items.&lt;br /&gt;To enable CLR integration, use the clr enabled option of the &lt;strong&gt;sp_configure&lt;/strong&gt; stored procedure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;EXEC sp_configure 'clr enabled' , '1'&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To learn more, click &lt;a href="http://msdn.microsoft.com/en-us/library/w2kae45k(VS.80).aspx"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;3. What is SQL Cache Dependency in ASP.NET 2.0?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;SQL cache dependencies are &lt;strong&gt;new technique in ASP.NET 2.0&lt;/strong&gt; which can automatically invalidate a cached data object just like a Dataset. when the related data is modified in the database. So for instance if you have a dataset which is tied up to a database tables any changes in the database table will invalidate the cached data object which can be a dataset or a data source.&lt;br /&gt;To enable this we need a syntax that is as follows:- &lt;strong&gt;aspnet_regsql -ed -E -d Northwind&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;4.What are the different types of temporary tables in SQL Server?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Local temporary tables&lt;/strong&gt; are created using a single pound (#) sign and are visible to a single connection and automatically dropped when that connection ends.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Global temporary tables&lt;/strong&gt; are created using a double pound (##) sign and are visible across multiple connections and users and are automatically dropped when all SQL sessions stop referencing the global temporary table.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;5.What is the difference between UNION ALL and UNION Statement?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;The main difference between UNION ALL statement and UNION is &lt;strong&gt;UNION All statement is much faster than UNION&lt;/strong&gt;. The reason behind this is that because UNION ALL statement does not look for duplicate rows, but on the other hand UNION statement does look for duplicate rows, whether or not they exist.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;6. What is the use of Cascade and Restrict when we use DROP table in SQL SERVER?&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;When we are using Drop table in SQL the syntax is simple. SQL92 specifies some additional capabilities for DROP TABLE:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Drop table&lt;/span&gt; table_name(CASCADE / RESTRICT)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If we use &lt;strong&gt;cascade to drop table although it have some dependencies&lt;/strong&gt; just like triggers, views, stored procedure, primary key, foreign key it will delete first.But if we use restrict a error message is shown on using of DROP if the table have relation Trigger or stored procedure&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;7. What is the use of SCHEMABINDING Option in creation of view in SQL Server?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Imagine that you have created a view without SCHEMABINDING option and you have altered the schema of underlying table (deleted one column). Next time when you run your view, it will fail. Here is when SCHEMABINDING comes into picture. Creating a view with SCHEMABINDING option locks the underlying tables and prevents any changes that may change the table schema.&lt;br /&gt;&lt;br /&gt;E.g &lt;span style="color:#000099;"&gt;CREATE VIEW&lt;/span&gt; testview&lt;br /&gt;&lt;span style="color:#000099;"&gt;WITH SCHEMABINDING&lt;br /&gt;AS&lt;br /&gt;SELECT &lt;/span&gt;SalesTerritoryID, CustomerID,&lt;br /&gt;&lt;span style="color:#000099;"&gt;FROM&lt;/span&gt; testtable a &lt;span style="color:#000099;"&gt;INNER JOIN&lt;/span&gt; testtable2 b&lt;br /&gt;&lt;span style="color:#000099;"&gt;ON&lt;/span&gt; (a.column1 = b.column1)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;8. What are the differences between DELETE TABLE and TRUNCATE TABLE commands?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;DELETE TABLE syntax logs the deletes thus make the delete operation slow. TRUNCATE table does not log any information but it logs information about deallocation of data page of the table so TRUNCATE table is faster as compared to delete table.&lt;/li&gt;&lt;li&gt;DELETE table can have criteria while TRUNCATE cannot.&lt;/li&gt;&lt;li&gt;TRUNCATE table cannot trigger&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;9. What is Normalization and what are the advantages?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It is set of rules that have been established to aid in the design of tables that are meant to be connected through relationships. This set of rules is known as Normalization.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Benefits of normalizing your database will include:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Avoiding repetitive entries&lt;/li&gt;&lt;li&gt;Reducing required storage space&lt;/li&gt;&lt;li&gt;Preventing the need to restructure existing tables to accommodate new data.&lt;/li&gt;&lt;li&gt;Increased speed and flexibility of queries, sorts, and summaries.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;10. What are the different types of Keys?&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Different types of Keys&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Primary key&lt;/strong&gt;:- The attribute or combination of attributes that uniquely identifies a row or record.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Foreign Key&lt;/strong&gt;:- an attribute or combination of attribute in a table whose value match a primary key in another table.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Composite key&lt;/strong&gt;:- A primary key that consists of two or more attributes is known as composite key&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Candidate key&lt;/strong&gt;:- is a column in a table which has the ability to become a primary key. Candidate Key (Primary Key) is a Key which Maintains the Row Unique .&lt;br /&gt;A table may have more than one combination of columns that could &lt;strong&gt;uniquely identify the rows in a table&lt;/strong&gt;; each combination is a candidate key.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Alternate Key&lt;/strong&gt;:- Any of the candidate keys that is not part of the primary key is called an alternate key. Alternate Key or Unique Key is similar to PK , except it accepts null Values .&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;11. What is DBCC and explain it's use?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;DBCC (&lt;strong&gt;Database Consistency Checker Commands&lt;/strong&gt;) is used to check logical and physical consistency of database structure. DBCC statements can fix and detect problems.&lt;br /&gt;They are grouped in to four categories:-&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Maintenance commands&lt;/strong&gt; like DBCC DBREINDEX , DBCC DBREPAR etc ,they are mainly used for maintenance tasks in SQL SERVER.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Miscellaneous commands&lt;/strong&gt; like DBCC ROWLOCK , DBCC TRACEO etc ,they are mainly used for enabling row-level locking or removing DLL from memory.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Status Commands&lt;/strong&gt; like DBCC OPENTRAN , DBCC SHOWCONTIG etc ,they are mainly used for checking status of the database.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Validation Commands&lt;/strong&gt; like DBCC CHECKALLOC, DBCCCHECKCATALOG etc, they perform validation operations on database.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;em&gt;12. What are the types of replication supported by SQL SERVER 2005?&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Snapshot Replication &lt;/strong&gt;takes snapshot of one database and moves it to the other database. After initial load data can be refreshed periodically. The only disadvantage of this type of replication is that all data has to be copied each time the table is refreshed.&lt;/li&gt;&lt;li&gt;In &lt;strong&gt;transactional replication&lt;/strong&gt; data is copied first time as in snapshot replication, but later only the transactions are synchronized rather than replicating the whole database. You can either specify to run continuously or on periodic basis.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Merge replication&lt;/strong&gt; combines data from multiple sources into a single central database. Again as usual the initial load is like snapshot but later it allows change of data both on subscriber and publisher, later when they come on-line it detects and combines them and updates accordingly.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Configuring SQL server Replication using SQL Server Publication and Subscription, click &lt;a href="http://www.exforsys.com/tutorials/sql-server-2005/sql-server-configuring-replication.html"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;13.What is BCP in SQL Server?&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;BCP (&lt;strong&gt;Bulk Copy Program&lt;/strong&gt;) is a command line utility by which you can import and export large amounts of data in and out of SQL SERVER database.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;14. What is the use of SQL Server Agent?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It is a Microsoft Windows service that executes &lt;strong&gt;scheduled administrative tasks&lt;/strong&gt;, which are called jobs. SQL Server Agent uses SQL Server to store job information. Jobs contain one or more job steps. Each step contains its own task, for example, backing up a database. SQL Server Agent can run a job on a schedule, in response to a specific event, or on demand.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;15. What are the types of Triggers?&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;1. DML Triggers&lt;/u&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;These triggers are fired when a Data Manipulation Language (DML) event takes place. These are attached to a Table or View and are fired only when an INSERT, UPDATE and/or DELETE event occurs. The trigger and the statement that fires it are treated as a single transaction. Using this we can cascade changes in related tables, can do check operations for satisfying some rules and can get noticed through firing Mails. We can even execute multiple triggering actions by creating multiple Triggers of same action type on a table. &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;AFTER Triggers&lt;/strong&gt;: As the name specifies, AFTER triggers are executed after the action of the INSERT, UPDATE, or DELETE statement is performed. AFTER triggers can be specified on tables only. Here is a sample trigger creation statement on the Users table.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;E.g To Create a DML trigger in T-SQL&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;SET NOCOUNT ON&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;CREATE TABLE&lt;/span&gt; UserTable (User_ID int IDENTITY, User_Name varchar(30), Type varchar(10))&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;GO&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;CREATE TRIGGER&lt;/span&gt; tr_User_INSERTON UserTable FOR INSERT AS PRINT GETDATE() &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;Go&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;INSERT&lt;/span&gt; UserTable (User_Name, Type) &lt;span style="color:#000099;"&gt;VALUES&lt;/span&gt; ('James', 'ADMIN')&lt;/p&gt;&lt;ul&gt;&lt;li&gt;INSTEAD OF Triggers INSTEAD OF triggers are executed in place of the usual triggering action. INSTEAD OF triggers can also be defined on views with one or more base tables, where they can extend the types of updates a view can support.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;2. &lt;strong&gt;&lt;u&gt;DDL Triggers&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;DDL triggers are new to SQL Server 2005. This type of triggers, like regular triggers, fire stored procedures in response to an event. They fire in response to a variety of Data Definition Language (DDL) events. These events are specified by the T-SQL statements that are start with the keywords CREATE, ALTER, and DROP. Certain stored procedures that perform DDL-like operations can also fire this. These are used for administrative tasks like auditing and regulating database operations.&lt;/p&gt;&lt;p&gt;3. &lt;strong&gt;&lt;u&gt;CLR Triggers&lt;/u&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;A CLR triggers can be any of the above, e.g. can be a DDL or DML one or can also be an AFTER or INSTEAD OF trigger. Here we need to execute one or more methods written in managed codes that are members of an assembly created in the .Net framework. Again, that assembly must be deployed in SQL Server 2005 using CREATE assembly statement. &lt;/p&gt;&lt;p&gt;Creating CLR Trigger is available &lt;a href="http://aspalliance.com/1273_CLR_Triggers_for_SQL_Server_2005.7"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-5431640660990664535?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/5431640660990664535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=5431640660990664535' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/5431640660990664535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/5431640660990664535'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/05/frequently-asked-interview-questions-in_08.html' title='Frequently asked interview questions in SQL Server 2005'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-7220284042155359703</id><published>2009-05-06T14:52:00.000-07:00</published><updated>2009-05-07T14:35:04.038-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FAQs'/><title type='text'>Frequently asked interview questions in ASP.Net web services</title><content type='html'>This article explains the frequently asked interview questions in ASP.Net web services with answers. This covers basic and advanced concept of Web service&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;&lt;strong&gt;1. What is Service Orientated Architecture(SOA)?&lt;/strong&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;strong&gt;A service-oriented architecture (SOA) is a group of services that communicate with each other&lt;/strong&gt;. The process of communication involves either simple data-passing between a service provider and service consumers, or a more complicated system of two or more service providers. Intercommunication implies the need for some means of connecting two or more services to each other.&lt;br /&gt;&lt;br /&gt;Simply, SOA describes an information technology architecture that enables distributed computing environments with many different types of computing platforms and applications.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;2. What are the approaches for implementing SOA?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Web services can implement a service-oriented architecture. Implementers commonly build SOAs using Web services standards (for example, using SOAP) that have gained broad industry acceptance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Building blocks of SOA are&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The &lt;strong&gt;service provider&lt;/strong&gt; creates a Web service and possibly publishes its interface and access information to the service registry. Each provider must decide which services to expose, how to make trade-offs between security and easy availability, how to price the services, or (if no charges apply) how to exploit them for other value. &lt;/li&gt;&lt;li&gt;The &lt;strong&gt;service requester&lt;/strong&gt; or Web service client &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;3. When do you require doing an Update a Project Web Reference?&lt;/span&gt;&lt;/strong&gt; &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;The application contains a Web reference to an XML Web service that has been recently modified on the server; you might need to update the reference in your project. While updating web service, it &lt;strong&gt;generates a new proxy for the Web service&lt;/strong&gt; so you can access the new method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;em&gt;4. What are the Components of Web service?&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;The componets of ASP.Net web services are&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;SOAP&lt;/strong&gt; (Simple Object Access Protocol) is a communication protocol it is for communication between applications. Its platform and language independent. It is based on XML and also help to get from Firewall. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;WSDL&lt;/strong&gt;(WebService description language) is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. It explains Service, method, input and output parameters. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;UDDI&lt;/strong&gt; stands for Universal Description, Discovery, and Integration. It is like a "Yellow Pages" for Web Services and is designed to provide detailed information regarding registered Web Services for all vendors. It is maintained by companies like Microsoft, IBM etc &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;em&gt;5. What are the different Web Services Protocols?&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Http-Get&lt;/strong&gt; protocol This is standard protocol that helps client to communicate with server with HTTP. When client send a request to server via HTTP request and reuired parameter are attached with the querystring.&lt;br /&gt;&lt;br /&gt;E.g &lt;a href="http://dotnet/interview.aspx?param1=value1&amp;amp;param=value2"&gt;http://dotnet/interview.aspx?param1=value1&amp;amp;param=value2&lt;/a&gt; and we get the value from query string.&lt;br /&gt;&lt;span style="color:#339999;"&gt;Request&lt;/span&gt;.querystring("&lt;span style="color:#990000;"&gt;param1&lt;/span&gt;")&lt;br /&gt;&lt;span style="color:#339999;"&gt;Request&lt;/span&gt;.querystring("&lt;span style="color:#990000;"&gt;param2&lt;/span&gt;").&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Http-Post&lt;/strong&gt; is same as Http-Get but the difference is that in place of sending parameters onto the URL information is send with HTTP request message with some extra information which contains Parameters and their values. These Protocols is limited to sending name/value pairs. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;SOAP:&lt;/strong&gt; The only difference is that its relies on the XML as compares to Http-Get, Http-Post. SOAP can send not only the name/value pairs but also some complex object also as for example data types, class, objects. SOAP can also uses request/response model as Http-Get, Http-post but it is not limited to Request/Response it can also send types of message. Because its uses XML that is pure text and hence pass firewalls easily. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;em&gt;6. What is Web Service Enhancement 3.0 (WSE)?&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Web Services Enhancements for .NET (WSE) is a product that enables you to build secure Web services quickly and easily.This gives &lt;strong&gt;wizard based approach&lt;/strong&gt; for developing and securing web services.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The Web Services Enhancements for Microsoft .NET (WSE) has many features to augment applications built on Web services using the .NET Framework 2.0.&lt;/li&gt;&lt;li&gt;Securing Applications That Use Web Services &lt;/li&gt;&lt;li&gt;Integration with .NET Framework 2.0 and Visual Studio 2005 &lt;/li&gt;&lt;li&gt;Sending Large Amounts of Data in a SOAP Message Using WSE &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;em&gt;7. What are the different types of Security supported in ASP.Net Web services?&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The type of Security supported in ASP.Net Web services&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Anonymous&lt;/li&gt;&lt;li&gt;Username&lt;/li&gt;&lt;li&gt;Windows(Kerberos)&lt;/li&gt;&lt;li&gt;Certificate&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;em&gt;8.What are the differences between ASP.net Web Service and .Net Remoting?&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Web services&lt;/strong&gt; support interoperability across platforms and are good for &lt;strong&gt;heterogeneous&lt;/strong&gt; environments. .NET Remoting requires the clients be built using .NET or another framework that supports .&lt;strong&gt;NET Remoting&lt;/strong&gt; which means a &lt;strong&gt;homogeneous&lt;/strong&gt; environment.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Web services&lt;/strong&gt; work in a &lt;strong&gt;stateless&lt;/strong&gt; environment where each request results in a new object created to service the request. To maintain state between requests, you can either use the same techniques used by ASP.NET pages, i.e., the Session and Application objects. .&lt;strong&gt;NET Remoting&lt;/strong&gt; supports &lt;strong&gt;state&lt;/strong&gt; management options using Singleton and can correlate multiple calls from the same client and support callbacks.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Web services serialize objects through XML contained in the SOAP messages and can thus only handle items that can be fully expressed in XML. .NET Remoting relies on the existence of the common language runtime assemblies that contain information about data types. This limits the information that must be passed about an object and allows objects to be passed by value or by reference.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In terms of performance, the .&lt;strong&gt;NET Remoting&lt;/strong&gt; plumbing provides the &lt;strong&gt;fastest&lt;/strong&gt; communication when you use the TCP channel and the binary formatter. In the case of Web services, the primary issue is performance.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Web service&lt;/strong&gt; Can be accessed only over &lt;strong&gt;HTTP&lt;/strong&gt; where as &lt;strong&gt;.net Remoting&lt;/strong&gt; Can be accessed over &lt;strong&gt;any protocol&lt;/strong&gt; (including TCP, HTTP, SMTP and so on) &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Web services&lt;/strong&gt; are &lt;strong&gt;Easy-to-create&lt;/strong&gt; and deploy where as &lt;strong&gt;Remoting&lt;/strong&gt; is &lt;strong&gt;Complex&lt;/strong&gt; to program&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;&lt;em&gt;9. How to avoid timeout in .net web service?&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;For long running process, the ASP.Net web service may timeout. To avoid this time out error, increase the timeout in Server and client side&lt;/p&gt;&lt;p&gt;&lt;strong&gt;At Server Side&lt;/strong&gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;configuration&lt;/span&gt;&amp;gt; &amp;lt;&lt;span style="color:#990000;"&gt;system.web&lt;/span&gt;&amp;gt; &lt;/p&gt;&lt;p&gt;&amp;lt;&lt;span style="color:#990000;"&gt;httpRuntime&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;executionTimeout&lt;/span&gt;="&lt;span style="color:#000099;"&gt;300&lt;/span&gt;"/&amp;gt; &lt;/p&gt;&lt;p&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;system.web&lt;/span&gt;&amp;gt; &amp;lt;/&lt;span style="color:#990000;"&gt;configuration&lt;/span&gt;&amp;gt; &lt;/p&gt;&lt;p&gt;The above configuration increases request timeout to 5 minutes&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;At Client side&lt;/strong&gt;, increase the timeout of the web service proxy&lt;br /&gt;&lt;span style="color:#339999;"&gt;Service1&lt;/span&gt; proxy = &lt;span style="color:#000099;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;Service1&lt;/span&gt; ();&lt;/p&gt;&lt;p&gt;proxy.&lt;span style="color:#339999;"&gt;Timeout&lt;/span&gt; = 300;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;10. How to pass the client credentials to a web service using proxy?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;To Pass the client credential at the client side using service proxy, write the following code using proxy credentials&lt;/p&gt;&lt;p&gt;&lt;span style="color:#009900;"&gt;// Create a new instance of the proxy class to an XML Web service method.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#339999;"&gt;Service1&lt;/span&gt; proxy = &lt;span style="color:#000099;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;Service1&lt;/span&gt;();&lt;/p&gt;&lt;p&gt;&lt;span style="color:#009900;"&gt;// Add the CredentialCache to the proxy class credentials.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;proxy.&lt;span style="color:#339999;"&gt;Credentials&lt;/span&gt; = System.&lt;span style="color:#339999;"&gt;Net.CredentialCache.DefaultCredentials&lt;/span&gt;;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#009900;"&gt;// Call the method on the proxy class.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;int result = proxy.&lt;span style="color:#339999;"&gt;myWebMethod&lt;/span&gt;(5,5);&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-7220284042155359703?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/7220284042155359703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=7220284042155359703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/7220284042155359703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/7220284042155359703'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/05/frequently-asked-interview-questions-in_06.html' title='Frequently asked interview questions in ASP.Net web services'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-1213646083083631492</id><published>2009-05-04T07:56:00.000-07:00</published><updated>2009-05-04T08:45:07.902-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net Latest features'/><title type='text'>Create Hierarchical Grid using WPF. A sample Application Using WPF</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_hu29p1S-YC4/Sf8NE8fyT_I/AAAAAAAAAEk/vRVlHMogG8c/s1600-h/WPFSample.JPG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;This article explains the creation of the hierarchical grid using .net Windows presentation foundation concept. This also explains a sample application using WPF.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To do this, we need &lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Listview&lt;/strong&gt; to display the items &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Groupstyle&lt;/strong&gt; Property to group items. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;To get the number of items, define &lt;strong&gt;ContainerStyle&lt;/strong&gt; for the GroupStyle and ItemCount will give the number of items in that category. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;GridView&lt;/strong&gt; to show the grid&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The xaml code for the above sample looks like&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;?xml:namespace prefix = d /&gt;&lt;d:propertygroupdescription propertyname="@Catalog"&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Window&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x:Class&lt;/span&gt;="&lt;span style="color:#000099;"&gt;WpfSampleApp.Window1&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/a&gt;" &lt;span style="color:#ff0000;"&gt;xmlns:x&lt;/span&gt;="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;" &lt;span style="color:#ff0000;"&gt;Title&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Heirarchial Grid Sample&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Height&lt;/span&gt;="&lt;span style="color:#000099;"&gt;300&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;="&lt;span style="color:#000099;"&gt;300&lt;/span&gt;"&amp;gt; &lt;/d:propertygroupdescription&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;d:propertygroupdescription propertyname="@Catalog"&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Grid&lt;/span&gt;&amp;gt; &lt;/d:propertygroupdescription&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;d:propertygroupdescription propertyname="@Catalog"&gt;&amp;lt;&lt;span style="color:#990000;"&gt;StackPanel&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;=&lt;span style="color:#000099;"&gt;'http://schemas.microsoft.com/winfx/2006/xaml/presentation'&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;xmlns:x&lt;/span&gt;=&lt;span style="color:#000099;"&gt;'http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;'&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;xmlns:d&lt;/span&gt;=&lt;span style="color:#000099;"&gt;'clr-namespace:System.Windows.Data;assembly=PresentationFramework'&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;StackPanel.Resources&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;XmlDataProvider&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x:Key&lt;/span&gt;="&lt;span style="color:#000099;"&gt;MyData&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;XPath&lt;/span&gt;="&lt;span style="color:#000099;"&gt;/Info&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;x:XData&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Info&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;=&lt;span style="color:#000099;"&gt;""&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ISBN 45-F1&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Winner&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Price&lt;/span&gt;="&lt;span style="color:#000099;"&gt;$32.05&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Author&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Aka&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Catalog&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Business&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ISBN 54-32&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;="&lt;span style="color:#000099;"&gt;C++ Inside&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Price&lt;/span&gt;="&lt;span style="color:#000099;"&gt;$10.00&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Author&lt;/span&gt;="&lt;span style="color:#000099;"&gt;John&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Catalog&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Language&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ISBN 14-A0&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Java Inside&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Price&lt;/span&gt;="&lt;span style="color:#000099;"&gt;$9.00&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Author&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Tom&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Catalog&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Language&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ISBN 56-78&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Stock Market&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Price&lt;/span&gt;="&lt;span style="color:#000099;"&gt;$8.50&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Author&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Bob&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Catalog&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Business&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ISBN AA-02&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Guideline for Health&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Price&lt;/span&gt;="&lt;span style="color:#000099;"&gt;$19.00&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Author&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Lee&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Catalog&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Health&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Item&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ID&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ISBN A4-07&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;="&lt;span style="color:#000099;"&gt;C# Inside&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Price&lt;/span&gt;="&lt;span style="color:#000099;"&gt;$8.50&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Author&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Bob&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Catalog&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Language&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Info&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;x:XData&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;XmlDataProvider&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;CollectionViewSource&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x:Key&lt;/span&gt;=&lt;span style="color:#000099;"&gt;'src'&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Source&lt;/span&gt;&lt;span style="color:#000099;"&gt;="{Binding Source={StaticResource MyData}, XPath=Item}&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;CollectionViewSource.GroupDescriptions&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;d:&lt;span style="color:#990000;"&gt;PropertyGroupDescription &lt;/span&gt;&lt;span style="color:#ff0000;"&gt;PropertyName&lt;/span&gt;=&lt;span style="color:#000099;"&gt;"@Catalog"&lt;/span&gt; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;CollectionViewSource.GroupDescriptions&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;CollectionViewSource&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;StackPanel.Resources&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;ListView&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;ItemsSource&lt;/span&gt;='&lt;span style="color:#000099;"&gt;{Binding Source={StaticResource src}}&lt;/span&gt;' &lt;span style="color:#ff0000;"&gt;BorderThickness&lt;/span&gt;="&lt;span style="color:#000099;"&gt;0&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;ListView.GroupStyle&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GroupStyle&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GroupStyle.ContainerStyle&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Style&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetType&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{x:Type GroupItem}&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Margin&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;="&lt;span style="color:#000099;"&gt;0,0,0,5&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Template&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Setter.Value&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;ControlTemplate&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetType&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{x:Type GroupItem}&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#000099;"&gt;Expander&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;IsExpanded&lt;/span&gt;="&lt;span style="color:#000099;"&gt;True&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;BorderBrush&lt;/span&gt;=&lt;span style="color:#000099;"&gt;"#FFA4B97F"&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;BorderThickness&lt;/span&gt;="&lt;span style="color:#000099;"&gt;0,0,0,1&lt;/span&gt;"&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Expander.Header&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;DockPanel&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;FontWeight&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Bold&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Text&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{Binding Path=Name}&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Margin&lt;/span&gt;="&lt;span style="color:#000099;"&gt;5,0,0,0&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;="&lt;span style="color:#000099;"&gt;100&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;TextBlock&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;FontWeight&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Bold&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Text&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{Binding Path=ItemCount}&lt;/span&gt;"/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;DockPanel&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Expander.Header&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;Expander.Content&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;ItemsPresenter&lt;/span&gt; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Expander.Content&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Expander&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;ControlTemplate&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Setter.Value&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Setter&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Style&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;GroupStyle.ContainerStyle&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;GroupStyle&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;ListView.GroupStyle&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;ListView.View&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GridView&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Header&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ID&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{Binding &lt;/span&gt;&lt;a href="mailto:XPath=@ID"&gt;&lt;span style="color:#000099;"&gt;XPath=@ID&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000099;"&gt;}&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;="&lt;span style="color:#000099;"&gt;100&lt;/span&gt;" /&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Header&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Name&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{Binding &lt;/span&gt;&lt;a href="mailto:XPath=@Name"&gt;&lt;span style="color:#000099;"&gt;XPath=@Name&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000099;"&gt;}&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;="&lt;span style="color:#000099;"&gt;140&lt;/span&gt;" /&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Header&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Price&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{Binding &lt;/span&gt;&lt;a href="mailto:XPath=@Price"&gt;&lt;span style="color:#000099;"&gt;XPath=@Price&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000099;"&gt;}&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;="&lt;span style="color:#000099;"&gt;80&lt;/span&gt;" /&amp;gt;&lt;br /&gt;&amp;lt;&lt;span style="color:#990000;"&gt;GridViewColumn&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Header&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Author&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;DisplayMemberBinding&lt;/span&gt;="&lt;span style="color:#000099;"&gt;{Binding &lt;/span&gt;&lt;a href="mailto:XPath=@Author"&gt;&lt;span style="color:#000099;"&gt;XPath=@Author&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000099;"&gt;}&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;="&lt;span style="color:#000099;"&gt;80&lt;/span&gt;" /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;GridView&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;ListView.View&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;ListView&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;StackPanel&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Grid&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style="color:#990000;"&gt;Window&lt;/span&gt;&amp;gt;&lt;/d:propertygroupdescription&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;d:propertygroupdescription propertyname="@Catalog"&gt;&lt;/d:propertygroupdescription&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;d:propertygroupdescription propertyname="@Catalog"&gt;&lt;strong&gt;The Output of the above code looks like below&lt;/strong&gt;&lt;/d:propertygroupdescription&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;d:propertygroupdescription propertyname="@Catalog"&gt;&lt;/d:propertygroupdescription&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;img src="http://3.bp.blogspot.com/_hu29p1S-YC4/Sf8NE8fyT_I/AAAAAAAAAEk/vRVlHMogG8c/s1600/WPFSample.JPG" alt="[WPFSample.JPG]" border=0&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-1213646083083631492?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/1213646083083631492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=1213646083083631492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/1213646083083631492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/1213646083083631492'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/05/create-hierarchical-grid-using-wpf.html' title='Create Hierarchical Grid using WPF. A sample Application Using WPF'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_hu29p1S-YC4/Sf8NE8fyT_I/AAAAAAAAAEk/vRVlHMogG8c/s72-c/WPFSample.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-3972728385153294085</id><published>2009-05-02T21:45:00.000-07:00</published><updated>2009-05-02T22:38:47.175-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FAQs'/><title type='text'>Frequently asked interview questions in ASP.Net</title><content type='html'>This article explains the frequently asked interview questions in ASP.Net with answers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;1. How to bring COM Component Compatibility in ASP.NET?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;When using single-threaded apartment (STA) COM components, such as components developed using Visual Basic, from an ASP.NET page, you must include the compatibility attribute AspCompat=true in an Page tag on the ASP.NET page, as shown in the following code example.&lt;br /&gt;&lt;&lt;a href="mailto:%@"&gt;%@ &lt;span style="color:#990000;"&gt;Page&lt;/span&gt;&lt;/a&gt; &lt;span style="color:#ff0000;"&gt;AspCompat&lt;/span&gt;="&lt;span style="color:#000099;"&gt;true&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;Language&lt;/span&gt; = "&lt;span style="color:#000099;"&gt;C#&lt;/span&gt;" %&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;2. What is the difference between login controls in ASP.Net and Forms authentication?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Login controls are an easy way to implement Forms authentication&lt;/strong&gt; without having to write any code. For example, the Login control performs the same functions you would normally perform when using the FormsAuthentication class &lt;/p&gt;&lt;ul&gt;&lt;li&gt;prompt for user credentials&lt;/li&gt;&lt;li&gt;validate them, and &lt;/li&gt;&lt;li&gt;issue the authentication ticket&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;But with all the functionality wrapped in a control that you can just drag from the Toolbox in Visual Studio. Under the covers, the login control uses the FormsAuthentication class (for example, to issue the authentication ticket) and ASP.NET membership (to validate the user credentials). Naturally, you can still use Forms authentication yourself, and applications you have that currently use it will continue to run.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;3.Since there can be multiple ASP.NET configuration files on one computer, how does ASP.NET configuration handle inheritance?&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;ASP.NET integrates the settings in configuration files (the Machine.config and Web.config files) into a single inheritance hierarchy. With a few exceptions, you can place a Web.config file wherever you need to override the configuration settings that are inherited from a configuration file located at a higher level in the hierarchy.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;We can have web config file at each folder or sub folder of the web application which overrides the higher level config. To learn more about web config hierarchy, click &lt;a href="http://mstech-onestop.blogspot.com/2009/04/webconfig-hierarchy-in-aspnet.html"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;4. What is the difference between Web server control and HTML control?&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Server Control&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Runs at the serverY&lt;/li&gt;&lt;li&gt;ou prefer a Visual Basic-like programming model. &lt;/li&gt;&lt;li&gt;You are writing a Web Forms page that might be used by both HTML 3.2 and HTML 4.0 browsers. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;HTML control&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Runs in the Browser&lt;/li&gt;&lt;li&gt;You prefer an HTML-like object model. &lt;/li&gt;&lt;li&gt;You are working with existing HTML pages and want to quickly add Web Forms functionality. Because HTML server controls map exactly to HTML elements, they can be supported by any HTML design environment. &lt;/li&gt;&lt;li&gt;The control will also interact with client script. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;HTML Server Controls, By default, HTML elements within an ASP.NET file are treated as literal text and you cannot reference them in server-side code. To make these elements programmatically accessible, you can indicate that an HTML element should be treated as a server control by adding the &lt;strong&gt;runat="server"&lt;/strong&gt; attribute. You can also set the element's id attribute to give you way to programmatically reference the control. You then set attributes to declare property arguments and event bindings on server control instances. Sample controls are HtmlAnchor, HtmlButton, HtmlForm, HtmlLink etc.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;5. Explain ASP.NET State Management?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;States in ASP.Net is maintained at client and server sides.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Client-Based State Management Options&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;View state&lt;/strong&gt; : The web is stateless. But in ASP.NET, the state of a page is maintained in the page itself automatically. The values are encrypted and saved in hidden controls. This is done automatically by the ASP.NET. This can be switched off / on for a single control&lt;br /&gt;This is done using EnableViewState property for each control.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Control state&lt;/strong&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Hidden fields&lt;/strong&gt; ASP.NET allows you to store information in a HiddenField control, which renders as a standard HTML hidden field. A hidden field does not render visibly in the browser, but you can set its properties just as you can with a standard control.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;&lt;span style="color:#990000;"&gt;asp:hiddenfield&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;id&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ExampleHiddenField&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;value&lt;/span&gt;="&lt;span style="color:#000099;"&gt;Example Value&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;runat&lt;/span&gt;="&lt;span style="color:#000099;"&gt;server&lt;/span&gt;"/&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Cookies :&lt;/strong&gt; A cookie is a small amount of data that is stored either in a text file on the client file system or in-memory in the client browser session. It contains site-specific information that the server sends to the client along with page output. Cookies can be temporary (with specific expiration times and dates) or persistent. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To store Cookies &lt;/p&gt;&lt;p&gt;&lt;span style="color:#33cc00;"&gt;// Use this line when you want to save a cookie&lt;/span&gt; &lt;/p&gt;&lt;p&gt;Response.Cookies["&lt;span style="color:#990000;"&gt;MyCookieName&lt;/span&gt;"].Value = "&lt;span style="color:#990000;"&gt;MyCookieValue&lt;/span&gt;"; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#33cc00;"&gt;// How long will cookie exist on client hard disk&lt;/span&gt; &lt;/p&gt;&lt;p&gt;Response.Cookies["MyCookieName"].Expires = DateTime.Now.AddDays(1);&lt;/p&gt;&lt;p&gt;To get cookies&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;if&lt;/span&gt; (Request.Cookies["&lt;span style="color:#990000;"&gt;MyCookieName&lt;/span&gt;"] != null) &lt;/p&gt;&lt;p&gt;MyCookieValue = Request.Cookies["&lt;span style="color:#cc0000;"&gt;MyCookieName&lt;/span&gt;"].Value;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Query strings&lt;/strong&gt; A query string is information that is appended to the end of a page URL. A typical query string might look like the following example:&lt;br /&gt;&lt;a href="http://localhost/listwidgets.aspx?category=basic&amp;amp;price=100"&gt;http://localhost/listwidgets.aspx?category=basic&amp;amp;price=100&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Server-Based State Management Options&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Application state : &lt;/strong&gt;ASP.NET allows you to save values using application state — which is an instance of the HttpApplicationState class — for each active Web application. Application state is a global storage mechanism that is accessible from all pages in the Web application. Thus, application state is useful for storing information that needs to be maintained between server round trips and between requests for pages. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;Application["&lt;span style="color:#990000;"&gt;WelcomeMessage&lt;/span&gt;"] = "&lt;span style="color:#990000;"&gt;Welcome to test site&lt;/span&gt;.";&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Session state:&lt;/strong&gt; ASP.NET allows you to save values by using session state — which is an instance of the HttpSessionState class — for each active Web-application session.Session state is similar to application state, except that it is scoped to the current browser session.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Session["&lt;span style="color:#990000;"&gt;FirstName&lt;/span&gt;"] = FirstNameTxtBox.Text;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Profile Properties:&lt;/strong&gt; ASP.NET provides a feature called profile properties, which allows you to store user-specific data. This feature is similar to session state, except that the profile data is not lost when a user's session expires. To learn more, click &lt;a href="http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;6. What is smart navigation in .net?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;7. How do I create pages in ASP.Net for mobile devices?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;ASP.NET will automatically detect the type of browser making the request. This information is used by the page and by individual controls to render appropriate markup for that browser. You therefore do not need to use a special set of pages or controls for mobile devices. Whether you can design a single page to work with all types of browsers will depend on the page, on the browsers you want to target, and on your own goals.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;8.What is ASP.NET Application Life Cycle Overview?. Or What happens when a user request a page from the browser?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;User requests an application resource from the Web server.&lt;/strong&gt; The life cycle of an ASP.NET application starts with a request sent by a browser to the Web server (for ASP.NET applications, typically IIS). &lt;strong&gt;ASP.NET is an ISAPI extension under the Web server&lt;/strong&gt;. When a Web server receives a request, it examines the file-name extension of the requested file, determines which ISAPI extension should handle the request, and then passes the request to the appropriate ISAPI extension. ASP.NET handles file name extensions that have been mapped to it, such as .&lt;strong&gt;aspx, .ascx, .ashx, and .asmx&lt;/strong&gt;. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;ASP.NET receives the first request for the application&lt;/strong&gt;. When ASP.NET receives the first request for any resource in an application, a class named &lt;strong&gt;ApplicationManager&lt;/strong&gt; creates an application domain. Application domains provide isolation between applications for global variables and allow each application to be unloaded separately. Within an application domain, an instance of the class named HostingEnvironment is created, which provides access to information about the application such as the name of the folder where the application is stored.&lt;strong&gt;There will be only one application domain created for an application and all the clients use the same.&lt;/strong&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;ASP.NET core objects are created for each request. &lt;/strong&gt;After the application domain has been created and the HostingEnvironment object instantiated, ASP.NET creates and initializes core objects such as&lt;strong&gt; HttpContext, HttpRequest, and HttpResponse&lt;/strong&gt;. The HttpContext class contains objects that are specific to the current application request, such as the HttpRequest and HttpResponse objects.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;An HttpApplication object is assigned to the request.&lt;/strong&gt; After all core application objects have been initialized, the application is started by creating an instance of the &lt;strong&gt;HttpApplication class&lt;/strong&gt;. If the application has a &lt;strong&gt;Global.asax file&lt;/strong&gt;, ASP.NET instead creates an instance of the Global.asax class that is derived from the HttpApplication class and uses the derived class to represent the application. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;9. Explain ASP.NET Page Life Cycle Overview?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Page request: &lt;/strong&gt;The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Start: &lt;/strong&gt;In the start step, page properties such as &lt;strong&gt;Request and Response are set&lt;/strong&gt;. At this stage, the page also determines whether the request is a postback or a new request and sets the &lt;strong&gt;IsPostBack property&lt;/strong&gt;. Additionally, during the start step, the page's UICulture property is set.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Page initialization:&lt;/strong&gt; During page initialization, controls on the page are available and each control's UniqueID property is set. Any themes are also applied to the page. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Load:&lt;/strong&gt; During load, if the current request is a postback (First load is not a post back or response to any client action is a postback) control properties are loaded with information recovered from view state and control state.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Validation:&lt;/strong&gt; During validation, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.&lt;br /&gt;Postback event handling If the request is a postback, any event handlers are called.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Rendering:&lt;/strong&gt; Before rendering, view state is saved for the page and all controls. During the rendering phase, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Unload: &lt;/strong&gt;Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and any cleanup is performed.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;10. what is the difference between Themes and Cascading Style Sheets?&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Themes are similar to cascading style sheets in that both themes and style sheets define a set of common attributes that can be applied to any page. Themes can define many properties of a control or page, not just style properties. For example, using themes, you can specify the graphics for a TreeView control, the template layout of a GridView control, and so on.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Themes can include graphics. &lt;/li&gt;&lt;li&gt;Themes do not cascade the way style sheets do. By default, any property values defined in a theme referenced by a page's Theme property override the property values declaratively set on a control, unless you explicitly apply the theme using the StyleSheetTheme property. For more information, see the Theme Settings Precedence section above.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Only one theme can be applied to each page&lt;/strong&gt;. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;To apply a theme to a Web site.&lt;/p&gt;&lt;p&gt;In the application's Web.config file, set the Pages element to the name of the theme, either a global theme or a page theme, as shown in the following example: &lt;/p&gt;&lt;p&gt;&lt;&lt;span style="color:#990000;"&gt;pages&lt;/span&gt; &lt;span style="color:#ff6666;"&gt;theme&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ThemeName&lt;/span&gt;" /&gt; &lt;/configuration&gt;&lt;/configuration&gt;&lt;/p&gt;&lt;p&gt;To apply a theme to an individual pageSet the Theme or StyleSheetTheme attribute of the @ Page directive to the name of the theme to use, as shown in the following example:&lt;span style="color:#ff0000;"&gt;Theme&lt;/span&gt;="&lt;span style="color:#000099;"&gt;ThemeName"&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;11. What are the different types of Caching in ASP.Net?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The main difference between the Cache and Application objects is that the Cache object provides cache-specific features, &lt;strong&gt;such as dependencies and expiration policies&lt;/strong&gt;. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Different types of caching using cache object of ASP.NET&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Page Output Caching:&lt;/strong&gt; Page output caching adds the response of page to cache object. Later when page is requested page is displayed from cache rather than creating the page object and displaying it. &lt;strong&gt;Page output caching is good if the site is fairly static&lt;/strong&gt;.&lt;br /&gt;Page Output caching is easy to implement. By simply using the @OuputCache page directive, ASP.NET Web pages can take advantage of this powerful technique. The syntax looks like this:&lt;br /&gt;&lt;&lt;a href="mailto:%@OutputCache"&gt;%@&lt;span style="color:#990000;"&gt;OutputCache&lt;/span&gt;&lt;/a&gt; &lt;span style="color:#ff0000;"&gt;Duration&lt;/span&gt;="&lt;span style="color:#000099;"&gt;60&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;VaryByParam&lt;/span&gt;="&lt;span style="color:#000099;"&gt;none&lt;/span&gt;" %&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Page Fragment Caching:&lt;/strong&gt; If parts of the page are changing, you can wrap the static sections as user controls and cache the user controls using page fragment caching.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;12.What are the various modes of storing ASP.NET session?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;InProc:&lt;/strong&gt; In this mode Session state is stored in the memory space of the Aspnet_wp.exe process. This is the default setting. If the IIS reboots or web application restarts then session state is lost.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;StateServer:&lt;/strong&gt; In this mode Session state is serialized and stored in a separate process (&lt;strong&gt;Aspnet_state.exe&lt;/strong&gt;); therefore, the state can be stored on a separate computer (a state server).&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;SQL SERVER:&lt;/strong&gt; In this mode Session state is serialized and stored in a SQL Server database.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Session state can be specified in &lt;strong&gt;sessionState&lt;/strong&gt; element of application configuration file. Using State Server and SQL SERVER session state can be shared across web farms but note this comes at speed cost as ASP.NET needs to serialize and deserialize data over network again and again.&lt;br /&gt;Session_End event occurs only in “Inproc mode”. ”State Server” and “SQL SERVER” do not have Session_End event.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;13. What is the difference between Absolute and Sliding expiration in Cache?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Absolute Expiration&lt;/strong&gt; allows you to specify the duration of the cache, starting from the time the cache is activated. The following example shows that the cache has a cache dependency specified, as well as an expiration time of one minute.&lt;/p&gt;&lt;p&gt;Cache.Insert("&lt;span style="color:#990000;"&gt;key&lt;/span&gt;","&lt;span style="color:#cc0000;"&gt;value&lt;/span&gt;",dependencies,&lt;span style="color:#000099;"&gt;DateTime&lt;/span&gt;.Now.AddMinutes(1),&lt;span style="color:#000099;"&gt;null&lt;/span&gt;)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Sliding expiration:&lt;/strong&gt; The following code specifies that the cache will have a sliding duration of one minute. If a request is made 59 seconds after the cache is accessed, the validity of the cache would be reset to another minute:&lt;/p&gt;&lt;p&gt;Cache.Insert("&lt;span style="color:#990000;"&gt;key&lt;/span&gt;","&lt;span style="color:#990000;"&gt;value&lt;/span&gt;",dependencies,DateTime.Now.AddMinutes(1), TimeSpan.FromMinutes(1))&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;14. Compare Datagrid, Datalist and repeater?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A Datagrid, Datalist and Repeater are all ASP.NET data Web controls. They have many things in common like DataSource Property, DataBind Method ItemDataBound and ItemCreated&lt;br /&gt;Itemtemplate can be used for design. Datagrid has a in-built support for Sort, Filter and paging the Data, which is not possible when using a DataList and for a Repeater Control we would require to write an explicit code to do paging.&lt;strong&gt;Repeater is fastest followed by Datalist and finally datagrid.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;15. What are WebFarm and WebGarden Differences?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Web farms&lt;/strong&gt; are used to have some redundancy to minimize failures. It consists of two or more web server of the same configuration and they stream the same kind of contents. When any request comes there is switching / routing logic(&lt;strong&gt;Load Balancer&lt;/strong&gt;) which decides which web server from the farm handles the request. For instance we have two servers “Server1” and “Server2” which have the same configuration and content. So there is a special switch which stands in between these two servers and the users and routes the request accordingly.&lt;/p&gt;&lt;p&gt;The routing logic can be a number of different options:-&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Round-robin:&lt;/strong&gt; Each node gets a request sent to it “in turn”. So, server1 gets a request, then server2 again, then server1, then server2 again.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Least Active:&lt;/strong&gt; Whichever node show to have the lowest number of current connects gets new connects sent to it. This is good to help keep the load balanced between the server nodes&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fastest Reply:&lt;/strong&gt; Whichever node replies faster is the one that gets new requests. This is also a good option - especially if there are nodes that might not be “equal” in performance.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Web Garden:&lt;/strong&gt; All requests to IIS are routed to “aspnet_wp.exe” for IIS 5.0 and “w3wp.exe” for IIS 6.0. In normal case i.e. with out web garden we have one worker process instance (“aspnet_wp.exe” / “w3wp.exe”) across all requests. This one instance of worker process uses the CPU processor as directed by the operating system. But when we enable &lt;strong&gt;web garden for a web server it creates different instances of the worker process&lt;/strong&gt; and each of these worker process runs on different CPU. In short we can define a model in which multiple processes run on multiple CPUs in a single server machine are known as a Web garden. To configure Web Garden for asp.net application in web config &lt;/p&gt;&lt;p&gt;&lt;&lt;span style="color:#990000;"&gt;processModel&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;enable&lt;/span&gt; ="&lt;span style="color:#000099;"&gt;true&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;webGarden&lt;/span&gt;="&lt;span style="color:#000099;"&gt;true&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;cpuMask&lt;/span&gt;="&lt;span style="color:#000099;"&gt;12&lt;/span&gt;" /&gt; &lt;/p&gt;&lt;p&gt;cpuMask Specifies which processors on a multiprocessor server are eligible to run ASP.NET processes. For example, if you want to use the first two processors for ASP.NET of a four-processor computer, type 1100. then convert to binary to decimal.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-3972728385153294085?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/3972728385153294085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=3972728385153294085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/3972728385153294085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/3972728385153294085'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/05/frequently-asked-interview-questions-in.html' title='Frequently asked interview questions in ASP.Net'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-3476032018451840607</id><published>2009-04-30T08:35:00.000-07:00</published><updated>2009-04-30T09:44:48.160-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net Latest features'/><title type='text'>Creating sample Windows communication Foundation application using .net</title><content type='html'>&lt;p&gt;This article describes how to create and run a sample Windows Communication Foundation with .NET Framework 3.0 and above. This shows step-by-step in .net sample project to create a WCF Service and host the service in a console application.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;To develop a WCF application, we need&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;WCF Service library&lt;/strong&gt; which implements the Service using ServiceContract, OperationContract, DatatContract. This has the core logic of the service&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Service Host&lt;/strong&gt; using ServiceHost. The Service can be hosted in a Console application, Windows Service , IIS or Windows Process Activation Service (WAS)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Create a client&lt;/strong&gt; and consume the service&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Step by step to create sample WCF application and consume it&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1. Open Visual studio and Create a WCF service Library project as shown.&lt;/p&gt;&lt;p&gt;&lt;img alt="[WCF1.JPG]" src="http://2.bp.blogspot.com/_hu29p1S-YC4/SfnLU7bHiVI/AAAAAAAAADU/LzOuT1j-X6I/s1600/WCF1.JPG" border="0" /&gt;&lt;/p&gt;&lt;p&gt;2. Once the project is created, visual studio by default creates ServiceContract with name IService1, OperationContract and DataContract.&lt;/p&gt;&lt;p&gt;&lt;img alt="[WCF2.JPG]" src="http://3.bp.blogspot.com/_hu29p1S-YC4/SfnLXc7iDuI/AAAAAAAAADc/tQClO2N2A7s/s1600/WCF2.JPG" border="0" /&gt;&lt;/p&gt;&lt;p&gt;For sample purpose, we use the default contracts created by visual studio.&lt;/p&gt;&lt;p&gt;3. Implement the operation contract. This operation is used by the WCF clients to consume the service&lt;br /&gt;&lt;span style="color:#000099;"&gt;public class&lt;/span&gt; &lt;span style="color:#00cccc;"&gt;Service1&lt;/span&gt; : &lt;span style="color:#00cccc;"&gt;IService1&lt;/span&gt; { &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;public string&lt;/span&gt; GetData(&lt;span style="color:#000099;"&gt;int&lt;/span&gt; value) { &lt;/p&gt;&lt;p&gt;&lt;span style="color:#009900;"&gt;// Todo Custom code here&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;return string.&lt;/span&gt;Format("&lt;span style="color:#660000;"&gt;Sample WCF application. you have Entered {0}&lt;/span&gt;", value); &lt;/p&gt;&lt;p&gt;} &lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;4. Configure the endpoints,base address using app.config file as below&lt;/p&gt;&lt;img alt="[WCF3.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfnLaO1cu6I/AAAAAAAAADk/zoGhtX-qNLw/s1600/WCF3.JPG" border="0" /&gt;&lt;br /&gt;&lt;p&gt;5. create a new windows console application(WCFHostSample) to host the WCF Service (&lt;strong&gt;WcfServiceLibrarySample&lt;/strong&gt;) as shown below. &lt;p&gt;&lt;br /&gt;&lt;img alt="[WCF4.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfnLfW33mwI/AAAAAAAAADs/HUapHLCXaTE/s1600/WCF4.JPG" border="0" /&gt;&lt;/p&gt;Add the reference to the WcfServiceLibrarySample library as shwon below. &lt;p&gt;&lt;/p&gt;&lt;img alt="[WCF5.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfnLicmzJHI/AAAAAAAAAD0/os-1S3CT0aQ/s1600/WCF5.JPG" border="0" /&gt; &lt;p&gt;6. Include the following namesapce in &lt;strong&gt;WCF host sample&lt;/strong&gt; and add the code in console application for hosting the service&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;using&lt;/span&gt; System.ServiceModel;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;using&lt;/span&gt; System.ServiceModel.Description;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;static void&lt;/span&gt; Main(string[] args)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;// This is to host the WcfServiceLibrarySample&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;ServiceHost&lt;/span&gt; servicehost = &lt;span style="color:#000099;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;ServiceHost&lt;/span&gt;(typeof(WcfServiceLibrarySample.&lt;span style="color:#339999;"&gt;Service1&lt;/span&gt;));&lt;br /&gt;servicehost.Open();&lt;br /&gt;&lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.WriteLine("&lt;span style="color:#660000;"&gt;Service started.....Press &lt;enter&gt;to terminate service.&lt;/span&gt;");&lt;br /&gt;&lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;servicehost.Close();&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Note :&lt;/u&gt;&lt;/strong&gt; create an app.config for this host console application(WCFHostSample). Copy and paste the app.config (with end points and behavior nodes) created from service library to console application since the service library is loaded from this console application and uses the configuration of host console application.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Alternate way to host the WCF service  without configuration file(app.config) and using ServiceMetadataBehavior as descibed below&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;static void&lt;/span&gt; Main(string[] args)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#339999;"&gt;ServiceHost&lt;/span&gt; servicehost = &lt;span style="color:#000099;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;ServiceHost&lt;/span&gt;(&lt;span style="color:#000099;"&gt;typeof&lt;/span&gt;(WcfServiceLibrarySample.&lt;span style="color:#339999;"&gt;Service1&lt;/span&gt;));&lt;br /&gt;&lt;span style="color:#009900;"&gt;//// A channel to describe the service.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;ServiceMetadataBehavior&lt;/span&gt; metadataBehavior;&lt;br /&gt;metadataBehavior = servicehost.Description.Behaviors.Find ServiceMetadataBehavior &lt;servicemetadatabehavior&gt;&lt;servicemetadatabehavior&gt;();&lt;br /&gt;&lt;span style="color:#000099;"&gt;if&lt;/span&gt; (metadataBehavior == null)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;// This is how I create the proxy object add behavior to the service&lt;/span&gt;&lt;br /&gt;metadataBehavior = &lt;span style="color:#000099;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;ServiceMetadataBehavior&lt;/span&gt;(); &lt;/p&gt;&lt;p&gt;&lt;span style="color:#009900;"&gt;// configure url&lt;/span&gt;&lt;br /&gt;metadataBehavior.HttpGetUrl = &lt;span style="color:#000099;"&gt;new&lt;/span&gt; &lt;span style="color:#339999;"&gt;Uri&lt;/span&gt;("&lt;br /&gt;&lt;a href="http://localhost:8731/WcfServiceLibrarySample/SampleApp"&gt;&lt;span style="color:#660000;"&gt;http://localhost:8731/WcfServiceLibrarySample/SampleApp&lt;/span&gt;&lt;/a&gt;");&lt;br /&gt;metadataBehavior.HttpGetEnabled = &lt;span style="color:#000099;"&gt;true&lt;/span&gt;;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#009900;"&gt;// add behviour to the host&lt;/span&gt;&lt;br /&gt;servicehost.Description.Behaviors.Add(metadataBehavior);&lt;br /&gt;}&lt;br /&gt;servicehost.Open();&lt;br /&gt;&lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.WriteLine("Press &lt;enter&gt;to terminate service.");&lt;br /&gt;&lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;servicehost.Close();&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;7. Start the WCF host console application as shown in the below. This should be running to consume the service from an client. &lt;/p&gt;&lt;p&gt;&lt;img alt="[WCF5a.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfnLlaePdfI/AAAAAAAAAD8/afJ7Iaq6xXM/s1600/WCF5a.JPG" border="0" /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Note: &lt;/u&gt;&lt;/strong&gt;Once the Service host is closed, then WCF service cannot be consumed from client&lt;/p&gt;&lt;br /&gt;&lt;p&gt;8. Create a windows console application (WCFClientSample) for consuming the WCF service hosted using the endpoint.&lt;/p&gt;&lt;br /&gt;&lt;img alt="[WCF6.JPG]" src="http://1.bp.blogspot.com/_hu29p1S-YC4/SfnLo1LuFSI/AAAAAAAAAEE/CgKBwgv8zR8/s1600/WCF6.JPG" border="0" /&gt; &lt;p&gt;9. Add Service reference using the url configured in the application configuration file and name the reference( as WCFSampleRef) as shown below.&lt;/p&gt;&lt;img alt="[WCF7.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfnLwKTUt0I/AAAAAAAAAEU/moQGrlLwlFs/s1600/WCF7.JPG" border="0" /&gt;&lt;br /&gt;&lt;p&gt;10. Then write the following code in WCF client project to consume the WCF service operations&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000099;"&gt;static void&lt;/span&gt; Main(string[] args)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;// create intstance of the WCF proxy&lt;/span&gt;&lt;br /&gt;WCFSampleRef.&lt;span style="color:#339999;"&gt;Service1Client&lt;/span&gt; serviceproxy = new WCFClientSample.WCFSampleRef.&lt;span style="color:#339999;"&gt;Service1Client&lt;/span&gt;();&lt;br /&gt;&lt;span style="color:#009900;"&gt;// CAll the Service GetData Method&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#339999;"&gt;Console&lt;/span&gt;.WriteLine(serviceproxy.GetData(100).ToString());&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;11. Then run the client and it get the following output&lt;/p&gt;&lt;img alt="[WCF8.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfnLzH9E8gI/AAAAAAAAAEc/ZmYt1GqWoRM/s1600/WCF8.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-3476032018451840607?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/3476032018451840607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=3476032018451840607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/3476032018451840607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/3476032018451840607'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/creating-sample-windows-communication.html' title='Creating sample Windows communication Foundation application using .net'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_hu29p1S-YC4/SfnLU7bHiVI/AAAAAAAAADU/LzOuT1j-X6I/s72-c/WCF1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-9084904870301956334</id><published>2009-04-28T16:06:00.000-07:00</published><updated>2009-04-28T16:19:47.681-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Table Valued Parameters in SQL Server 2008</title><content type='html'>This is a new feature in SQL Server 2008.&lt;br /&gt;&lt;br /&gt;Table-valued parameters are a new parameter type in SQL Server 2008. Table-valued parameters are declared by using &lt;strong&gt;user-defined table types&lt;/strong&gt;. You can use table-valued parameters to send multiple rows of data to a Transact-SQL statement or a routine, such as a stored procedure or function, without creating a temporary table or many parameters.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Normal approach without Table valued parameters&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; AdventureWorks&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE PROCEDURE&lt;/span&gt; AddEmp(@EmpID int,@EmpName&lt;br /&gt;nvarchar(100),@EmpEmail nvarchar(100))&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;As&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;BEGIN&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; dbo.Employee&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;values&lt;/span&gt;(@EmpID, @EmpName, @EmpEmail)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To execute the stored procedure&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;execute&lt;/span&gt; AddEmp 1,'Name1',Name1@xxx.com'&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;execute&lt;/span&gt; AddEmp 2,Name2,Name2@xxx.com'&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Drawbacks of this solution:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Multiple round trips to the server which decreases the performance&lt;/li&gt;&lt;li&gt;Stored procedure needs to be executed multiple times&lt;/li&gt;&lt;li&gt;Inefficient code&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Approach with Table valued parameters&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Create Type for the table valued parameter&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE TYPE&lt;/span&gt; EmployeeTableType &lt;span style="color:#3333ff;"&gt;AS TABLE&lt;/span&gt;&lt;br /&gt;(EmpID INT, EmpName nvarchar(100), EmpEmail nvarchar(100))&lt;br /&gt;&lt;br /&gt;Create procedure with the newly created type&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;CREATE PROCEDURE&lt;/span&gt; AddEmp(@EmployeeDetails&lt;br /&gt;EmployeeTableType READONLY)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;As&lt;br /&gt;BEGIN&lt;br /&gt;INSERT INTO&lt;/span&gt; dbo.Employee&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT * FROM&lt;/span&gt; @EmployeeDetails&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Execute the procedure and insert the values into the newly created type&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;DECLARE&lt;/span&gt; @NewEmployees EmployeeTableType&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; @NewEmployees&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(1,'Name1',Name1@xxx.com')&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; @NewEmployees&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(2,,'Name2',Name2@xxx.com')&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EXECUTE&lt;/span&gt; AddEmp @NewEmployees&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Advantages of using Table Valued parameter&lt;/strong&gt;&lt;br /&gt;Table-valued parameters offer more flexibility and in some cases better performance&lt;br /&gt;than temporary tables or other ways to pass a list of parameters. Table-valued&lt;br /&gt;parameters offer the following benefits: &lt;/p&gt;&lt;ul&gt;&lt;li&gt; Have a well defined scope at the end of which they are automatically cleared. &lt;/li&gt;&lt;li&gt;Do not acquire locks for the initial population of data from a client. &lt;/li&gt;&lt;li&gt;Do not cause a statement to recompile.&lt;/li&gt;&lt;li&gt; Provide a simple programming model.&lt;/li&gt;&lt;li&gt; Enable you to include complex business logic in a single routine.&lt;/li&gt;&lt;li&gt; Reduce round trips to the server. &lt;/li&gt;&lt;li&gt;Can have a table structure of different cardinality. &lt;/li&gt;&lt;li&gt;Are strongly typed.&lt;/li&gt;&lt;li&gt; Enable the client to specify sort order and unique keys.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-9084904870301956334?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/9084904870301956334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=9084904870301956334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/9084904870301956334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/9084904870301956334'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/table-valued-parameters-in-sql-server.html' title='Table Valued Parameters in SQL Server 2008'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-1427185151686326288</id><published>2009-04-28T13:38:00.000-07:00</published><updated>2009-04-28T15:16:27.819-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server 2005 - Tips for Optimizing SQL Server Query Performance</title><content type='html'>The following are some tips to improve the performance of SQL Server queries.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;1. Turn on the execution plan, and statistics. Then analyse the query performance&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;The first step is to use the tools that help you determine whether a query done one way is better than another. By comparing the original query to a new query that we come up with is the best way to evaluate the benefits of any changes.&lt;br /&gt;&lt;br /&gt;To do this, go into SQL Server Management Studio and select the Query menu. Select the “Include Actual Execution Plan.”&lt;br /&gt;&lt;br /&gt;&lt;img alt="[SqlServer1.JPG]" src="http://3.bp.blogspot.com/_hu29p1S-YC4/SfdqMPLdIeI/AAAAAAAAADE/zm-eQER_qoE/s1600/SqlServer1.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;Next, turn on statistics. Type the following statement:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;SET STATISTICS&lt;/span&gt; IO ON;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To counteract the above two you should also compare the actual execution times. To do this, execute the following statement:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;SET STATISTICS&lt;/span&gt; TIME ON;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;After running a simple query, analyze the query execution plan for optimizing the query as below.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img alt="[sqlserver2.JPG]" src="http://3.bp.blogspot.com/_hu29p1S-YC4/SfdqOi4_i7I/AAAAAAAAADM/9fiXaQpS5zI/s1600/sqlserver2.JPG" border="0" /&gt; &lt;/p&gt;&lt;p&gt;After getting the execution plan, do the following&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Analyzing Execution Plans&lt;/li&gt;&lt;li&gt;Estimated Cost of Execution&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;2. Use Clustered Indexes in appropriate columns&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Having the clustered index on the primary key is sometimes not the most efficient place for the clustered index to be. A clustered index is the most per formant type of index.&lt;br /&gt;The scenario is&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Generally, the whole table is sorted according to the clustered index which is created by default while creating Primary key.&lt;/li&gt;&lt;li&gt;If the table is involved in lots of joins based on the primary key, it is probably the right place for it to be.&lt;/li&gt;&lt;li&gt;But in some cases that you are continually filtering or grouping on other columns in a table, then you should possibly consider changing the primary key index to Non-Clustered, and putting the clustered index on those filtered or grouped columns.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;In such cases, drop the clustered index from PK and create new clustered index for other column.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ALTER TABLE&lt;/span&gt; testtable&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;DROP CONSTRAINT&lt;/span&gt; PK_testtable&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ALTER TABLE&lt;/span&gt; testtable&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ADD CONSTRAINT&lt;/span&gt; PK_testtable&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;PRIMARY KEY&lt;/span&gt; NONCLUSTERED (testcolumn);&lt;br /&gt;&lt;br /&gt;Then the following statement adds a new clustered index to a table for the required column other than primary key where it involved lot of joins.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE CLUSTERED INDEX&lt;/span&gt; MyClusteredIndex&lt;br /&gt;ON testtable (testcolumnID)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;3. Use Indexed views&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Indexed Views have been around for a while for improving the performance using &lt;strong&gt;SCHEMABINDING&lt;/strong&gt; option and create index on the views.&lt;br /&gt;Imagine that you have created a view without SCHEMABINDING option and you have altered the schema of underlying table (deleted one column). Next time when you run your view, it will fail. Here is when SCHEMABINDING comes into picture. Creating a view with SCHEMABINDING option locks the underlying tables and prevents any changes that may change the table schema.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE VIEW&lt;/span&gt; testview&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;WITH&lt;/span&gt; SCHEMABINDING&lt;br /&gt;AS&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; testcolumn1, testcolumn2,&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; testtable a INNER JOIN testtable2 b&lt;br /&gt;ON (a.column1 = b.column1)&lt;br /&gt;&lt;br /&gt;Note the use of the schema binding attribute. This prevents you from changing underlying tables while this view exists, and is necessary if you want to add an index.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE UNIQUE CLUSTERED INDEX&lt;/span&gt; Idxtestview&lt;br /&gt;ON testview (&lt;br /&gt;testcolumn1, testcolumn2&lt;br /&gt;)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;4. Use Covering Indexes&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Covering indexes are a feature that was newly added to SQL 2005. Basically, you can create an index optimized for the query itself based on joins, filters and grouping, and then add additional columns that can be retrieved directly from the index for use in select statements, as follows:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;CREATE NONCLUSTERED INDEX&lt;/span&gt; TestIndex &lt;span style="color:#3333ff;"&gt;ON&lt;/span&gt; salestable (OrderId)INCLUDE (Quantity, UnitPrice)&lt;/p&gt;&lt;p&gt;If queries are executed on the OrderId column, the index will be used, and if the only other columns being retrieved are Quantity and UnitPrice, then the query optimizer doesn’t need to retrieve any extra columns from the underlying table. It can just use the index. Because the query optimizer doesn’t need to query the original table, performance is improved.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;5. Keep your clustered index small in the table&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;One thing you need to consider when determining where to put your clustered index is how big the key for that index will be. So if you have a large clustered index on a table with a decent number of rows, the size could blow out significantly. In the case where there is no clustered index on a table, this could be just as bad, because it will use the row pointer, which is 8 bytes per row.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;6. Avoid cursors&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Cursors are less performant because every FETCH statement executed is equivalent to another SELECT statement execution that returns a single row. The optimizer can’t optimize a CURSOR statement, instead optimizing the queries within each execution of the cursor loop, which is undesirable. Given that most CURSOR statements can be re-written using set logic, they should generally be avoided.&lt;br /&gt;Each time when the FECTH is executed, it &lt;strong&gt;causes a roundtrip to the server&lt;/strong&gt; and hence performance is degraded.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;7. Archive old data&lt;/span&gt; using Replication or Backup &lt;/strong&gt;&lt;br /&gt;If you want to improve query performance, give the optimizer less work to do. If you can cut down the number of rows the query has deal with, then performance will improve.&lt;/p&gt;&lt;p&gt;This can be done in the following ways&lt;/p&gt;&lt;ul&gt;&lt;li&gt;One can also create &lt;strong&gt;audit triggers&lt;/strong&gt; to move historical data into other tables for this reason.&lt;/li&gt;&lt;li&gt;Don’t need your data after a certain period of time, &lt;strong&gt;back up your database&lt;/strong&gt; and remove the data.&lt;/li&gt;&lt;li&gt;Also we can use &lt;strong&gt;SQL Server Replication&lt;/strong&gt; technique to back up the data&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;8. Partition your data correctly&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;These days, you don’t actually have to move old data out of a table to improve query performance. You can partition your table into a number of data segments based on a partition function. The query optimizer can use the partition function to look at rows only on the most appropriate file group. To create partitions, you need a partition function and a partition scheme.&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;CREATE PARTITION FUNCTION&lt;/span&gt; TestPartitionFunction (int) AS RANGE RIGHT FOR VALUES (1, 100, 1000)&lt;/p&gt;&lt;p&gt;Once the partition function is created, you can then apply the function to a partition scheme for a table.&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE PARTITION SCHEME&lt;/span&gt; TestPartitionSchemeAS &lt;span style="color:#3333ff;"&gt;PARTITION&lt;/span&gt; TestPartitionFunctionTO (filegrp1, filegrp2, filegrp3, filegrp4)&lt;/p&gt;&lt;p&gt;Then it’s just a matter of creating the table to use the partition scheme on the column you decided to partition on:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE TABLE&lt;/span&gt; myPartitionTable ( Col1 int, Col2 varchar (100))ON TestPartitionScheme (col1)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;9. Remove user-defined inline scalar functions&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Inline scalar functions are convenient if you want to return a single value, but at the expense of performance. They look somewhat like stored procedures, and they can be used in SQL statements. The problem is that they are not expanded and therefore not optimized into the query plan by the query optimizer. Queries like this may appear to be performant in the Execution plans and also in the IO statistics, but when you run the query, it can perform really badly. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE FUNCTION&lt;/span&gt; dbo.fnGetPostalCode ( @Suburb varchar (100), @State varchar (10)) &lt;span style="color:#3333ff;"&gt;RETURNS&lt;/span&gt; int AS &lt;span style="color:#3333ff;"&gt;BEGIN&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;RETURN&lt;/span&gt; ISNULL (( SELECT Postal Code FROM dbo.PostalCode WHERE Suburb = @Suburb AND State = @State ), -1);&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;END&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The following statement will only perform a clustered index scan, not a seek, and on a big table this could seriously affect performance. &lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; s.SalesPersonID, s.SuburbName, s.State, dbo.&lt;span style="color:#3333ff;"&gt;fnGetPostalCode&lt;/span&gt; (s.SuburbName, s.State) AS PostalCode &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; dbo.SalesPerson&lt;/p&gt;&lt;p&gt;You can have a look at the details by clicking on SQL Server Management Studio’s Query menu, and selecting “Include Actual Execution Plan”&lt;br /&gt;&lt;strong&gt;One way to get around this is to simply inline the underlying queries from the function&lt;/strong&gt;, as follows:&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; s.SalesPersonID, s.SuburbName, s.State, ISNULL ((&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; PostalCode &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; dbo.PostalCode &lt;span style="color:#3333ff;"&gt;WHERE&lt;/span&gt; Suburb = s.SuburbName AND State = s.State), -1) AS PostalCode &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; dbo.SalesPerson&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Inline the SQL statement will perform significantly better than the inline &lt;/strong&gt;&lt;strong&gt;function.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;10. Use APPLY in SQL queries&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;The apply statement was created for the situation where you put multiple inline nested queries in the one statement. For example, take the following statement:&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; soh.SalesOrderID, Quantity= (&lt;span style="color:#3333ff;"&gt;SELECT TOP&lt;/span&gt; 1 (Quantity) &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; SalesOrderDetails &lt;span style="color:#3333ff;"&gt;WHERE&lt;/span&gt; SalesOrderID = a.SalesOrderID), UnitPrice= (&lt;span style="color:#3333ff;"&gt;SELECT TOP&lt;/span&gt; 1 (UnitPrice) &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; SalesOrderDetails &lt;span style="color:#3333ff;"&gt;WHERE&lt;/span&gt; SalesOrderID = a.SalesOrderID)&lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; SalesOrderHeader a&lt;/p&gt;&lt;p&gt;This performs an extra query, retrieving data from another table using the same criterion. This can now be replaced with the following:&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; b.SalesOrderID, b.OrderDate, a.* &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; SalesOrderHeader b &lt;span style="color:#3333ff;"&gt;&lt;strong&gt;CROSS APPLY&lt;/strong&gt;&lt;/span&gt; ( &lt;span style="color:#3333ff;"&gt;SELECT TOP&lt;/span&gt; (1) c.UnitPrice as UnitPrice, c.Quantity as Quantity &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; SalesOrderDetail c &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; c.SalesOrderId = b.SalesOrderId &lt;span style="color:#3333ff;"&gt;ORDER BY&lt;/span&gt; c.Quantity &lt;span style="color:#3333ff;"&gt;DESC&lt;/span&gt;) as a&lt;/p&gt;&lt;p&gt;&lt;strong&gt;a.*&lt;/strong&gt; mentioned in the above query returns Quantity and UnitPrice. We can also refer as a. UnitPrice and a.Quantity.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;11. Use computed columns&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Computed columns are derived from other columns in a table. By creating and indexing a computed column, you can turn what would otherwise be a scan into a seek.&lt;br /&gt;For example, if you needed to calculate SalesPrice and you had a Quantity and UnitPrice column, multiplying them in the SQL inline would cause a table scan as it multiplied the two columns together for every single row. Create a computed column called SalesPrice, then index it and the query optimizer will no longer need to retrieve the UnitPrice and Quantity data and do a calculation.&lt;br /&gt;Creating computed column syntax&lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;CREATE TABLE&lt;/span&gt; sales (SALESORDERID &lt;span style="color:#3333ff;"&gt;int&lt;/span&gt;, UNITPRICE &lt;span style="color:#3333ff;"&gt;int&lt;/span&gt;, QUANTITY &lt;span style="color:#3333ff;"&gt;int&lt;/span&gt;, SALESPRICE as (UNITPRICE * QUANTITY)) &lt;/p&gt;&lt;p&gt;where &lt;strong&gt;SALESPRICE is a computed column&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Inserting the values into other columns automatically inserts value in SALESPRICE which is a computed column.&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; sales (SALESORDERID, UNITPRICE, QUANTITY) VALUES (1, 100, 2) &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;12. Use the correct transaction isolation level&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If there are a lot of rows in your table, multiple concurrent requests to that table could cause contention if the correct transaction isolation level is not set. If requests are repeatedly blocked, it could be time to consider whether to change.&lt;br /&gt;&lt;br /&gt;For example, READ UNCOMMITED is equivalent to dirty reads, or NOLOCK. That is, if a transaction is in the middle of processing and you read a row, the data may not be valid, especially if multiple inserts/updates are occurring that require atomicity. This is the most per formant and it ignores locking altogether, but is generally not allowed by good design and is a special case.&lt;br /&gt;&lt;br /&gt;With READ_COMMITTED_SNAPSHOT, it specifies that any data read by the transaction will be the transitionally consistent version of the data that existed at the start of the transaction. Internally, it makes a versioned copy of the data and this is placed in tempdb until the transaction has competed. Except when the database is being recovered, snapshot transactions do not request locks when reading data, and therefore do not block other transactions from writing data. Transactions writing data also do not block other transactions reading data.&lt;br /&gt;&lt;br /&gt;There are various other types of transaction options, including REPEATABLE_READ and SERIALIZABLE amongst others that you can look at to determine whether they are appropriate for your needs.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Microsoft suggested some check list for SQL Server performance is available &lt;a href="http://msdn.microsoft.com/en-us/library/ms979169.aspx"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-1427185151686326288?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/1427185151686326288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=1427185151686326288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/1427185151686326288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/1427185151686326288'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/sql-server-2005-tips-for-optimizing-sql.html' title='SQL Server 2005 - Tips for Optimizing SQL Server Query Performance'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_hu29p1S-YC4/SfdqMPLdIeI/AAAAAAAAADE/zm-eQER_qoE/s72-c/SqlServer1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-1379520946956278880</id><published>2009-04-28T10:24:00.000-07:00</published><updated>2009-04-28T11:05:24.643-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FAQs'/><title type='text'>.Net framework Frequently asked interview questions</title><content type='html'>Frequently asked interview questions with answers are explained below. This helps to understand about .net framework basics&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;1. Difference between Mutable and immutable objects&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;An object qualifies as being called &lt;strong&gt;immutable if its value cannot be modified once it has been created&lt;/strong&gt;. For example, methods that appear to modify a String actually return a new String containing the modification. Developers are modifying strings all the time in their code. This may appear to the developer as mutable - but it is not. What actually happens is your string variable/object has been changed to reference a new string value containing the results of your new string value. For this very reason .NET has the System.Text.StringBuilder class. If you find it necessary to modify the actual contents of a string-like object heavily, such as in a for or foreach loop, use the System.Text.StringBuilder class System.String is immutable.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;System.StringBuilder was designed with the purpose of having a mutable string&lt;/strong&gt; where a variety of operations can be performed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;2. Difference between interface and abstract class&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete.&lt;br /&gt;In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;3. Difference between Struct and a Class&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;4. Debug class and Trace class difference?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;5. assert() method in Debug and Trace class&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the &lt;strong&gt;condition is false&lt;/strong&gt;. The program proceeds without any interruption if the condition is true.&lt;br /&gt;For Release mode, need to use&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Trace.&lt;span style="color:#000000;"&gt;Assert&lt;/span&gt;(false, "&lt;span style="color:#990000;"&gt;Message to be displayed&lt;/span&gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;6. How to call Win32 API from a .NET Framework program?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Yes. Using &lt;strong&gt;platform invoke&lt;/strong&gt;, .NET Framework programs can access native code libraries by means of static DLL entry points.&lt;br /&gt;&lt;br /&gt;Here is an example of C# calling the Win32 MessageBox function:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;class&lt;/span&gt; MainApp {&lt;br /&gt;[&lt;span style="color:#00cccc;"&gt;DllImport&lt;/span&gt;("&lt;span style="color:#990000;"&gt;user32.dll&lt;/span&gt;", EntryPoint="MessageBox")]&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;public static extern&lt;/span&gt; int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);&lt;br /&gt;&lt;span style="color:#000099;"&gt;public static void&lt;/span&gt; Main() {&lt;br /&gt;MessageBox( 0, "Hello, this is PInvoke in operation!", ".NET", 0 );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;7. Difference between Early Binding and late binding&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Early binding occurs at &lt;strong&gt;compile time&lt;/strong&gt; where as late binding occurs at &lt;strong&gt;Run-time&lt;/strong&gt;.&lt;br /&gt;With early binding, Visual Basic .NET uses type information that is available about the Office application in question to bind directly to the methods or properties that it needs to use.&lt;br /&gt;&lt;br /&gt;This occurs at compile time&lt;br /&gt;objApp = New &lt;span style="color:#3333ff;"&gt;Excel&lt;/span&gt;.Application()&lt;br /&gt;&lt;br /&gt;In contrast to early binding, late binding waits until run time to bind property and method calls to their objects.&lt;br /&gt;&lt;br /&gt;This occurs at run time and .&lt;strong&gt;net reflection is used to invoke the objects&lt;/strong&gt; and methods dynamically&lt;br /&gt;objApp = CreateObject("&lt;span style="color:#990000;"&gt;Excel.Application&lt;/span&gt;")&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;8. supportedruntime Element in .net framework&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Specifies which versions of the common language runtime the application supports. This element should be used by all applications built with version 1.1 or later of the .NET Framework. This should be specified in exe.config or web config file&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;img alt="[Config1.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SfdDH2UrHKI/AAAAAAAAAC8/Y8hYRVlKFXI/s1600/Config1.JPG" border="0" /&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;9. Delay Signing in .Net&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;During development process you will need strong name keys to be exposed to developer which is not a good practice from security aspect point of view. In such situations you can assign the key later on and during development you can use delay signing&lt;/p&gt;&lt;p&gt;[assembly:&lt;span style="color:#3333ff;"&gt;AssemblyKeyFileAttribute&lt;/span&gt;("myKey.snk")]&lt;/p&gt;&lt;p&gt;[assembly:&lt;span style="color:#3333ff;"&gt;AssemblyDelaySignAttribute&lt;/span&gt;(true)]&lt;/p&gt;&lt;p&gt;The compiler inserts the public key into the assembly manifest and reserves space in the PE file for the full strong name signature. The real public key must be stored while the assembly is built so that other assemblies that reference this assembly can obtain the key to store in their own assembly reference.&lt;/p&gt;&lt;p&gt;Because the assembly does not have a valid strong name signature, the verification ofthat signature must be turned off. You can do this by using the –Vr option with theStrong Name tool. The following example turns off verification for an assembly calledmyAssembly.dll.&lt;br /&gt;&lt;strong&gt;Sn –Vr myAssembly.dll&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Just before shipping, you submit the assembly to your organization's signing authorityfor the actual strong name signing using the –R option with the Strong Name tool.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Sn -R myAssembly.dll sgKey.snk&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The above example signs an assembly called myAssembly.dll with a strong nameusing the sgKey.snk key pair.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;10. Native Image Generator (Ngen.exe)&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;The Native Image Generator utility (Ngen.exe) allows you to run the JIT compiler on your assembly's MSIL and generate native machine code which is cached to disk. After the image is created .NET runtime will use the image to run the code rather than from the hard disk. Running Ngen.exe on an assembly potentially allows the assembly to load and execute faster.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ngen.exe install assemblyname.dll&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-1379520946956278880?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/1379520946956278880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=1379520946956278880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/1379520946956278880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/1379520946956278880'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/net-framework-frequently-asked.html' title='.Net framework Frequently asked interview questions'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_hu29p1S-YC4/SfdDH2UrHKI/AAAAAAAAAC8/Y8hYRVlKFXI/s72-c/Config1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-3732507618455906961</id><published>2009-04-17T09:34:00.001-07:00</published><updated>2009-04-18T09:25:18.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net Latest features'/><title type='text'>Creating Sequential Workflow Example with Windows Workflow Foundation (WWF)</title><content type='html'>This article describes how to create and run a Console Sequential Workflow in Windows Workflow Foundation with .NET Framework 3.0 and above. This shows the .net sample project to create sequential workflow step by step.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Pre-Requsities&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;.NET Framework 3.5 Framework&lt;/li&gt;&lt;li&gt;Visual Studio Team system 2008&lt;br /&gt;or &lt;/li&gt;&lt;li&gt;.NET Framework 3.0 Framework&lt;/li&gt;&lt;li&gt;Visual Studio 2005 Professional Edition &lt;/li&gt;&lt;li&gt;Windows Workflow Foundation extensions for Visual Studio 2005 &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Steps for creating a sample workflow project&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;1. Open Visual studio and Create a Sequential Workflow ConsoleApplication project as shown.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;img alt="[WFImage1.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/Sei9PDKxVlI/AAAAAAAAACE/8jlBRQsQzLs/s1600/WFImage1.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;2. After creating the application, your designer window should look like this&lt;br /&gt;&lt;br /&gt;&lt;img alt="[WFImage2.JPG]" src="http://3.bp.blogspot.com/_hu29p1S-YC4/SejAI6X9leI/AAAAAAAAACU/seYnh6LDgsA/s1600/WFImage2.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;3. From the ToolBox of the visual studio, add the &lt;strong&gt;code activity&lt;/strong&gt; as shown in the below.&lt;br /&gt;&lt;br /&gt;&lt;img alt="[WFImage3.JPG]" src="http://1.bp.blogspot.com/_hu29p1S-YC4/SejAMowU92I/AAAAAAAAACc/ED8R1W6JUnI/s1600/WFImage3.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;4. After code activity is added, Double click on the code activity. This creates &lt;strong&gt;codeActivity1_ExecuteCode&lt;/strong&gt; method.&lt;br /&gt;&lt;br /&gt;5. Add the code snippet as below&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Initilize global variables&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div  BGCOLOR="#C0C0C0"&gt; &lt;br /&gt;&lt;span style="color:#000099;"&gt;public sealed partial class&lt;/span&gt; &lt;span style="color:#00cccc;"&gt;Workflow1&lt;/span&gt;: &lt;span style="color:#3333ff;"&gt;&lt;span style="color:#000099;"&gt;SequentialWorkflowActivity&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;&lt;span style="color:#33cc00;"&gt;// Global Variables and used by activities&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;private int&lt;/span&gt; inputval = 0;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;private string&lt;/span&gt; status = string.Empty;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Add the following code for code activity&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;private void&lt;/span&gt; codeActivity1_ExecuteCode(&lt;span style="color:#3333ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#00cccc;"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;// Get the input from the user&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine("Enter a number");&lt;br /&gt;&lt;span style="color:#009900;"&gt;// store the input in the global variable&lt;/span&gt;&lt;br /&gt;inputval = int.Parse(&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.ReadLine().ToString());&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine("Workflow started....");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;6. Go back to design view and click &lt;strong&gt;ifElseBranchActivity1&lt;/strong&gt; to add to the workflow. the properties window, you will see the Condition row. Click it and select Declarative Rule Condition. Now, expand the row and set Condition Name. Then add new Rule and then add the condition code for &lt;strong&gt;if loop&lt;/strong&gt; like this.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Note:&lt;/u&gt; inputval is a global variable for the class&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="color:#3333ff;"&gt;this&lt;/span&gt;.inputval &lt;100&lt;br /&gt;&lt;span style="color:#000000;"&gt;Do the same for &lt;strong&gt;else branch&lt;/strong&gt; also with the condition&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;this&lt;/span&gt;.inputval &gt; 100&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;7. After the condition is added for &lt;strong&gt;ifelseActivity&lt;/strong&gt; , the designer will look like this&lt;br /&gt;&lt;br /&gt;&lt;img alt="[Wfimage4.JPG]" src="http://1.bp.blogspot.com/_hu29p1S-YC4/SejAQABq8UI/AAAAAAAAACk/5G_OpJAQnLs/s1600/Wfimage4.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;p&gt;9. Also add &lt;strong&gt;codeActivity3&lt;/strong&gt; and &lt;strong&gt;codeActivity4&lt;/strong&gt; in the if else loop to get the status. The final work flow diagram looks like this&lt;/p&gt;&lt;br /&gt;&lt;img alt="[WFImage5.JPG]" src="http://4.bp.blogspot.com/_hu29p1S-YC4/SejASw36pEI/AAAAAAAAACs/uxvaWQgFlMA/s1600/WFImage5.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10. Add the code for all the code activities&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;private void&lt;/span&gt; codeActivity2_ExecuteCode(&lt;span style="color:#3333ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#00cccc;"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;// status is the global variable&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine(status);&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine("&lt;span style="color:#cc0000;"&gt;Workflow completed...");&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;private void&lt;/span&gt; codeActivity3_ExecuteCode(&lt;span style="color:#3333ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#00cccc;"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#009900;"&gt;// set the global variable ... Also do custom code if any&lt;/span&gt;&lt;br /&gt;status = "&lt;span style="color:#cc0000;"&gt;If Activity Executed....&lt;/span&gt;";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;private void&lt;/span&gt; codeActivity4_ExecuteCode(&lt;span style="color:#3333ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#00cccc;"&gt;EventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#33cc00;"&gt;// set the global variable ... Also do custom code if any&lt;/span&gt;&lt;br /&gt;status = "&lt;span style="color:#cc0000;"&gt;Else Activity Executed....";&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;11. Now, press F5 or click &lt;strong&gt;Run&lt;/strong&gt; in order to run the project. If the user input is 10, then the output will look like this&lt;br /&gt;&lt;br /&gt;&lt;img alt="[WFImage6.JPG]" src="http://2.bp.blogspot.com/_hu29p1S-YC4/SejEclYZrwI/AAAAAAAAAC0/TKqFOZKthWY/s1600/WFImage6.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;After completing the excerise, you have good understanding of creation of sequential workflow and it's use.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-3732507618455906961?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/3732507618455906961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=3732507618455906961' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/3732507618455906961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/3732507618455906961'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/creating-sequential-workflow-example.html' title='Creating Sequential Workflow Example with Windows Workflow Foundation (WWF)'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_hu29p1S-YC4/Sei9PDKxVlI/AAAAAAAAACE/8jlBRQsQzLs/s72-c/WFImage1.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-2757488252828083059</id><published>2009-04-15T14:53:00.000-07:00</published><updated>2009-04-15T15:15:36.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net'/><title type='text'>Web.config Hierarchy in ASP.NET</title><content type='html'>ASP.NET integrates the settings in configuration files (the Machine.config and Web.config files) into a single inheritance hierarchy. With a few exceptions, you can place a Web.config file wherever you need to override the configuration settings that are inherited from a configuration file located at a higher level in the hierarchy.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;We can have web config file at each folder or sub folder of the web application which overrides the higher level config.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;System wide configuration settings are defined in the Machine.config for the .NET Framework. The Machine.config file is located in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG folder. By including Web.config files in sub-folders, we can override the settings defined in the Web.config file in the application's root folder.&lt;br /&gt;&lt;br /&gt;The following are sample section declarations from a Machine.config file:&lt;br /&gt;&lt;br /&gt;&lt;&lt;&lt;span style="color:#990000;"&gt;section&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;="&lt;span style="color:#3333ff;"&gt;processModel&lt;/span&gt;"&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;type&lt;/span&gt;="&lt;span style="color:#3333ff;"&gt;System.Web.Configuration.ProcessModelSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;/span&gt;"&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;allowdefinition&lt;/span&gt;="&lt;span style="color:#3333ff;"&gt;MachineOnly&lt;/span&gt;" &lt;span style="color:#ff0000;"&gt;allowlocation&lt;/span&gt;="&lt;span style="color:#3333ff;"&gt;false&lt;/span&gt;"/&gt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;allowDefnition attribute and it's significance in machine config file.&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If allowDefinition is &lt;strong&gt;MachineOnly &lt;/strong&gt;, then we can not override this section either in application level or in folder level. The only section declared in the Machine.config file with this settings is processModel. If you are trying to override the configuration in web.config file, then "&lt;span style="color:#ff0000;"&gt;Parser Error Message: It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config&lt;/span&gt;" error is thrown.&lt;/li&gt;&lt;li&gt;If allowDefinition is &lt;strong&gt;MachineToApplication&lt;/strong&gt;, then we can override these sections by the root directory Web.config. Sections with this setting in Machine.config are authentication, machineKey, sessionState, trust, and securityPolicy. &lt;/li&gt;&lt;li&gt;If allowDefinition attribute is omitted in a section declaration of the Machine.config file, we can override that section at any level. &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-2757488252828083059?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/2757488252828083059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=2757488252828083059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/2757488252828083059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/2757488252828083059'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/webconfig-hierarchy-in-aspnet.html' title='Web.config Hierarchy in ASP.NET'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1788044772731985891.post-597077122533812021</id><published>2009-04-14T17:46:00.000-07:00</published><updated>2009-04-15T15:15:51.211-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Entity Framework in .Net</title><content type='html'>Eliminate the impedance mismatch between data models and between languages that application developers would otherwise have to deal with new features available in the upcoming version of ADO.NET.&lt;br /&gt;&lt;br /&gt;&lt;a name="_Toc226577089"&gt;&lt;strong&gt;&lt;u&gt;Key Points&lt;/u&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;This introduces a new model called Entity Data Model (EDM)&lt;/li&gt;&lt;li&gt;It uses a new provider called MapProvider.&lt;/li&gt;&lt;li&gt;The mapping provider is given the EDM schema and the mapping information, so it can internally use the mapping infrastructure to translate between the logical and conceptual schemas. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Integration with LINQ&lt;/strong&gt;(Language Integrated query): This query written using LINQ will be processed by the compiler, which means that you'll get compile-time validation as the rest of the application code would.&lt;/li&gt;&lt;li&gt;Visual Studio tools can generate EDM Schema from logical and conceptual schema.&lt;/li&gt;&lt;/ul&gt;SELECT sp.FirstName, sp.LastName, sp.HireDateFROM SalesPerson sp INNER JOIN Employee e ON sp.SalesPersonID = e.EmployeeIDINNER JOIN Contact c ON    e.EmployeeID = c.ContactID   WHERE    e.SalariedFlag = 1   AND   e.HireDate &gt;= &lt;span style="color:#990000;"&gt;'2006-01-01'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In the above query we have made unnecessary join to the Contact and Employee table even though we concern only about person data&lt;/strong&gt;. Now that we have a higher-level EDM model, we could write this same query against a set of SalesPeople entities as:&lt;br /&gt;&lt;br /&gt;SELECT sp.FirstName, sp.LastName, sp.HireDateFROM AdventureWorks.AdventureWorksDB.SalesPeople AS spWHERE e.HireDate &gt;= '2006-01-01'&lt;br /&gt;&lt;br /&gt;So, for example, to execute a query against the EDM model that finds the names and hire-dates of the sales people after a given hire date, the ADO.NET code would be:&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;using&lt;/span&gt;(&lt;span style="color:#3333ff;"&gt;MapConnection&lt;/span&gt; con = new &lt;span style="color:#3333ff;"&gt;MapConnection&lt;/span&gt;(connectionName))&lt;br /&gt;{&lt;br /&gt;con.Open();&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;MapCommand&lt;/span&gt; cmd = con.&lt;span style="color:#3333ff;"&gt;CreateCommand&lt;/span&gt;();&lt;br /&gt;cmd.CommandText = "&lt;span style="color:#cc0000;"&gt;SELECT sp.FirstName, sp.LastName, sp.HireDate " + "FROM AdventureWorks.AdventureWorksDB.SalesPeople AS sp " + "WHERE sp.HireDate &gt; @date&lt;/span&gt;"; cmd.Parameters.AddWithValue("date", hireDate);&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;DbDataReader&lt;/span&gt; r = cmd.&lt;span style="color:#3333ff;"&gt;ExecuteReader&lt;/span&gt;();&lt;br /&gt;while(r.Read()) {&lt;br /&gt;Console.WriteLine("{0}\t{1}", r["FirstName"], r["LastName"]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Steps to create a project using .net Entity Framework&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;1. Creating an Entity Data Model using ADO.NET Entity Data Model (.csdl file)&lt;/p&gt;&lt;p&gt;2. Using Entity Client&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;using&lt;/span&gt; (&lt;span style="color:#3366ff;"&gt;EntityConnection&lt;/span&gt; cn = new&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EntityConnection&lt;/span&gt;(”name=NorthwindEntitiesconnetion”))&lt;br /&gt;{&lt;br /&gt;cn.Open();&lt;br /&gt;Console.WriteLine(cn.State.ToString());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;NorthwindEntities is the connection string created automatically while creating data model.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. Working with Objects Using ObjectQuery (Of T)&lt;br /&gt;&lt;br /&gt;4 Using LINQ to Entities to Query your database&lt;/p&gt;&lt;p&gt;creating sample project is &lt;a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1788044772731985891-597077122533812021?l=mstech-onestop.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mstech-onestop.blogspot.com/feeds/597077122533812021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1788044772731985891&amp;postID=597077122533812021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/597077122533812021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1788044772731985891/posts/default/597077122533812021'/><link rel='alternate' type='text/html' href='http://mstech-onestop.blogspot.com/2009/04/entity-framework-in-net.html' title='Entity Framework in .Net'/><author><name>MS Experts</name><uri>http://www.blogger.com/profile/02150609156948300061</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
