<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6471229722965206301</id><updated>2026-10-24T13:05:29.237+05:30</updated><category term="ASP.NET"/><category term="C#"/><category term="SQL Server"/><category term=".net"/><category term="Design Pattern"/><category term="XML"/><category term="log4net"/><category term="JQuery"/><category term="Quartz.NET"/><category term="SQL SERVER Reporting Services"/><category term="SSRS"/><title type='text'>Microsoft .net and SqlServer</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-6225301942986711171</id><published>2025-02-13T09:21:00.000+05:30</published><updated>2025-02-13T09:21:41.872+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Quartz.NET"/><title type='text'>Quartz.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;p data-end=&quot;138&quot; data-start=&quot;0&quot;&gt;Quartz.NET is a widely used and popular open-source scheduling framework. It allows you to schedule thousands of complex jobs with ease.&lt;/p&gt;&lt;p data-end=&quot;427&quot; data-start=&quot;140&quot;&gt;Typically, when developing scheduling-based applications in .NET, the Timer feature is used. However, Timer has limitations—it does not support scheduling jobs based on a specific month, day, or year. Additionally, it lacks a persistence mechanism and does not utilize the thread pool.&lt;/p&gt;&lt;p data-end=&quot;673&quot; data-is-last-node=&quot;&quot; data-start=&quot;429&quot;&gt;With Quartz.NET, each job can be assigned to a specific thread, providing greater flexibility and efficiency. The following example demonstrates how to use Quartz.NET in a .NET application. For this demonstration, I am using Visual Studio 2010.&lt;/p&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Steps:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;1. Download the Quartz.NET dll of &lt;a href=&quot;http://sourceforge.net/projects/quartznet/files/quartznet/Quartz.NET%202.0%20beta%202/&quot; title=&quot;Click to enter Quartz.NET 2.0 beta 2&quot;&gt;&lt;span color=&quot;windowtext&quot; style=&quot;text-decoration: none;&quot;&gt;Quartz.NET 2.0 beta &lt;/span&gt;&lt;/a&gt;1 from the following link &amp;nbsp;&lt;a href=&quot;http://sourceforge.net/projects/quartznet/files/quartznet/&quot;&gt;http://sourceforge.net/projects/quartznet/files/quartznet/&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;2. Created a Console application.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;3. Add the refernce of Common.Logging.dll and Quartz.dll to the application from the downloaded folder Quartz.NET-2.0-beta1\bin\4.0\release\Quartz.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;4. Add the app.config file and add the following configuration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: arial; font-size: small; text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background: none 0% 0% repeat scroll rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;configSections&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 12pt;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;quartz&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;configSections&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;startup&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;supportedRuntime&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 12pt;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;v4.0&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;sku&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;.NETFramework,Version=v4.0&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;startup&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas; font-size: 12pt;&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: small; text-align: -webkit-auto;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;5. Add the following code in the Main() function.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; border: 1px dotted rgb(255, 165, 0); font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ISchedulerFactory&lt;/span&gt;&amp;nbsp;obSchedulerFactory =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;StdSchedulerFactory&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IScheduler&lt;/span&gt;&amp;nbsp;obIScheduler = obSchedulerFactory.GetScheduler();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;DateTimeOffset&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;runTime =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;DateBuilder&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;.EvenSecondDateAfterNow();&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;IJobDetail&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;job =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;JobBuilder&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;.Create&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;MYJob&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;gt;()&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithIdentity(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;job1&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;group1&quot;&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Build();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;ITrigger&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;trigger =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;TriggerBuilder&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;.Create()&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithIdentity(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;trigger1&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;group1&quot;&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .StartAt(runTime)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .EndAt(runTime.AddMinutes(1))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithCronSchedule(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;0/5 * * * * ?&quot;&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Build();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obIScheduler.ScheduleJob(job, trigger);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obIScheduler.Start();&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: small; text-align: -webkit-auto;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;6. Creat a MyJob class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; border: 1px dotted rgb(255, 165, 0); font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; public&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;MYJob&lt;/span&gt;&amp;nbsp;:&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IJob&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;MYJob()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;virtual&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;Execute(&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas; font-size: 12pt;&quot;&gt;IJobExecutionContext&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;context)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Format(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;My Job! - {0}&quot;&lt;/span&gt;, System.&lt;span style=&quot;color: #2b91af;&quot;&gt;DateTime&lt;/span&gt;.Now.ToString(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;r&quot;&lt;/span&gt;)));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-weight: normal; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-size: small; text-align: -webkit-auto;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;7. Open the property of the application and select the Target Framework to &lt;b&gt;.NET Framework 4&lt;/b&gt; from &lt;b&gt;.NET Framework 4 Client Profile&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;8. Run the application. The output will be as follow&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt;&quot;&gt;My Job! - Mon, 02 Apr 2012 12:16:10 GMT&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt;&quot;&gt;My Job! - Mon, 02 Apr 2012 12:16:15 GMT&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt;&quot;&gt;My Job! - Mon, 02 Apr 2012 12:16:20 GMT&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt;&quot;&gt;My Job! - Mon, 02 Apr 2012 12:16:25 GMT&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;The Execute() function of the MyJob class will run in each 5 second, since we had set the shedular for 5 second.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;There are 3 main component of the Quartz.NET : Trigger, Scheduler and Jobs.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Jobs:&lt;/b&gt; &lt;b&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;Job is an executable task, which is sheduled and trigger in a regular interval. To specify the executable task, you have to inherit the IJob Interface and implement the Execute() function. This Execute() method will be called in each interval. In this example, I have used MYJob class and inherited the IJob interface. In the Main() function I have created the instance of IJobDetail instance with the identity name &quot;job1&quot; and group name &quot;group1&quot; and specified the MyJob class to be called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Trigger&lt;/b&gt;: Trigger refers the start, end and sheduler interval for the job. Here I have created the instance of ITrigger instance with the identity name &quot;trigger1&quot; and group name &quot;group1&quot;.&amp;nbsp; The group name for both the job and trigger should be same, so that it can identify that which job is used for which shedule when there are more than one job and trigger. Here I have set the StartAt() to the current datetime and EndAt() after the one minute of current time. The expression &quot;0/5 * * * * ?&quot; specifies the Crone experession, which is used to tell the sheduling time. Here I 0/5 specify that this job will be executing in each 5 second.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Cron Expressions Allowed Fields and Values&lt;/b&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;background: white; mso-cellspacing: 0cm; mso-padding-alt: 2.25pt 2.25pt 2.25pt 2.25pt; mso-yfti-tbllook: 1184; width: 100%;&quot; summary=&quot;Cron Expressions Allowed Fields and Values&quot; title=&quot;Cron Expressions Allowed Fields and Values&quot;&gt;&lt;thead&gt;
&lt;tr&gt;    &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Name&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;    &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Required&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;    &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Allowed Values&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;    &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Allowed Special Characters&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;/tr&gt;
&lt;/thead&gt;  &lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Seconds&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0-59&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * /&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Minutes&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0-59&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * /&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Hours&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0-23&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * /&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Day of month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;1-31&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * ? / L W C&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0-11 or JAN-DEC&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * /&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Day of week&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;1-7 or SUN-SAT&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * ? / L C #&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Year&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;empty or 1970-2099&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;, - * /&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;&lt;b&gt;Cron Expressions&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Cron expressions can be as simple as&amp;nbsp;* * * * ? *&amp;nbsp;or as complex as&amp;nbsp;0&amp;nbsp;0/5&amp;nbsp;14,18,3-39,52&amp;nbsp;?&amp;nbsp;JAN,MAR,SEP&amp;nbsp;MON-FRI&amp;nbsp;2002-2010.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;Here are some more examples:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;mso-cellspacing: 0cm; mso-padding-alt: 2.25pt 2.25pt 2.25pt 2.25pt; mso-yfti-tbllook: 1184; width: 100%;&quot; summary=&quot;Cron Expression Examples&quot; title=&quot;Cron Expression Examples&quot;&gt;&lt;thead&gt;
&lt;tr&gt;    &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Expression&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;    &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Means&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;/tr&gt;
&lt;/thead&gt;  &lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 0 12 * * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 12:00 PM (noon) every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 ? * *&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 * * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 * * ? *&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 * * ? 2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM every day during the year 2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 * 14 * * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire every minute starting at 2:00 PM and ending at 2:59   PM, every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 0/5 14 * * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire every 5 minutes starting at 2:00 PM and ending at   2:55 PM, every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 0/5 14,18 * * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire every 5 minutes starting at 2:00 PM and ending at   2:55 PM, AND fire every 5 minutes starting at 6:00 PM and ending at 6:55 PM,   every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 0-5 14 * * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire every minute starting at 2:00 PM and ending at 2:05   PM, every day&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 10,44 14 ? 3 WED&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 2:10 PM and at 2:44 PM every Wednesday in the   month of March&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 ? * MON-FRI&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM every Monday, Tuesday, Wednesday,   Thursday and Friday&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 15 * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM on the 15th day of every month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 L * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM on the last day of every month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 ? * 6L&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM on the last Friday of every month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 ? * 6L&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM on the last Friday of every month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 ? * 6L 2002-2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM on every last friday of every month   during the years 2002, 2003, 2004, and 2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 15 10 ? * 6#3&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 10:15 AM on the third Friday of every month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 0 12 1/5 * ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire at 12 PM (noon) every 5 days every month, starting on   the first day of the month&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;0 11 11 11 11 ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;padding: 2.25pt;&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Fire every November 11 at 11:11 AM&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Sheduler&lt;/b&gt;: Sheduler is used to grouped the job and trigger both in a group and start and end the sheduling. Here I have created the instance of ISheduler and grouped both the job and trigger and then started the sheduler.&lt;br /&gt;
Download:&amp;nbsp;&lt;iframe frameborder=&quot;0&quot; height=&quot;120px&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;https://skydrive.live.com/embed?cid=3D62A81C29FA2C5A&amp;amp;resid=3D62A81C29FA2C5A%21439&amp;amp;authkey=AGBqZiIVquEVCe4&quot; style=&quot;background-color: #fcfcfc; padding: 0;&quot; title=&quot;Preview&quot; width=&quot;98px&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/6225301942986711171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2012/04/quartznet.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/6225301942986711171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/6225301942986711171'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2012/04/quartznet.html' title='Quartz.NET'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-3166615848920221639</id><published>2012-03-22T12:58:00.011+05:30</published><updated>2012-03-29T12:42:38.194+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="log4net"/><title type='text'>Part 2 : How to use log4net in .net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In &lt;a href=&quot;http://sahapankaj.blogspot.in/2012/02/how-to-use-log4net-in-net.html&quot; target=&quot;_blank&quot;&gt;Part 1 : How to use log4net in .net&lt;/a&gt; you have learnt the basic of log4net. Here I am going to tell you some more details about it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Create Date based log file&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Yes, you can also create your log files date&amp;nbsp;vise. If you want to create a separate file for every day then you can also do that in the log4net. You need to set the &lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;staticLogFileName&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;in the appender.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;The appender section will be &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;/b&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.RollingFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;d:\&lt;/span&gt;&quot;/&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;staticLogFileName&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&quot;/&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appendToFile&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;rollingStyle&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Date&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;datePattern&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;yyyy-MM-dd&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;.log&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;conversionPattern&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%date [%thread] %-5level %logger [%property{NDC}] - %message%newline&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;
&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Here the value of the &lt;b&gt;file&lt;/b&gt; section specify the path of the log file. I have specify the &quot;D:\ &quot;then the file will be created in the &quot;D&quot; drive. If you specify the &quot;d:\log_&quot; then the log file will be &quot;log_2012-03-22.log&quot;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Create separate log file for specified log level&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Here I would like to let you know how you can log the information according to their log level (Debug, Info, Warning, Error, Fatal) in different files. For example, if you want to log Debug log into a file and Error log to another file, you can achieve this through the log4net. For that you just have to add the two appender according to their log level. Each appender will have different log file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre style=&quot;font-weight: normal;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ErrorLogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.FileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;param &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;D:\ErrorLogFile.txt&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;param &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;AppendToFile&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d [%t] %-5p %c %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;filter &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.LevelMatchFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;levelToMatch&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ERROR&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;filter &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.DenyAllFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;DebugLogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.FileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;param &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;D:\DebugLogFile.txt&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;param &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;AppendToFile&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;param &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d [%t] %-5p %c %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;filter &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.LevelMatchFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;levelToMatch &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;DEBUG&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;filter &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.DenyAllFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;level &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ALL&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender-ref &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;DebugLogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender-ref&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ErrorLogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;span style=&quot;color: #1f497d; font-family: arial;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Here I have created two appender ErrorLogFileAppender and DebugLogFileAppender. ErrorLogFileAppender logs the Error level log and store the log information into the ErrorLogFile.txt and DebugLogFileAppender logs the Debug log and store the log information into the DebugLogFile.txt.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Appenders&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;We can log the information into differenct destination output through the Appender.&amp;nbsp; In Previous examples we have seen the FileAppender which is used to log the information into a file. However, log4net provides numbers of Appenders to log the information, you can customized as per your need.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;FileAppender&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; See the previous examples.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;SmtpAppender&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;SmtpAppender is used when you want to get the specified event log through the email. The following example will show how to use the SmtpAppender.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;SmtpAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.SmtpAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;to@domain.com&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;from@domain.com&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;subject&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;my logging message&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;smtpHost&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;SMTPServer.domain.com&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;bufferSize&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;512&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;lossy&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;conversionPattern&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%newline%date [%thread] %-5level %logger [%property{NDC}] - %message%newline%newline%newline&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt; font-weight: bold;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;Here &lt;b&gt;to&lt;/b&gt; specifies the address where log event should be send. The &lt;b&gt;from&lt;/b&gt; is the address from which account email should be send. The &lt;b&gt;subject&lt;/b&gt; specifies the subject of the email. You can also customise this subject. The &lt;b&gt;bufferSize&lt;/b&gt; specifies the size of the email. As soon as log event information reached that size, it sends the email.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div&gt;&lt;div style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;subject&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Util.PatternString&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;%property{log4net:HostName} Error: %appdomain&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;br /&gt;
&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Here I have customised the subject. The HostName and appdomain represents the your host name and application domain of your application. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In the above appender all the log events will be sent to the specified email address, however you can also mentioned which log event you want in email. For that you have to use the following configuration.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre style=&quot;font-weight: normal;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;SmtpAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.SmtpAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;to@domain.com&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;from &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;from@domain.com&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;subject &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;my logging message&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;smtpHost &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;SMTPServer.domain.com&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;bufferSize &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;512&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;lossy &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;evaluator &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Core.LevelEvaluator&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;      &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;threshold &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ERROR&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;evaluator&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;conversionPattern &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%newline%date [%thread] %-5level %logger [%property{NDC}] - %message%newline%newline%newline&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;  &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: arial; font-size: x-small; text-align: -webkit-auto;&quot;&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;pre style=&quot;font-size: small;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;Here you will get only Errro log event through the email. For that you have to set the &lt;b&gt;lossy&lt;/b&gt; to &quot;true&quot; and &lt;b&gt;evaluator&lt;/b&gt; to &quot;ERROR&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;ConsoleAppender&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;Basically ConsoleAppender is used to show the log event information into the console output. The following configuration is used for the ConsoleAppender.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre style=&quot;font-weight: normal;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.ConsoleAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;amp;agt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;amp;gt&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;       &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;conversionPattern &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Consolas;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%date [%thread] %-5level %logger [%property{NDC}] - %message%newline&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;    &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515; font-family: Consolas;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: arial; font-size: small;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: arial; font-size: x-small; text-align: -webkit-auto;&quot;&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;pre style=&quot;font-family: arial; font-size: small;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/3166615848920221639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2012/03/part-2-how-to-use-log4net-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3166615848920221639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3166615848920221639'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2012/03/part-2-how-to-use-log4net-in-net.html' title='Part 2 : How to use log4net in .net'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-8730666555319929500</id><published>2012-02-27T16:31:00.002+05:30</published><updated>2012-02-29T11:46:07.099+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Insert multipal rows into database</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&amp;nbsp;Sometimes we need to insert or update multipal records in a single call using c# code . Here I am going to tell how you can achive this throw the new features of SQL Server 2008. In Sql Server 2008, we can pass table type variable in the parameters of the stored procedrue. So, we can create a table type object in the .net code and pass that object in parameter. Let me give you an example step by step.&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Steps:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;1. &amp;nbsp; &amp;nbsp; &amp;nbsp;1. Create a table named Employee.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;   CREATE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE &lt;/span&gt;[dbo]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Employee]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [EmpId] [nvarchar]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;20&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Name] [nvarchar]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Salary] [decimal]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;18&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 0&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON &lt;/span&gt;[PRIMARY]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;3. &amp;nbsp; &amp;nbsp; &amp;nbsp;2. Create a table type variable named EmployeeTable&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;    CREATE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;TYPE &lt;/span&gt;EmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; [EmpId][nvarchar]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;20&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; [Name][nvarchar]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; [Salary][decimal]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;18&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 0&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GO&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.&amp;nbsp; Create a stored procedure to insert/update the data. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: tahoma;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;span style=&quot;font-family: tahoma;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;ALTER&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;PROCEDURE &lt;/span&gt;SaveEmployee&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @EmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;EmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;READONLY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SET&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NOCOUNT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DECLARE&lt;/span&gt; @InsertEmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;EmployeeTable&lt;span style=&quot;color: grey;&quot;&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@UpdateEmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; EmployeeTable &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;/* Insert those records which are not exist in the Employee table&amp;nbsp; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO &lt;/span&gt;@InsertEmployeeTable &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; @EmployeeTable&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;      WHERE &lt;/span&gt;[@EmployeeTable]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[EmpId] &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IN&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; EmpId &lt;span style=&quot;color: blue;&quot;&gt;FROM &lt;/span&gt;Employee&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;/* Insert those records which are exist in the Employee table&amp;nbsp; */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO &lt;/span&gt;@UpdateEmployeeTable &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; @EmployeeTable&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;          &lt;span style=&quot;color: blue;&quot;&gt;WHERE &lt;/span&gt;[@EmployeeTable]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[EmpId] &lt;span style=&quot;color: grey;&quot;&gt;IN&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; EmpId &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; Employee&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;/* Insert the new records in the Employee table */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; Employee &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; @InsertEmployeeTable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;/* update the existing records in the Employee table */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;UPDATE&lt;/span&gt; Employee&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SET&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; Name &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; [@UpdateEmployeeTable]&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;[Name]&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Salary &lt;span style=&quot;color: grey;&quot;&gt;= &lt;/span&gt;[@UpdateEmployeeTable]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Salary]&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; Employee&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;INNER&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;JOIN &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;@UpdateEmployeeTable &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; Employee&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;EmpId &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;[@UpdateEmployeeTable]&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;[EmpId]&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Here I am passing EmployeeTable type variable @EmployeeTable in the parameter. &amp;nbsp;Created two EmployeTable variable @InsertEmployeeTable and &amp;nbsp;@UpdateEmployeeTable. @InsertEmployeeTable is used to stored those records which are &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;going to be insert and &amp;nbsp;@UpdateEmployeeTable to update records.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;4. Create a console application and add an app.cofig file and add the connection string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;5. Add a class Employee.cs.Here I have created the Save() method which takes the collectios of Employee object. This function basically convert the IList&lt;employee&gt; collection to the datatable and pass that datable into the parameter of the stored procedure. &amp;nbsp;Here you have to very careful when converting the Employee collection to the DataTable. The datatable should have the same same as EmployeeTable type in the Sql Server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/employee&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Save(&lt;span style=&quot;color: #2b91af;&quot;&gt;IList&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;&amp;gt;obEmployees)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;SqlConnection &lt;/span&gt;connection =&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;SqlConnection&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;ConfigurationManager&lt;/span&gt;.AppSettings[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Emp.Connection&quot;&lt;/span&gt;].ToString());&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;SqlCommand &lt;/span&gt;obCommand = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;SqlCommand&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obCommand.Connection = connection;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obCommand.Connection.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obCommand.CommandText = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;SaveEmployee&quot;&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obCommand.CommandType =System.Data.&lt;span style=&quot;color: #2b91af;&quot;&gt;CommandType&lt;/span&gt;.StoredProcedure;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;//Convert collection to data table&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataTable &lt;/span&gt;dtEmployee = GetEmployeeTable(obEmployees);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obCommand.Parameters.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;@EmployeeTable&quot;&lt;/span&gt;, dtEmployee);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obCommand.ExecuteNonQuery();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obCommand.Connection.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;private &lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DataTable&lt;/span&gt; GetEmployeeTable(&lt;span style=&quot;color: #2b91af;&quot;&gt;IList&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;&amp;gt; obEmployeeList)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;dtEmployee = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataTable&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;dtEmployee&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtEmployee.Columns.Add(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataColumn&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;EmpId&quot;&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtEmployee.Columns.Add(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataColumn&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Name&quot;&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtEmployee.Columns.Add(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataColumn&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Salary&quot;&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataRow &lt;/span&gt;dataRow;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;//Assing each object to Data Row and add to Datatable&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;foreach &lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; obEmployee &lt;span style=&quot;color: blue;&quot;&gt;in &lt;/span&gt;obEmployeeList)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataRow = dtEmployee.NewRow();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
                dtEmployee.Rows.Add(GetEmployeeDataRow(dataRow, obEmployee));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;dtEmployee;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;private &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DataRow &lt;/span&gt;GetEmployeeDataRow(&lt;span style=&quot;color: #2b91af;&quot;&gt;DataRow&lt;/span&gt; dataRow, &lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt; obEmployee)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataRow[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;EmpId&quot;&lt;/span&gt;] = obEmployee.EmpId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataRow[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Name&quot;&lt;/span&gt;] = obEmployee.Name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataRow[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Salary&quot;&lt;/span&gt;] = obEmployee.Salary;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;dataRow;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp; 6. Add the following code in the Program.cs file.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static&lt;/span&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Employee &lt;/span&gt;obEmployee = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;*********** SAVE EMP *********&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;&amp;gt; obEmployees = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obEmployees.Add(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Employee &lt;/span&gt;{EmpId = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;EMP01&quot;&lt;/span&gt;, Name = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;A&quot;&lt;/span&gt;, Salary = 6000});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obEmployees.Add(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt; { EmpId = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;EMP02&quot;&lt;/span&gt;, Name = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;B&quot;&lt;/span&gt;, Salary = 7000 });&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obEmployees.Add(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Employee&lt;/span&gt; { EmpId = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;EMP03&quot;&lt;/span&gt;, Name = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;C&quot;&lt;/span&gt;, Salary = 8000 });&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obEmployee.Save(obEmployees);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;************************&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.ReadLine();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
If you run this code first time then application will add those value into the table. And if you run the same code with differenct Name and Salary but same EmpId then it will update all the records.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Download :&lt;/b&gt;&amp;nbsp;&lt;iframe frameborder=&quot;0&quot; height=&quot;120px&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;https://skydrive.live.com/embed?cid=3D62A81C29FA2C5A&amp;amp;resid=3D62A81C29FA2C5A%21438&amp;amp;authkey=ADOu-Uy6iQrpzZU&quot; style=&quot;background-color: #fcfcfc; padding: 0;&quot; title=&quot;Preview&quot; width=&quot;98px&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/8730666555319929500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/insert-multipal-row-into-database.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/8730666555319929500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/8730666555319929500'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/insert-multipal-row-into-database.html' title='Insert multipal rows into database'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-2906934618488047546</id><published>2012-02-21T15:51:00.018+05:30</published><updated>2012-02-21T19:45:19.756+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>New features of SQL Server 2008</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;Here I am going to tell you some new transact-SQL enhancement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot;&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Now you can declare and assigne the variables in&amp;nbsp; a single stagtement. In the old version if you want to declare the variable and assigne the variable then you have to write in the following manner&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @A &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@B &lt;span style=&quot;color: blue;&quot;&gt;NVARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;10&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SET&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @A &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SET&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @B &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;test&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Now you can use the following manner&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @A &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@B &lt;span style=&quot;color: blue;&quot;&gt;NVARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;10&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;test&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;If you are using the reference of a variable in the declaration then it will show the error&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @A &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@B &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; @A &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @B &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; You have to change the above statements in the following manner&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @A &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@B &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SET&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @B &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; @A &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; You can also assingne the multipal statements in the single line&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;DECLARE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @A &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@B &lt;span style=&quot;color: blue;&quot;&gt;BIGINT&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @B &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; @A &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; 1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @B &lt;span style=&quot;color: grey;&quot;&gt;+=&lt;/span&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @B&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;The output will be 13&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;Here you have to use the SELECT statement in the &lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @B &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; @A &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; 1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; @B &lt;span style=&quot;color: grey;&quot;&gt;+=&lt;/span&gt;2&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;You can not use SET statement here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;2. Insert multipal statement&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;If want want to insert multipal records &amp;nbsp;then what have to use the &amp;nbsp;following queries&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; Employee&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;VALUES &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp01&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 20000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; Employee&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;VALUES &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp02&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 30000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; Employee&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;VALUES &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp03&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 40000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;OR&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; Employee&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Emp01&#39;&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 20000 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;UNION&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;ALL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Emp02&#39;&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 30000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;UNION&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;ALL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Emp03&#39;&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 40000&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;But now we can insert multipal records in a single query &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; Employee&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp01&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 20000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp02&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 30000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp03&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 40000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;If you want apply some conditions or joins on some default values of collection then you have to insert those values into a temp table and apply those joins or conditions. We can achieve this through the new features of SQL Server 2008. Here I am using the &amp;nbsp;CTE (Common Table Expression ) to insert &amp;nbsp;default values instead of the temp table and applying the conditions on that&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; ConditionalDataCTE&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp01&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 20000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp02&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 30000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp03&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 40000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; EMP&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; ConditionalDataCTE&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Now we can apply different conditions or JOINS on the ConditionalDataCTE.&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: tahoma;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 0.9em;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 0.9em;&quot;&gt; Employee&lt;span style=&quot;color: grey;&quot;&gt;.*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; ConditionalDataCTE&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;INNER&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; Employee &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; Employee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EmpId &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; ConditionalDataCTE&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EmpId&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;3. New Merge statement&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;If we have a collection of records and want to update or insert through a single query then we can achieve this through the Merge statement. The syntax of the Merge statement is &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;MERGE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; [INTO] &lt;span style=&quot;color: grey;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;target&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;USING&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;&lt;source&lt; span=&quot;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;table&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;or&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;table&lt;/span&gt; expression&lt;span style=&quot;color: grey;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/source&lt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;&lt;join &lt;=&quot;&quot; span=&quot;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;merge&lt;/span&gt; predicate&lt;span style=&quot;color: grey;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;semantics similar &lt;span style=&quot;color: blue;&quot;&gt;to&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;outer&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;join)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/join&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WHEN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;MATCHED&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;statement&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;to&lt;/span&gt; run &lt;span style=&quot;color: blue;&quot;&gt;when&lt;/span&gt; match found &lt;span style=&quot;color: grey;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;target&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WHEN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; [TARGET] &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;MATCHED&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;statement&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;to&lt;/span&gt; run &lt;span style=&quot;color: blue;&quot;&gt;when&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;no&lt;/span&gt; match found &lt;span style=&quot;color: grey;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;target&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;Here I am using an Employee&amp;nbsp; table and I have to update and insert the multipal records in the Employee table then I will use the following query&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp01&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 20000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp02&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 70000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp03&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 80000&lt;span style=&quot;color: grey;&quot;&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-family: &#39;Courier New&#39;;&quot;&gt;&#39;Emp04&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;D&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 80000&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; EMP&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;MERGE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; EMPLOYEE &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;USING&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; NewEmployee&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; EMPLOYEE&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EmpId &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EmpId&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WHEN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;MATCHED&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;INSERT &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;VALUES &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WHEN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;MATCHED&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;UPDATE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;SET&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;Name &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;Salary &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; NewEmployee&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Salary&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;Here I have NewEmployee table and appling the Merge statement with Employee table. If the NewEmployee&#39;s EmpId are exist in the Employee table then those records will be updated otherwise those will be inserted.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;4. Use Table type paramenter in stored procedure.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp; Now we can also pass the table type parameter in the SQL Server Stored Procedure. I am using the following commend to create the table type variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;TYPE&lt;/span&gt; EmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [EmpId] [nvarchar]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;20&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Name] [nvarchar]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Salary] [decimal]&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;18&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; 0&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;Now need passing this table type variable in the parameter of the stored procedure&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;PROCEDURE&lt;/span&gt; useTableType&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @NewEmployee &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; EmployeeTable &lt;span style=&quot;color: blue;&quot;&gt;READONLY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SET&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NOCOUNT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;MERGE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; EMPLOYEE &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;USING&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; @NewEmployee&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; EMPLOYEE&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;EmpId &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; [@NewEmployee]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[EmpId]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WHEN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;MATCHED&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;INSERT &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;EmpId&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; Salary&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;VALUES &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;[@NewEmployee]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[EmpId]&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; [@NewEmployee]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Name]&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt; [@NewEmployee]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Salary]&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;WHEN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;MATCHED&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;UPDATE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;SET&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;Name &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; [@NewEmployee]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Name]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;Salary &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; [@NewEmployee]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Salary]&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: tahoma; font-size: 0.9em; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/2906934618488047546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/new-features-of-sql-server-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/2906934618488047546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/2906934618488047546'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/new-features-of-sql-server-2008.html' title='New features of SQL Server 2008'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-4677525350406502221</id><published>2012-02-18T16:39:00.002+05:30</published><updated>2012-02-20T16:17:04.762+05:30</updated><title type='text'>Giving anonymous access to a page and folder using form authentication</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
One of my friend has the problem using for accessing the page and folder using the form authentication. I thought I should put this solution in the blog. Whenever we use the Form Authentication for the authentication we use the following configuration in the web.cofig file&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;deny users=&quot;?&quot;&amp;gt;&amp;lt;/deny&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;authentication mode=&quot;Forms&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;forms name=&quot;MyAuthAsp&quot; defaultUrl=&quot;default.aspx&quot; loginUrl=&quot;login.aspx&quot; cookieless=&quot;AutoDetect&quot; path=&quot;/&quot; protection=&quot;All&quot; timeout=&quot;20&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/authentication&amp;gt; &lt;br /&gt;
&amp;nbsp; &lt;/div&gt;&lt;br /&gt;
here&amp;nbsp;&lt;span style=&quot;background-color: #ffffd2; font-family: tahoma; font-size: 14px; font-weight: bold;&quot;&gt;&amp;nbsp;&amp;lt;authorization&amp;gt;&lt;/span&gt;&amp;nbsp; &lt;authorization&gt; section restrictes all the anonomous user to access the other pages of the site. Now the problem is that I need to access some pages i.e. faq.aspx, contact.aspx, career.aspx which are in the root of the site or css and javascript files then I can not go directectly to those pages. To overcome this problem you just need to add the following section in the web.config file&lt;/authorization&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;br /&gt;
&amp;lt;location path=&quot;Default.aspx&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;allow users=&quot;*&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/location&amp;gt;&lt;br /&gt;
&amp;nbsp; &lt;/div&gt;&lt;br /&gt;
Now the Default.aspx page will be accessable by the anonomous users withoug login. If you want to access more pages then add that section with the differenct path.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;br /&gt;
&amp;lt;location path=&quot;style.css&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;allow users=&quot;*&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/location&amp;gt;&lt;br /&gt;
&amp;nbsp; &lt;/div&gt;&lt;br /&gt;
If you have to access a folder or all the pages of a particula folder then you can specify the folder path here.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;br /&gt;
&amp;lt;location path=&quot;MyFolder&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;allow users=&quot;*&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/authorization&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/location&amp;gt;&lt;/div&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;-webkit-transition-delay: initial; -webkit-transition-duration: 0.3s; -webkit-transition-property: all; -webkit-transition-timing-function: linear; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-color: rgb(229, 229, 229); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(229, 229, 229); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(229, 229, 229); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(229, 229, 229); border-top-left-radius: 3px; border-top-right-radius: 3px; border-top-style: solid; border-top-width: 1px; margin-bottom: 1.5em; margin-top: 1.5em; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; line-height: normal; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/4677525350406502221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/giving-anonymous-access-to-page-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/4677525350406502221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/4677525350406502221'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/giving-anonymous-access-to-page-and.html' title='Giving anonymous access to a page and folder using form authentication'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-7586154250715832552</id><published>2012-02-18T14:30:00.039+05:30</published><updated>2012-03-26T12:58:58.053+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="log4net"/><title type='text'>Part 1 : How to use log4net in .net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;This article describes how to use the log4net for the .net application. Log4net is the open source library used to log the application event message in the different sources. You can log the info into the file, console output, event log or can be send in the email. The main advantage to use this, it&#39;s flexibility and extendenbility. You can control the log though the configuration file without change the code. Here I am going to give you the overview how to use the log4net for the asp.net web application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;You just have to create an asp.net website, changed in the web.config file and call the log method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;Steps:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Download the latest dll file of log4net from the link&lt;a href=&quot;http://logging.apache.org/log4net/download_log4net.cgi&quot;&gt;&amp;nbsp;here&lt;/a&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create the asp.net website, and add the reference of log4net.dll to this application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Add the following section in the&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt;configSections&lt;b&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;configuration&gt;section of the web.config file&lt;o:p&gt;&lt;/o:p&gt;&lt;/configuration&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm; text-indent: -18.0pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;configSections&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;section&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net&lt;/span&gt;&quot; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Config.Log4NetConfigurationSectionHandler,log4net&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;configSections&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;4.&amp;nbsp; Then add the following section&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;log4net&gt;in the&amp;nbsp;&lt;/log4net&gt;the&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt;configSections&lt;b&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp; section&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;log4net&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.FileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;D:\LogFile.txt&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;AppendToFile&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d [%t] %-5p %c %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;level&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;DEBUG&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;appender-ref&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;log4net&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;Here&amp;nbsp;&amp;lt;log4net&amp;gt;&amp;nbsp; contains to more sub sections&amp;nbsp;&amp;lt;appender&amp;gt;&amp;nbsp;and&amp;nbsp;&amp;lt;root&amp;gt;&amp;nbsp;Appender specify what type of log to be logged, where it should be logged, how you need to log and what type of information you want to log. Here I have used file appender. The Name of the appender can be anything. The type for the file logger should be log4net.Appender.FileAppender. You can also extend the class as per your need. The &quot;D:\LogFile.tx&quot; specify the file path where it should be logged.&amp;nbsp;specify the log information format. You can also customized this format. The&amp;nbsp;section is used to specify the appender reference and define what level of log you want to logged.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp;5.Add the namespace in the default.aspx.cs page&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; using&lt;/span&gt;&amp;nbsp;log4net;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; using&lt;/span&gt;&amp;nbsp;log4net.Config;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&amp;nbsp; 6. Add the following code in the Page_Load method&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;readonly&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ILog&lt;/span&gt;&amp;nbsp;logger =&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;LogManager&lt;/span&gt;.GetLogger(&lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;_Default&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;OR&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;readonly&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ILog&lt;/span&gt;&amp;nbsp;logger = &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;LogManager&lt;/span&gt;.GetLogger(System.Reflection.&lt;span style=&quot;color: #2b91af;&quot;&gt;MethodBase&lt;/span&gt;.GetCurrentMethod().DeclaringType)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp;7. Add the following code in the Page_Load method&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;EventArgs&lt;/span&gt;&amp;nbsp;e)&lt;br /&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;DOMConfigurator&lt;/span&gt;.Configure();&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int&lt;/span&gt;&amp;nbsp;a = 0, b = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.Debug(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log Debug&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.Info(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log info&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.Warn(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log Warn&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;logger.Fatal(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log Fatal&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; float&lt;/span&gt;&amp;nbsp;c = b/a;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; catch&lt;/span&gt;&amp;nbsp;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;ex)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; logger.Error(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;some errro in the application &quot;&lt;/span&gt;,ex);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&amp;nbsp; 7. Run the application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&amp;nbsp; 8. Now open the LogFile.txt. The output will be&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;2012-02-18 13:58:01,197 [2348] DEBUG _Default Log Debug&lt;/span&gt;&lt;br /&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; 2012-02-18 13:58:01,203 [2348] INFO _Default Log info&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; 2012-02-18 13:58:01,203 [2348] WARN _Default Log Warn&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; 2012-02-18 13:58:01,203 [2348] FATAL _Default Log Fatal&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; 2012-02-18 13:58:01,219 [2348] ERROR _Default some errro in the application&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; System.DivideByZeroException: Attempted to divide by zero.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; at _Default.Page_Load(Object sender, EventArgs e) in d:\Log4NetWeb\Default.aspx.cs:line 31&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;Disable log4net&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&amp;nbsp;The big benefit of using the log4net is, you can configure it without changing the code. Once you have completed your code and published the application, then you can change the configuration through the configuration section of the .config file. If you want to disable the log4net then you just need to add the&amp;nbsp;&amp;lt;threshold&amp;gt;&amp;nbsp;section in the appender section.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Appender.FileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;threshold&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;OFF&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;u2:p&gt;&lt;/u2:p&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;File&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;D:\LogFileInfo.txt&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;u2:p&gt;&lt;/u2:p&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;AppendToFile&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;u2:p&gt;&lt;/u2:p&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Layout.PatternLayout&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;u2:p&gt;&lt;/u2:p&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;param&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ConversionPattern&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;%d [%t] %-5p %c %m%n&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;u2:p&gt;&lt;/u2:p&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;u2:p&gt;&lt;/u2:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;appender&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;Specify log level&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;You can use 7 type of levels in the logging. These levels specify what kind of log you want to add into your application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;1. ALL&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;2. Debug&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;3. Information&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;4. Warning&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;5. Error&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;6. Fatal&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;7. OFF&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;The sequence is very important here. ALL specify that all kind of logs will be loged. If you specify Debug then all types of log can be logged. If you specify Information then all the log will be logged except Debug and if you specify Fatal then only Fatal log. OFF type of level will not log any kind of log.&amp;nbsp; These level are specify in the&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;root&gt;&lt;u1:p configuration.=&quot;&quot; log=&quot;&quot; of=&quot;&quot; section=&quot;&quot; the=&quot;&quot;&gt;&lt;/u1:p&gt;&lt;/root&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;DEBUG&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;appender-ref&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;LogFileAppender&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;root&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;amp;gt&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Filters&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;Filter is the another kind of criteria which tell what kind of level you want to log. Filter is specified in the appender. You can use multipal appender in the same logger and each appender can contain different Filters. As per the name, Filter filters the log information or log the information as per the filter criteria. There are different types of Filters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;StringMatchFilter&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;This Filter check if the matching string is exist in the log or not. If exist then log the information otherwise does not log.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.StringMatchFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;stringToMatch&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Pankaj&lt;/span&gt;&quot;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.DenyAllFilter&lt;/span&gt;&quot;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;Here I have used the Filter section and used the&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;StringMatchFilter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;filter. It will log only those information which has string &quot;Pankaj&quot;. You also have to add the section&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.DenyAllFilter&lt;/span&gt;&quot;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&amp;nbsp;&lt;/span&gt;. Now I have changed the above code.&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;sender,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;EventArgs&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;e)&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DOMConfigurator&lt;/span&gt;.Configure();&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;a = 0, b = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; logger.Debug(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log Debug&quot;&lt;/span&gt;);&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logger.Info(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log info&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logger.Warn(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Log Warn&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logger.Fatal(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Pankaj Log Fatal&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;c = b/a;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;ex)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logger.Error(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;some errro in the application &quot;&lt;/span&gt;,ex);&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;br /&gt;
If you don’t include the&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;DenyAllFilter&lt;/span&gt;&amp;nbsp; section then it will log all the log (DEBUG, INFO, WARN, FATAL, ERROR).&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;DenyAllFilter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;section will deny all the log and&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;stringToMatch&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;log only those information who has the string &quot;Pankaj&quot;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;LevelMatchFilter&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;When you need to log only specified level of log then you can use LevelMatchFilter. For example, if you want to log only ERROR level then the syntax will be&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.LevelMatchFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;levelToMatch&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;ERROR&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.DenyAllFilter&lt;/span&gt;&quot;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;b&gt;LevelRangeFilter&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;This type of logging is basically used when you need to log a specified range of log. For example, if you want to log only those information which are between the WARNING and FATAL, then the systax will be&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background: #FFFFD2; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;log4net.Filter.LevelRangeFilter&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;levelMin&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;WARN&lt;/span&gt;&quot;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;levelMax&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;FATAL&lt;/span&gt;&quot;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: .0001pt; margin: 0cm;&quot;&gt;Now if you run the&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Page_Load&amp;nbsp; function then only WARN, ERROR and FATAL will be logged, not DEBUG and INFO.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/7586154250715832552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/how-to-use-log4net-in-net.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7586154250715832552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7586154250715832552'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2012/02/how-to-use-log4net-in-net.html' title='Part 1 : How to use log4net in .net'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-7938279021361502528</id><published>2010-08-10T11:28:00.005+05:30</published><updated>2010-08-10T11:51:17.676+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>Factory Pattern</title><content type='html'>&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In the object oriented programming there are numbers of patterns, one type of pattern is Factory Patterns. When we have several classes and returning an instance of a single class depending on the type of the data is called Factory Pattern. Generally all the classes have a single parent class and each derived class contain same methods. Depending on the data, we fetch a single class object.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0lQnlY3KoGq7ALtBv5MRfgKo1vOxcDPv-7AVmpy-hodUrQ7kWxToJpF_OYcFSomaL5bvxPGI5vviMu9e6p3SOa9umXfPmB5VzOMVhFu5xxt-VgfvdO9LEW-rSCGxLM65ABVlaVobsAmo/s1600/Factory.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0lQnlY3KoGq7ALtBv5MRfgKo1vOxcDPv-7AVmpy-hodUrQ7kWxToJpF_OYcFSomaL5bvxPGI5vviMu9e6p3SOa9umXfPmB5VzOMVhFu5xxt-VgfvdO9LEW-rSCGxLM65ABVlaVobsAmo/s400/Factory.gif&quot; width=&quot;253&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&amp;nbsp;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; In this figure, you can see there is a single Parent class which is derived by 3 Derived Class.&amp;nbsp; Here we have created a Factory Class, which contains a Factory Method (may contain parameter or not), which returns the parent class’s instance. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;To see this figure we can say, the Factory class basically used to decide which derived class object should be initiate. It does not depend on the programmer.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Let me give you an example that will make it simple.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;abstract&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;NumberClas&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; {&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;  public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;abstract&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Show();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11pt;&quot;&gt;Here NumberClass is a parent class, which contains a abstract method Show();&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp; public&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;EvenNumber&lt;/span&gt; : &lt;span style=&quot;color: #2b91af;&quot;&gt;NumberClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; EvenNumber()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Show()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Even number.&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;OddNumber&lt;/span&gt; : &lt;span style=&quot;color: #2b91af;&quot;&gt;NumberClass&lt;/span&gt;&lt;/span&gt;
      &amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; OddNumber ()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;     public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Show()&lt;/span&gt;
      &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;     &amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Odd number.&quot;&lt;/span&gt;);&lt;/span&gt;
         &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
The EvenNumber and OddNumber&amp;nbsp; are two derived classes, both have the same parent NumberClass and overriding the Show() method. To know the runtime which derived class’s object should be initialize I have created the FactoryClass. This class contains the GetObject(int number) method, which returns the correct object at the run time.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;FactoryClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;NumberClass&lt;/span&gt; GetObject(&lt;span style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;number)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;       if&lt;/span&gt;(number % 2 == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;EvenNumber&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;

&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;       else&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;OddNumber&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;Now&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp; {&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //initialice the factory class object&lt;o:p&gt;&lt;/o:p&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;   FactoryClass&lt;/span&gt; obFctoryClass = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;FactoryClass&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;   &lt;span style=&quot;color: green;&quot;&gt;//initilize the base class object through the factory method&lt;/span&gt;&lt;/span&gt;
    &lt;span style=&quot;color: #2b91af;&quot;&gt;NumberClass&lt;/span&gt; obNumberClass = obFactoryClass.GetObject(2);&lt;o:p&gt;&lt;/o:p&gt;

&lt;div class=&quot;MsoNormal&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;   //call the derived class method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;   obNumberClass.Show();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;  &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;\n******************&quot;&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;//initilize the base class object through the factory method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;   obNumberClass = obFactoryClass.GetObject(3);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;  &lt;span style=&quot;color: green;&quot;&gt;//call the derived class method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;   obNumberClass.Show();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;

     &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt; Console&lt;/span&gt;.ReadLine();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;  }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;Output is&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;br /&gt;
&lt;pre&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CUsers%5Cpankaj%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-520092929 1073786111 9 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:10.0pt;
	margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:Calibri;
	mso-fareast-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;
	mso-bidi-font-family:&quot;Times New Roman&quot;;
	mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
	{mso-style-type:export-only;
	margin-bottom:10.0pt;
	line-height:115%;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;Even number.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;******************&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;Odd number.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/7938279021361502528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2010/08/factory-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7938279021361502528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7938279021361502528'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2010/08/factory-pattern.html' title='Factory Pattern'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0lQnlY3KoGq7ALtBv5MRfgKo1vOxcDPv-7AVmpy-hodUrQ7kWxToJpF_OYcFSomaL5bvxPGI5vviMu9e6p3SOa9umXfPmB5VzOMVhFu5xxt-VgfvdO9LEW-rSCGxLM65ABVlaVobsAmo/s72-c/Factory.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-3963464690432341140</id><published>2010-08-05T16:53:00.006+05:30</published><updated>2010-08-05T17:40:34.662+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Delegate</title><content type='html'>&lt;b&gt;What is a Delegate&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A delegate is a class that can hold a reference of a method. The type of a delegate is the type or signature of the method rather than the class. A delegate is thus equivalent to a type safe function pointer or a callback. A delegate declaration is sufficient to define a delegate class.&lt;br /&gt;
&lt;br /&gt;
There are three steps in defining and using delegates:&lt;br /&gt;
1. Declaration&lt;br /&gt;
2. Instantiation&lt;br /&gt;
3. Invocation&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Declaration&lt;/b&gt;&lt;br /&gt;
The syntax to declare of the delete is &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;delegate   return-type  identifier([parameters])&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
example :&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;public delegate void DelegateSample();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
here return-type is void, identifier is the delegate name (DelegateSample) and this delegate does not have any parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. Instantiation&lt;/b&gt;&lt;br /&gt;
Every delegate can contain only those functions pointer, which has the same signature. Here DelegateSample  can only contain refereces of those function which has return-type void and does not have any parameters.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;DelegateSample obDelegateSample = new DelegateSample(ShowMessage);

private void ShowMessage()
{
Response.Write(&quot;Function called&quot;);
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Here ShowMessage() is a private function which has return type void and this function does not contain any parameter. Now I have created an object of DelegateSample obDelegateSample and this object contain the refrence of ShowMessage(). Here function and delegate signature is same.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Invocation&lt;/b&gt;&lt;br /&gt;
To invoke the delegate you just need to call the obDelegateSample.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;obDelegateSample();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;Here I am using a web application.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example1: Void return-type with no parameter delegate example&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;public delegate void DelegateSample();

protected void Page_Load(object sender, EventArgs e)
{
DelegateSample obDelegateSample = new      DelegateSample(ShowMessage);

obDelegateSample();
}

private void ShowMessage()
{
Response.Write(&quot;Function called&quot;);
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Example2:  string return-type with parameter delegate example&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;public delegate string DelegateSampleReturn(string message);

protected void Page_Load(object sender, EventArgs e)
{

DelegateSampleReturn obDelegateSampleReturn = new   DelegateSampleReturn(ShowMessageReturn);

string returnValue =  obDelegateSampleReturn(&quot;hello&quot;);

Response.Write(returnValue);
}

private string  ShowMessageReturn(string message)
{
return message;
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Example3:  calling static function&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;public delegate string DelegateSampleReturn(string message);

protected void Page_Load(object sender, EventArgs e)
{

DelegateSampleReturn obDelegateSampleReturn = new   DelegateSampleReturn(ShowMessageReturn);

string returnValue =  obDelegateSampleReturn(&quot;hello&quot;);

Response.Write(returnValue);
}

static string  ShowMessageReturn(string message)
{
return message;
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example4:  Calling different class member functions&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;public class ClassAdd
{
public static int Add(int a, int b)
{
return a + b;
}

}

public class ClassSub
{
public static int Subtract(int a, int b)
{
return a - b;
}

}
public delegate int DelegateSampleReturnInt(int a, int b);

protected void Page_Load(object sender, EventArgs e)
{
DelegateSampleReturnInt obDelegateSampleReturnInt = new  DelegateSampleReturnInt(ClassAdd.Add);

int returnValue = obDelegateSampleReturnInt(2, 3);
Response.Write(&quot;Add :&quot; + returnValue);

obDelegateSampleReturnInt = new DelegateSampleReturnInt(ClassSub.Subtract);

returnValue = obDelegateSampleReturnInt(2, 3);

Response.Write(&quot;  Subtract : &quot; + returnValue);

}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Multicast Delegate&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A delegate can point to one or more than one function. When delegate point to more than one function, then it is called Multicast Delegate.  &lt;br /&gt;
&lt;br /&gt;
In the example4, I have created a single object of DelegateSampleReturnInt obDelegateSampleReturnInt, and obDelegateSampleReturnInt is pointing two different functions. First time it is initializing to the ClassAdd.Add and then invoke the Add() method. Second time it is initializing to the ClassSub.Subtract() method and then invoking that method. The limitation is here, If I do not invoke the Add() method, then It will only invoke Subtract().  To overcome this scenario, we can use Multicast Delegates.&lt;br /&gt;
&lt;br /&gt;
In Multicast Delegate you can call more than one function in a single invocation.&lt;br /&gt;
You can use the overloaded += operator to assign an additional funtion to the delegate object. If you want to remove any function reference from the delegate object then you have to use overloaded -= operator. &lt;br /&gt;
&lt;br /&gt;
Multicast delegates must contain only methods that return void; else there is a run-time exception. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//declaration of the delegate
public delegate void DelegateSampleReturn(int a, int b);

protected void Page_Load(object sender, EventArgs e)
{
//initilization 
DelegateSampleReturn obDelegateSampleReturn = new DelegateSampleReturn(Add);

obDelegateSampleReturn += new DelegateSampleReturn(Substract);

//invoke   
obDelegateSampleReturn(2, 3);


}
public void Add(int a, int b)
{
Response.Write(&quot;Add :&quot; + a + b);
}
public void Substract(int a, int b)
{
Response.Write(&quot;Sub : &quot; + a - b);
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/3963464690432341140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2010/08/delegate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3963464690432341140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3963464690432341140'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2010/08/delegate.html' title='Delegate'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-8820996428558593580</id><published>2010-04-12T15:44:00.003+05:30</published><updated>2010-04-13T10:24:49.408+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL SERVER Reporting Services"/><category scheme="http://www.blogger.com/atom/ns#" term="SSRS"/><title type='text'>Logon failed. (rsLogonFailed) Logon failure: unknown user name or bad password. (Exception from HRESULT: 0x8007052E)</title><content type='html'>Hi All,&lt;br /&gt;
&lt;br /&gt;
I have created the reports in SQL Service Services. When I upload the reports in the Reporting Server, its show the following error&lt;br /&gt;
&lt;br /&gt;
Logon failed. (rsLogonFailed)&lt;br /&gt;
&lt;br /&gt;
Logon failure: unknown user name or bad password. (Exception from HRESULT: 0x8007052E)&lt;br /&gt;
&lt;br /&gt;
To solve this problem, do the following steps&lt;br /&gt;
&lt;br /&gt;
1.Open the SQL Server Reporting Service Configuration&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Hade_Yo8x3nAiRbsHnU9c-sVOfjJJ5zvkqmbtxsqVXHX0PGoDawxDYJN79AySrV1d23M4lp-mrU4Qnw3XzvYD6Kt-qzsj2mk4JQ-yI5x5MH0lOnk3GOLLSg9lJ31LTmjAbJrAy2josw/s1600/ReportingService1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Hade_Yo8x3nAiRbsHnU9c-sVOfjJJ5zvkqmbtxsqVXHX0PGoDawxDYJN79AySrV1d23M4lp-mrU4Qnw3XzvYD6Kt-qzsj2mk4JQ-yI5x5MH0lOnk3GOLLSg9lJ31LTmjAbJrAy2josw/s400/ReportingService1.jpg&quot; width=&quot;216&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;2.Go to the Execution Account&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN9LtZK0UQoOIWQNoVv0MVq0qWonq7FAleM-BxqmrFXBVe5SrWYF6DJ7ubrHjUl99f0Vd_En0g5AM3xLwmW9GdJ6Ez9gSbkFDNMOWF-JfYJNGPQgpg2XygUObVy_CEYdfGGxVWDZGyvDE/s1600/ReportingService.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;201&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN9LtZK0UQoOIWQNoVv0MVq0qWonq7FAleM-BxqmrFXBVe5SrWYF6DJ7ubrHjUl99f0Vd_En0g5AM3xLwmW9GdJ6Ez9gSbkFDNMOWF-JfYJNGPQgpg2XygUObVy_CEYdfGGxVWDZGyvDE/s400/ReportingService.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
3.Uncheck the Specify an execution account</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/8820996428558593580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2010/04/logon-failed-rslogonfailed-logon.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/8820996428558593580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/8820996428558593580'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2010/04/logon-failed-rslogonfailed-logon.html' title='Logon failed. (rsLogonFailed) Logon failure: unknown user name or bad password. (Exception from HRESULT: 0x8007052E)'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Hade_Yo8x3nAiRbsHnU9c-sVOfjJJ5zvkqmbtxsqVXHX0PGoDawxDYJN79AySrV1d23M4lp-mrU4Qnw3XzvYD6Kt-qzsj2mk4JQ-yI5x5MH0lOnk3GOLLSg9lJ31LTmjAbJrAy2josw/s72-c/ReportingService1.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-169693569783065924</id><published>2010-03-24T11:26:00.008+05:30</published><updated>2010-04-12T15:49:18.058+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Custom Error Handling in ASP.NET</title><content type='html'>.Net provides number of ways to manage and handle errors. Generally we use try..catch block to handle the error and show the error message in a label. Instead of showing the error in that page, we can show the error in another page with the customized manner, so that it can be seem more professional.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;br /&gt;
1.Create an ASP.NET web site.&lt;br /&gt;
2.Add a class ErrorPage.cs in the App_Code folder.&lt;br /&gt;
3.Add the following variable in the ErrorPage.cs file&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;//Declare the private HttpApplication variable
private HttpApplication _application;

void IHttpModule.Init (HttpApplication application)
{
_application = application;

//check whether the ErrorHandling values is Application type set in the web.config
//file or not. If yes then declare an EventHandler 
if (GetValue(&quot;ErrorHandling&quot;) == &quot;Application&quot;)
_application.Error += new EventHandler(ErrorPageHandler);

}


private void ErrorPageHandler(Object sender, EventArgs e)
{
//fetch the error
ProcessException(_application.Server.GetLastError());
}

//store the error in the Cache
private void ProcessException(Exception exception)
{
HttpContext.Current.Cache[&quot;Error&quot;] = HttpContext.Current.Request.Url.ToString();
HttpContext.Current.Cache[&quot;ErrorMsg&quot;] = exception.Message;
HttpContext.Current.Cache[&quot;StackTrace&quot;] = exception.StackTrace;

HttpContext.Current.Response.Redirect(GetValue(&quot;SiteUrl&quot;) + &quot;/Error.aspx&quot;);
}


//fetch the value from the web.config file
public string GetValue(string Key)
{
string ret = System.Web.Configuration.WebConfigurationManager.AppSettings[Key];

return ret;
}
public void Dispose()
{
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
4.Create an Error.aspx page and add the following html code &lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&amp;lt;asp:table width=&quot;100%&quot; align=&quot;center&quot; &amp;gt;

&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td style=&quot;text-align: left; font-weight: bold&quot;&amp;gt;
Error In
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td  style=&quot;text-align: left; font-weight: bold&quot;&amp;gt;
&amp;lt;asp:asp:Label ID=&quot;lblError&quot; runat=&quot;server&quot; CssClass=&quot;x-panel-mc-font&quot;&amp;gt;&amp;lt;asp:/asp:Label&amp;gt;
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td  style=&quot;text-align: left; font-weight: bold&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td style=&quot;text-align: left; font-weight: bold&quot;&amp;gt;
Error Message
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td  style=&quot;text-align: left;&quot;&amp;gt;
&amp;lt;asp:asp:Label ID=&quot;lblErrorMsg&quot; runat=&quot;server&quot; CssClass=&quot;x-panel-mc-font&quot;&amp;gt;&amp;lt;asp:/asp:Label&amp;gt;
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td  style=&quot;text-align: left;&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td style=&quot;text-align: left; font-weight: bold&quot;&amp;gt;
Stack Track
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td  style=&quot;text-align: left;&quot;&amp;gt;
&amp;lt;asp:asp:Label ID=&quot;lblStackTrace&quot; runat=&quot;server&quot; CssClass=&quot;x-panel-mc-font&quot;&amp;gt;&amp;lt;asp:/asp:Label&amp;gt;
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:tr&amp;gt;
&amp;lt;asp:td  style=&quot;text-align: left;&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;
&amp;lt;asp:/td&amp;gt;
&amp;lt;asp:/tr&amp;gt;
&amp;lt;asp:/table&amp;gt;

&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Here I have used 3 lables to show the page name (from where error is generated), Error Message and Stack Track. &lt;br /&gt;
&lt;br /&gt;
5.Add the following code in the Error.aspx.cs page&lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)
{
if (Cache[&quot;Error&quot;] != null)
lblError.Text = Cache[&quot;Error&quot;].ToString();
if (Cache[&quot;ErrorMsg&quot;] != null)
lblErrorMsg.Text = Cache[&quot;ErrorMsg&quot;].ToString();
if (Cache[&quot;StackTrace&quot;] != null)
lblStackTrace.Text = Cache[&quot;StackTrace&quot;].ToString();

}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Fetched the errors from the Cache and showing in the labels. &lt;br /&gt;
&lt;br /&gt;
6.In the default.aspx page add a button control, and add the following code in the button click event.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;int a = 1, b = 0;
int c = a / b;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Generating the error.&lt;br /&gt;
&lt;br /&gt;
7.Add the following setting in the web.config file&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&amp;lt;asp:appSettings&amp;gt;
&amp;lt;asp:add key=&quot;SiteUrl&quot; value=&quot;http://localhost:1371/CustomeErrorHandling&quot;/&amp;gt;
&amp;lt;asp:add key=&quot;ErrorHandling&quot; value=&quot;Application&quot;/&amp;gt;
&amp;lt;asp:/appSettings&amp;gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
And add in the &amp;lt;httpModules&amp;gt; section&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&amp;lt;asp:add type=&quot;ErrorPage&quot; name=&quot;ErrorPageHandler&quot;&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
8.Now run the application&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKzIKqgehS_wMuCNik-_6zYu6J_2qmFs64WUz2NC_39wyMneOLeo5vDrDNkGQEAYwG2OjviCJWMNc1oMtnLIzfX8TEjB6NUmoGV6APPmZ5D4FB9ZDgkGDoqhO5xjITK_JOpqD7YgySwto/s1600/1.JPG&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;388&quot; id=&quot;BLOGGER_PHOTO_ID_5452076734502576594&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKzIKqgehS_wMuCNik-_6zYu6J_2qmFs64WUz2NC_39wyMneOLeo5vDrDNkGQEAYwG2OjviCJWMNc1oMtnLIzfX8TEjB6NUmoGV6APPmZ5D4FB9ZDgkGDoqhO5xjITK_JOpqD7YgySwto/s640/1.JPG&quot; style=&quot;display: block; height: 243px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
9.Click on the Show Error button, then the error will be show in the following manner.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRPbOsVa61d1qzVR6fR9dHsEK5lDUbG8romoASrbQ4V1wB3fT1T9Nz8cL7kI9XJV9-NRZLT7jZUpyrkwWc94Poh9h-JrNbEQ2_VUZeBvskgOEB6-FdMzRr-yHhXKTFHJaaNs-_nAYUyQo/s1600/2.JPG&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;388&quot; id=&quot;BLOGGER_PHOTO_ID_5452076907595199234&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRPbOsVa61d1qzVR6fR9dHsEK5lDUbG8romoASrbQ4V1wB3fT1T9Nz8cL7kI9XJV9-NRZLT7jZUpyrkwWc94Poh9h-JrNbEQ2_VUZeBvskgOEB6-FdMzRr-yHhXKTFHJaaNs-_nAYUyQo/s640/2.JPG&quot; style=&quot;display: block; height: 243px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Note:&lt;/span&gt; Do not use try..catch block in the code behind page, If you use then custome error will not work. i.e. If I write the code in the following manner &lt;br /&gt;
&lt;div style=&quot;background: #ffffd2; border-bottom: #ffa500 1px dotted; border-left: #ffa500 1px dotted; border-right: #ffa500 1px dotted; border-top: #ffa500 1px dotted; font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;try
{
int a = 1, b = 0;
int c = a / b;
}
catch
{ }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Then the error page will not show.&lt;br /&gt;
&lt;br /&gt;
Download : &lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedicon.aspx/.Public/CustomeErrorExample.zip&quot; style=&quot;background-color: #fcfcfc; height: 115px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 98px;&quot; title=&quot;Preview&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/169693569783065924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2010/03/custom-error-handling-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/169693569783065924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/169693569783065924'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2010/03/custom-error-handling-in-aspnet.html' title='Custom Error Handling in ASP.NET'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKzIKqgehS_wMuCNik-_6zYu6J_2qmFs64WUz2NC_39wyMneOLeo5vDrDNkGQEAYwG2OjviCJWMNc1oMtnLIzfX8TEjB6NUmoGV6APPmZ5D4FB9ZDgkGDoqhO5xjITK_JOpqD7YgySwto/s72-c/1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-7212101758340537062</id><published>2009-08-27T23:07:00.009+05:30</published><updated>2009-08-27T23:30:24.530+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Use header checkbox in GridView in ASP.NET</title><content type='html'>Here I am going to give you a very easy steps to use the checkbox in the header of the Gridview in ASP.NET. &lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZccJKjPxKHlf7WDHwigpSxrnYRSsh3ncI0t7T6Pi5QrZRsLC7AHTc7NJyk8nNb0PFvMlIdOsTCX0QKgNFwF6bW5ZQ7hyphenhyphen473547EJEiwzqDEys-6DZcjboxATkf-0G939wOBWl8PnNOo/s1600-h/1.PNG&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 135px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZccJKjPxKHlf7WDHwigpSxrnYRSsh3ncI0t7T6Pi5QrZRsLC7AHTc7NJyk8nNb0PFvMlIdOsTCX0QKgNFwF6bW5ZQ7hyphenhyphen473547EJEiwzqDEys-6DZcjboxATkf-0G939wOBWl8PnNOo/s400/1.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5374699238225359378&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Steps: &lt;br /&gt;1.	I have created a class “Customer” and fill the gridview with the collection of customers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; MIN-WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 0.9em; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    int id;&lt;br /&gt;    string name;&lt;br /&gt;    string city;&lt;br /&gt;&lt;br /&gt;    public string City&lt;br /&gt;    {&lt;br /&gt;        get { return city; }&lt;br /&gt;        set { city = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public string Name&lt;br /&gt;    {&lt;br /&gt;        get { return name; }&lt;br /&gt;        set { name = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int Id&lt;br /&gt;    {&lt;br /&gt;        get { return id; }&lt;br /&gt;        set { id = value; }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Customer(int customerID, string customerName, string customerCity)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        id = customerID;&lt;br /&gt;        name = customerName;&lt;br /&gt;        city = customerCity;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2.Created a gridview in the default.aspx page &lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; MIN-WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 0.9em; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;&lt;br /&gt; &amp;#60asp:GridView ID=&quot;dgridCustomer&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot; Width=&quot;592px&quot;&amp;#62;&lt;br /&gt; &amp;#60Columns&amp;#62;&lt;br /&gt;   &amp;#60asp:TemplateField&amp;#62;&lt;br /&gt;    &amp;#60HeaderTemplate&amp;#62;&lt;br /&gt;      &amp;nbsp;&lt;br /&gt;      &amp;#60input type=&quot;checkbox&quot; class=&quot;chkHeader&quot; id=&quot;HeaderCheckBox&quot;  onclick=&quot;javascript:Check(this)&quot;                                        name=&quot;ItemCheckBox&quot; runat=&quot;Server&quot; /&amp;#62;&lt;br /&gt;    &amp;#60/HeaderTemplate&amp;#62;&lt;br /&gt;       &amp;#60ItemTemplate&amp;#62;&lt;br /&gt;         &amp;#60input type=&quot;checkbox&quot; value=&#39;&amp;#60%# DataBinder.Eval(Container.DataItem, &quot;Id&quot;) %&amp;#62;&#39; class=&quot;chkItem&quot;&lt;br /&gt;         id=&quot;ItemCheckBox&quot; name=&quot;ItemCheckBox&quot; runat=&quot;Server&quot; /&amp;#62;&lt;br /&gt;       &amp;#60/ItemTemplate&amp;#62;&lt;br /&gt;    &amp;#60/asp:TemplateField&amp;#62;&lt;br /&gt;    &amp;#60asp:TemplateField HeaderText=&quot;Name&quot;&amp;#62;&lt;br /&gt;        &amp;#60ItemTemplate&amp;#62;&lt;br /&gt;           &amp;#60%# DataBinder.Eval(Container.DataItem, &quot;Name&quot;) %&amp;#62;&lt;br /&gt;        &amp;#60/ItemTemplate&amp;#62;&lt;br /&gt;    &amp;#60/asp:TemplateField&amp;#62;&lt;br /&gt;    &amp;#60asp:TemplateField HeaderText=&quot;City&quot;&amp;#62;&lt;br /&gt;        &amp;#60ItemTemplate&amp;#62;&lt;br /&gt;          &amp;#60%# DataBinder.Eval(Container.DataItem, &quot;City&quot;) %&amp;#62;&lt;br /&gt;        &amp;#60/ItemTemplate&amp;#62;&lt;br /&gt;    &amp;#60/asp:TemplateField&amp;#62;&lt;br /&gt;  &amp;#60/Columns&amp;#62;&lt;br /&gt;&amp;#60/asp:GridView&amp;#62;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;3.To fill the gridview following functions has been used in default.aspx.cs file&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; MIN-WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 0.9em; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        lblMsg.Visible = false;&lt;br /&gt;&lt;br /&gt;        if (IsPostBack) return;&lt;br /&gt;&lt;br /&gt;        FillCustomer();&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void FillCustomer()&lt;br /&gt;    {&lt;br /&gt;        List&lt;Customer&gt; obCustomers = new List&lt;Customer&gt;();&lt;br /&gt;&lt;br /&gt;        obCustomers = GetAllCustomers();&lt;br /&gt;&lt;br /&gt;        Session[&quot;Customers&quot;] = obCustomers;&lt;br /&gt;&lt;br /&gt;        dgridCustomer.DataSource = obCustomers;&lt;br /&gt;        dgridCustomer.DataBind();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private List&lt;Customer&gt; GetAllCustomers()&lt;br /&gt;    {&lt;br /&gt;        List&lt;Customer&gt; obCustomers = new List&lt;Customer&gt;();&lt;br /&gt;&lt;br /&gt;        Customer obCustomer = new Customer(1, &quot;name1&quot;, &quot;city1&quot;);&lt;br /&gt;        obCustomers.Add(obCustomer);&lt;br /&gt;&lt;br /&gt;        obCustomer = new Customer(2, &quot;name2&quot;, &quot;city2&quot;);&lt;br /&gt;        obCustomers.Add(obCustomer);&lt;br /&gt;&lt;br /&gt;        obCustomer = new Customer(3, &quot;name3&quot;, &quot;city3&quot;);&lt;br /&gt;        obCustomers.Add(obCustomer);&lt;br /&gt;&lt;br /&gt;        obCustomer = new Customer(4, &quot;name4&quot;, &quot;city4&quot;);&lt;br /&gt;        obCustomers.Add(obCustomer);&lt;br /&gt;&lt;br /&gt;        obCustomer = new Customer(5, &quot;name5&quot;, &quot;city5&quot;);&lt;br /&gt;        obCustomers.Add(obCustomer);&lt;br /&gt;&lt;br /&gt;        return obCustomers;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4.When header checkbox of the gridview is clicked then all the item checkboxes should be checked and if header checkbox is unchecked then all the item checkboxes should be unchecked. To do this I have created a javascript function and added in the default.aspx page.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; MIN-WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 0.9em; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt; function Check(varchk)&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;               var objInputs = document.getElementsByTagName(&#39;input&#39;)&lt;br /&gt;               for(i=0;i&lt;objInputs.length;i++)&lt;br /&gt;               {&lt;br /&gt;                  if(varchk.checked)&lt;br /&gt;                    {&lt;br /&gt;                        if(objInputs[i].className===&#39;chkItem&#39;)&lt;br /&gt;                        {&lt;br /&gt;                            objInputs[i].checked=true;&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                    {&lt;br /&gt;                        if(objInputs[i].className===&#39;chkItem&#39;)&lt;br /&gt;                        {&lt;br /&gt;                            objInputs[i].checked=false;&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;               }&lt;br /&gt;            }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;5.Remove all the checked record from the gridview, the following method has been used &lt;br /&gt;in the Remove button.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; MIN-WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 0.9em; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt; protected void btnRemove_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        List&lt;Customer&gt; obCollection = (List&lt;Customer&gt;)Session[&quot;Customers&quot;];&lt;br /&gt;&lt;br /&gt;        foreach (GridViewRow row in dgridCustomer.Rows)&lt;br /&gt;        {&lt;br /&gt;            System.Web.UI.HtmlControls.HtmlInputCheckBox chk = (System.Web.UI.HtmlControls.HtmlInputCheckBox)dgridCustomer.Rows[row.RowIndex].FindControl(&quot;ItemCheckBox&quot;);&lt;br /&gt;&lt;br /&gt;            if (chk.Checked)&lt;br /&gt;            {&lt;br /&gt;                Customer obCustomer = obCollection.Find(delegate(Customer obj) { return obj.Id == Convert.ToInt32(chk.Value); });&lt;br /&gt;&lt;br /&gt;                obCollection.Remove(obCustomer);&lt;br /&gt;&lt;br /&gt;                lblMsg.Visible = true;&lt;br /&gt;&lt;br /&gt;                lblMsg.Text = &quot;Customer information deleted successfully.&quot;;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        dgridCustomer.DataSource = obCollection;&lt;br /&gt;        dgridCustomer.DataBind();&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Below method is used to find the checked item from the collection.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; MIN-WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 0.9em; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;Customer obCustomer = obCollection.Find(delegate(Customer obj) { return obj.Id == Convert.ToInt32(chk.Value); });&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Download : &lt;iframe scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; frameborder=&quot;0&quot; style=&quot;width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedrowdetail.aspx/.Public/CheckboxInGridViewHeader.zip&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/7212101758340537062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/08/use-header-checkbox-in-gridview-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7212101758340537062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7212101758340537062'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/08/use-header-checkbox-in-gridview-in.html' title='Use header checkbox in GridView in ASP.NET'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTZccJKjPxKHlf7WDHwigpSxrnYRSsh3ncI0t7T6Pi5QrZRsLC7AHTc7NJyk8nNb0PFvMlIdOsTCX0QKgNFwF6bW5ZQ7hyphenhyphen473547EJEiwzqDEys-6DZcjboxATkf-0G939wOBWl8PnNOo/s72-c/1.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-7488772187102571713</id><published>2009-08-01T17:07:00.007+05:30</published><updated>2010-08-10T11:52:34.996+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>Decorator Pattern</title><content type='html'>There are numbers of way we used in the designing software application. These ways are called Patterns, and in the object-oriented programming, we use so many patterns. Decorator Pattern is a design pattern in the object-oriented programming that allows us to add the new functionality in the existing class dynamically. To understand let me give you a simple example. Suppose you have an application in ASP.NET and SQL Server.&lt;br /&gt;
In your business logic, you have written all you logics. i.e.&lt;br /&gt;
&lt;br /&gt;
1. Insert()&lt;br /&gt;
2. Update()&lt;br /&gt;
3. Delete&lt;br /&gt;
4. Get()&lt;br /&gt;
&lt;br /&gt;
In these logics, you have written the code according to your SQL Server fetching technique. You have used System.Data.SqlClient and open/close the connection with SQL Server and done all the insert/update/delete opertaions with SQL Server. You have also called this business logic objects into your UI layer. Now your application is fully dependent in SQL Server. The problem start now, you have a single application where you have done your all effort with the SQL Server and the new requirement is you have to also provide the support of the Microsoft Access with the same database and UI. Then what will you do? You have to create the another business logic with the Microsoft Access as well as have to change all the logic of UI layer because it is accessing the SQL Server business layer logic right now. It will force you rethink again in your design pattern. In such type of situation Decorator Pattern help you to get up. Let me make it simpler. Suppose, I have an asp.net .aspx page where I have to show all products information. Remember we have two databases one is in SQL Server, another is in Microsoft Access, and we have to write the code in a single UI. At the run time, we can decide which database we have to use. First, I will create an interface IProduct. (Here I am using a console application.)&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;public interface IProduct
{
bool Insert(int id, string name);
bool Update(int id, string name);
bool Delete(int id);
string GetRecords();
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Then I have to create a Product class which will contains all the operations with SQL Server database. This Product class will inherits the IProduct interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;public class ProductSQLServer : IProduct 
{
int id = 10;
string name = &quot;SQL Server&quot;;

#region IProduct Members

public bool Insert(int id, string name)
{

//insert logic

return true;

}

public bool Update(int id, string name)
{
//upate logic
return true;
}

public bool Delete(int id)
{
//delete login
return true;
}

public string GetRecords()
{
return &quot;sql server : id=&quot; + id + &quot; name=&quot; + name ;
}

#endregion

}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;public class ProductMicrosoftAccess : IProduct
{
int id = 10;
string name = &quot;MicrosoftAccess&quot;;

#region IProduct Members

public bool Insert(int id, string name)
{
//insert into the microsoft access
return true;
}

public bool Update(int id, string name)
{
//update in the microsoft access
return true;
}

public bool Delete(int id)
{
//delete from the microsoft access
return true;
}

public string GetRecords()
{
return &quot;MicrosoftAccess : id=&quot; + id + &quot; name=&quot; + name ;
}

#endregion
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Now in the UI layer we can decide in the run time what type of object (SQL Server/Access) need to be accessed.&lt;br /&gt;
&lt;br /&gt;
In the view product.aspx page I can decide whether I want to create the object of ProductMicrosoftAccess class or ProductSQLServer class.&lt;br /&gt;
For that you have to use the IProduct interface&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 255, 210); border: 1px dotted rgb(255, 165, 0); font-family: tahoma; font-size: 0.9em; font-weight: bold; min-width: 95%; padding: 3px;&quot;&gt;&lt;pre&gt;static void Main(string[] args)
{
IProduct  obOperation = new ProductMicrosoftAccess();

Console.WriteLine(obOperation.GetRecords());

obOperation = new ProductSQLServer();

Console.WriteLine(obOperation.GetRecords());


Console.ReadLine();
}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
You can choose the type of database by setting the key in your web.config file or any configuration file.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOl35JykdBLr9ANSCqPs59K2HyoqiEruimJSFaDCxu2hON4IdCmr_iFup-2218jlioqLUWxWpMtmuZB5VE3Ww9GBOOqu2HP3xQuseXZV0Hq3S7mPpgJaPjPUUO0AlPKDNadbK_K2TzPdo/s1600-h/Decorator+Pattern.PNG&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5364963371485479314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOl35JykdBLr9ANSCqPs59K2HyoqiEruimJSFaDCxu2hON4IdCmr_iFup-2218jlioqLUWxWpMtmuZB5VE3Ww9GBOOqu2HP3xQuseXZV0Hq3S7mPpgJaPjPUUO0AlPKDNadbK_K2TzPdo/s400/Decorator+Pattern.PNG&quot; style=&quot;cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 500px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Download : &lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedrowdetail.aspx/.Public/DecoratorPattern.zip&quot; style=&quot;background-color: white; border: 1px solid rgb(221, 229, 233); height: 66px; margin: 3px; padding: 0pt; width: 240px;&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/7488772187102571713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/08/decorator-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7488772187102571713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7488772187102571713'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/08/decorator-pattern.html' title='Decorator Pattern'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOl35JykdBLr9ANSCqPs59K2HyoqiEruimJSFaDCxu2hON4IdCmr_iFup-2218jlioqLUWxWpMtmuZB5VE3Ww9GBOOqu2HP3xQuseXZV0Hq3S7mPpgJaPjPUUO0AlPKDNadbK_K2TzPdo/s72-c/Decorator+Pattern.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-820001837553715404</id><published>2009-07-20T16:04:00.003+05:30</published><updated>2009-08-06T18:08:32.108+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>ADO.NET Entity Framework</title><content type='html'>&lt;strong&gt;Introducing the ADO.NET Entity Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;During the development with the database and ADO.NET, we use some traditional way. First we create the database tables and their relationships and then create the classes in the code for business layer. We write our business logic in these classes and performs different operations on the database though these classes. Most of the developers have to do the complex code to move the data between the application and the database. However, to write such type of the code develops must have the database knowledge. In this type of development we generally do not care about the database concepts in our code. Now the Microsoft has introduced the concept of Entity Framework Model where it deals with the database tables as en entity and allows us to write and maintain the code according to the database concepts. Using the entity relationship modeling, developers create the conceptual model of the data and write their code against this model. So we can say “ADO.NET Entity Framework Model allows you to deal with database concepts in your code.&quot;&lt;br /&gt;ADO.NET Entity framework intended to make the development easier and more effective for object-oriented application to work with data.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-GD6n3mg94EH_UPzJ0zYN4thffbFsVZHTN-d_M6ZFemDVpuNrHakfd6Uxk1TRF16Xtyvk7BCeKYOyX5J8RsYDGNL3tmlUegc1a8ocwnA-cT5U5K4ar52GNZ0A2OjbUk95jmrH2WLhw-8/s1600-h/1.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360490720762715170&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 234px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-GD6n3mg94EH_UPzJ0zYN4thffbFsVZHTN-d_M6ZFemDVpuNrHakfd6Uxk1TRF16Xtyvk7BCeKYOyX5J8RsYDGNL3tmlUegc1a8ocwnA-cT5U5K4ar52GNZ0A2OjbUk95jmrH2WLhw-8/s400/1.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Entity Framework architecture&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqmJAjmuLqTjD14W8MyixwaKhA7818pjrMIoxo6q_IhAS5JFmPpoyh9ZnCTRcobIMIw1udyEaBexlsGSDHrXhcg8zZkQdZ3yvqN6CdAlgv_8DZeCq4NHqqf-KUQmicXR3ziVDppxL8IQY/s1600-h/2.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360490791451942258&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 171px; CURSOR: hand; HEIGHT: 370px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqmJAjmuLqTjD14W8MyixwaKhA7818pjrMIoxo6q_IhAS5JFmPpoyh9ZnCTRcobIMIw1udyEaBexlsGSDHrXhcg8zZkQdZ3yvqN6CdAlgv_8DZeCq4NHqqf-KUQmicXR3ziVDppxL8IQY/s400/2.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The ADO.NET Entity Framework is a layered framework which abstracts the relational schema of a database and presents a conceptual model.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Data Source:&lt;/strong&gt; The bottom layer is the data which can be stored in one or many databases.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Data Providers:&lt;/strong&gt; The data will be accessed by a ADO.NET data provider. At this moment only SQL Server is supported but in the near future there will be data providers for Oracle, MySQL, DB2, Firebird, Sybase, VistaDB, SQLite.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Entity Data Model (EDM):&lt;/strong&gt; The Entity Data Model consists of 3 parts :&lt;br /&gt;• &lt;strong&gt;Conceptual schema definition language (CSDL) :&lt;/strong&gt; Declare and define entities, associations, inheritance, ... Entity classes are generated from this schema.&lt;br /&gt;• &lt;strong&gt;Store schema definition language (SSDL) :&lt;/strong&gt; Metadata describing the storage container (=database) that persists data.&lt;br /&gt;• &lt;strong&gt;Mapping specification language (MSL) :&lt;/strong&gt; Maps the entities in the CSDL file to tables described in the SSDL file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Entity Client:&lt;/strong&gt; EntityClient is an ADO.NET managed provider that supports accessing data described in an Entity Data Model. It is similar to SQLClient, OracleClient and others. It provides several components like EntityCommand, EntityConnection and EntityTransaction.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Object Services:&lt;/strong&gt; This component enables you to query, insert, update, and delete data, expressed as strongly-typed CLR objects that are instances of entity types. Object Services supports both Entity SQL and LINQ to Entities queries.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Entity SQL (ESQL):&lt;/strong&gt; Entity SQL is a derivative of Transact-SQL, designed to query and manipulate entities defined in the Entity Data Model. It supports inheritance and associations. Both Object Services components and Entity Client components can execute Entity SQL statements.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;LINQ to Entities:&lt;/strong&gt; This is a strong-typed query language for querying against entities defined in the Entity Data Model.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;DATABASE MODELING LAYERS&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Common design pattern for data modeling is the division of the data model into three parts: a conceptual model, a logical model, and a physical model&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.Physical Data Model:&lt;/strong&gt; This model describes how data are represented in the physical resources such as memory, wire or disk. The vocabulary of concepts discussed at this layer includes record formats, file partitions and groups, heaps, and indexes. The physical model is typically invisible to the application –applications&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.Logical/Relational Data Model: &lt;/strong&gt; The concepts discussed at the logical level include tables, rows, and primary key-foreign key constraints, and normalization.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAKL2PGBSR2zIR6fj3-dwnmFc7voYtx134qb2UtQ-2dbf_K6CU4KeOGzhynFFwbcqKkARSetMrDprH1B3x0-_k5odLicaBURQ6xEvrr-jcqFxkoBTkKLQKrhAwjgLbDFOi74lE_ZPkNu4/s1600-h/3.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360490837931940450&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 358px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAKL2PGBSR2zIR6fj3-dwnmFc7voYtx134qb2UtQ-2dbf_K6CU4KeOGzhynFFwbcqKkARSetMrDprH1B3x0-_k5odLicaBURQ6xEvrr-jcqFxkoBTkKLQKrhAwjgLbDFOi74lE_ZPkNu4/s400/3.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.Conceptual Model:&lt;/strong&gt; The conceptual model captures the core information entities from the problem domain and their relationships. conceptual model is the Entity-Relationship Model. UML is a more recent example of a conceptual model&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqWZGcqfRjQukSRNIZ-LiS6XqU0IL953cXqDi44pGgI7G7PVpUl8zmW_5HcEIq42OXNlk7j23zimjgon_Na7NJA7Ij_ftf4dg9H7o4yptohAEpgl9AhHmdvbJPbmrprCAFCloNiFFJhzg/s1600-h/4.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360490894630102722&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 299px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqWZGcqfRjQukSRNIZ-LiS6XqU0IL953cXqDi44pGgI7G7PVpUl8zmW_5HcEIq42OXNlk7j23zimjgon_Na7NJA7Ij_ftf4dg9H7o4yptohAEpgl9AhHmdvbJPbmrprCAFCloNiFFJhzg/s400/4.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why Entity Framework is used/ADO.NET Entity Data Model&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Entity Framework maps relational tables, columns, and foreign key constraints in logical models to entities and relationships in conceptual models.  The Entity Data Model tools generate extensible data classes based on the conceptual model. These classes are partial classes that can be extended with additional members that the developer adds. The classes that are generated for a particular conceptual model derive from base classes that provide Object Services for materializing entities as objects and for tracking and saving changes. Developers can use these classes to work with the entities and relationships as objects related by navigation properties.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Object Services: &lt;/strong&gt;Object Services is a component of the Entity Framework that enables you to query, insert, update, and delete data, expressed as strongly typed CLR objects that are instances of entity types. Object Services supports both Language-Integrated Query (LINQ) and Entity SQL queries against types that are defined in an Entity Data Model (EDM). &lt;br /&gt; Entity framework enables application to access and change the data that is represented as entities and relationship in the conceptual model. Object Services uses the EDM to translate object queries against entity types that are represented in the conceptual model into data source-specific queries. Query results are materialized into objects that Object Services manages. The Entity Framework provides the following ways to query an EDM and return objects:&lt;br /&gt;&lt;br /&gt;• LINQ to Entities - provides Language-Integrated Query (LINQ) support for querying entity types that are defined in a conceptual model. &lt;br /&gt;&lt;br /&gt;• Entity SQL - a storage-independent dialect of SQL that works directly with entities in the conceptual model and that supports EDM features such as inheritance and relationships. Entity SQL is used both with object queries and queries that are executed by using the EntityClient provider. For more information, see Entity SQL Overview.&lt;br /&gt;&lt;br /&gt;• Query builder methods - enables you to construct Entity SQL queries using LINQ-style query methods. For more information, see Query Builder Methods (Entity Framework).&lt;br /&gt;&lt;br /&gt;The Entity Framework includes the EntityClient(The EntityClient provider is a data provider used by Entity Framework applications to access data described in an Entity Data Model (EDM)) data provider. This provider manages connections, translates entity queries into data source-specific queries, and returns a data reader that Object Services uses to materialize entity data into objects. When object materialization is not required, the EntityClient provider can also be used like a standard ADO.NET data provider by enabling applications to execute Entity SQL queries and consume the returned read-only data reader.&lt;br /&gt;The following mythology is used generally&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGdWYhBgf_WxPmq5VM4ieOIAbTA70rm-kk9P2YKF-1xb0sIqeWXh2l5ogQPE4i8UPvyWA5OF04NgnKWMHf05KKWTzVk_QH8pHh9wyYKRT3vdwmkIH5P_BDctJs4I-43SF_zU2cX7DS-Go/s1600-h/5.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360490972423147554&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 119px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGdWYhBgf_WxPmq5VM4ieOIAbTA70rm-kk9P2YKF-1xb0sIqeWXh2l5ogQPE4i8UPvyWA5OF04NgnKWMHf05KKWTzVk_QH8pHh9wyYKRT3vdwmkIH5P_BDctJs4I-43SF_zU2cX7DS-Go/s400/5.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you use the Entity Framework concept then the result would be&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4tXrGwmj9ff8v8dPFEbdL__z9pW1wnXFQF_nWeeX5abm3ELdC-ueQWUbXmcqrm8lP90JPTSpFR00O2XxMOqbEFQWBFULr7H8DThbNC-a1DArwPfsMjx2FRUkDIcJh5ond6rnW-SVukq0/s1600-h/6.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491024241434658&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 319px; CURSOR: hand; HEIGHT: 233px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4tXrGwmj9ff8v8dPFEbdL__z9pW1wnXFQF_nWeeX5abm3ELdC-ueQWUbXmcqrm8lP90JPTSpFR00O2XxMOqbEFQWBFULr7H8DThbNC-a1DArwPfsMjx2FRUkDIcJh5ond6rnW-SVukq0/s400/6.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thus we can say the ADO.NET Entity Framework provide the abstraction layer between the logical data model and application domain. When you will generate the logical tables to entity data diagram, it combines multiple data tables to one entity. &lt;br /&gt;&lt;br /&gt;NET 3.5 SP1 includes the new ADO.NET Entity Framework, which allows developers to define a higher-level Entity Data Model over their relational data, and then program in terms of this model.  Concepts like inheritance, complex types and relationships can be modeled using it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Scheme file (EDMX)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If can also see the EDMS file as XML. To see the xml file open the solution explorer,  right click on  .EDMS file, select Open With XML Editor.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdDL1qjK6J7rk7sde6ZJkVDgQYHUhmfNT9rZKufrBTdX4DxXa6gL1ObOlLj7qqTt0L9N57poiLknme4MfmCKYrLEfOyZY5c6x-5sbXu-5pT7hgUn21qfo6aZsd5UeRC6ZfU5p6F8jrq-A/s1600-h/7.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491069020273922&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 301px; CURSOR: hand; HEIGHT: 203px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdDL1qjK6J7rk7sde6ZJkVDgQYHUhmfNT9rZKufrBTdX4DxXa6gL1ObOlLj7qqTt0L9N57poiLknme4MfmCKYrLEfOyZY5c6x-5sbXu-5pT7hgUn21qfo6aZsd5UeRC6ZfU5p6F8jrq-A/s400/7.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now you can see here 3 sections&lt;br /&gt;1. Conceptual Model (CSDL) &lt;br /&gt;2. Storage Model (SSDL)&lt;br /&gt;3. Mapping (MSL)&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;&amp;#60;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;#62;&lt;br /&gt;&amp;#60;edmx:Edmx Version=&quot;1.0&quot; xmlns:edmx=&quot;http://schemas.microsoft.com/ado/2007/06/edmx&quot;&amp;#62;&lt;br /&gt;  &amp;#60;edmx:Runtime&amp;#62;&lt;br /&gt;    &amp;#60;!-- CSDL content --&amp;#62;&lt;br /&gt;    &amp;#60;edmx:ConceptualModels&amp;#62;&lt;br /&gt;      &amp;#60;Schema Namespace=&quot;NorthwindModel&quot; Alias=&quot;Self&quot; xmlns=&quot;http://schemas.microsoft.com/ado/2006/04/edm&quot;&amp;#62;&lt;br /&gt;        &amp;#60;EntityContainer Name=&quot;NorthwindEntities&quot;&amp;#62;&lt;br /&gt;          &amp;#60;EntitySet Name=&quot;Employees&quot; EntityType=&quot;NorthwindModel.Employee&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;AssociationSet Name=&quot;FK_Orders_Employees&quot; Association=&quot;NorthwindModel.FK_Orders_Employees&quot;&amp;#62;&lt;br /&gt;            &amp;#60;End Role=&quot;Employees&quot; EntitySet=&quot;Employees&quot; /&amp;#62;&lt;br /&gt;            &amp;#60;End Role=&quot;Orders&quot; EntitySet=&quot;Orders&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;/AssociationSet&amp;#62;&lt;br /&gt;        &amp;#60;/EntityContainer&amp;#62;&lt;br /&gt;        &amp;#60;EntityType Name=&quot;Employee&quot;&amp;#62;&lt;br /&gt;          &amp;#60;Documentation&amp;#62;&amp;#60;Summary&amp;#62;Employee entity which corresponds with the Northwind.Employees table&amp;#60;/Summary&amp;#62;&amp;#60;/Documentation&amp;#62;&lt;br /&gt;          &amp;#60;Key&amp;#62;&lt;br /&gt;            &amp;#60;PropertyRef Name=&quot;EmployeeID&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;/Key&amp;#62;&lt;br /&gt;          &amp;#60;Property Name=&quot;EmployeeID&quot; Type=&quot;Int32&quot; Nullable=&quot;false&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;Property Name=&quot;LastName&quot; Type=&quot;String&quot; Nullable=&quot;false&quot; MaxLength=&quot;20&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;Property Name=&quot;FirstName&quot; Type=&quot;String&quot; Nullable=&quot;false&quot; MaxLength=&quot;10&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;NavigationProperty Name=&quot;Orders&quot; Relationship=&quot;NorthwindModel.FK_Orders_Employees&quot; FromRole=&quot;Employees&quot; ToRole=&quot;Orders&quot; /&amp;#62;&lt;br /&gt;        &amp;#60;/EntityType&amp;#62;&lt;br /&gt;      &amp;#60;/Schema&amp;#62;&lt;br /&gt;    &amp;#60;/edmx:ConceptualModels&amp;#62;&lt;br /&gt; &lt;br /&gt;    &amp;#60;!-- SSDL content --&amp;#62;&lt;br /&gt;    &amp;#60;edmx:StorageModels&amp;#62;&lt;br /&gt;      &amp;#60;Schema Namespace=&quot;NorthwindModel.Store&quot; Alias=&quot;Self&quot; ProviderManifestToken=&quot;09.00.1399&quot; &lt;br /&gt;        xmlns=&quot;http://schemas.microsoft.com/ado/2006/04/edm/ssdl&quot;&amp;#62;&lt;br /&gt;        &amp;#60;EntityContainer Name=&quot;dbo&quot;&amp;#62;&lt;br /&gt;          &amp;#60;EntitySet Name=&quot;Employees&quot; EntityType=&quot;NorthwindModel.Store.Employees&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;AssociationSet Name=&quot;FK_Orders_Employees&quot; Association=&quot;NorthwindModel.Store.FK_Orders_Employees&quot;&amp;#62;&lt;br /&gt;            &amp;#60;End Role=&quot;Employees&quot; EntitySet=&quot;Employees&quot; /&amp;#62;&lt;br /&gt;            &amp;#60;End Role=&quot;Orders&quot; EntitySet=&quot;Orders&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;/AssociationSet&amp;#62;&lt;br /&gt;      &amp;#60;/Schema&amp;#62;&lt;br /&gt;    &amp;#60;/edmx:StorageModels&amp;#62;&lt;br /&gt; &lt;br /&gt;    &amp;#60;!-- C-S mapping content --&amp;#62;&lt;br /&gt;    &amp;#60;edmx:Mappings&amp;#62;&lt;br /&gt;      &amp;#60;Mapping Space=&quot;C-S&quot; xmlns=&quot;urn:schemas-microsoft-com:windows:storage:mapping:CS&quot;&amp;#62;&lt;br /&gt;        &amp;#60;EntityContainerMapping StorageEntityContainer=&quot;dbo&quot; CdmEntityContainer=&quot;NorthwindEntities&quot;&amp;#62;&lt;br /&gt;          &amp;#60;EntitySetMapping Name=&quot;Employees&quot;&amp;#62;&lt;br /&gt;            &amp;#60;EntityTypeMapping TypeName=&quot;IsTypeOf(NorthwindModel.Employee)&quot;&amp;#62;&lt;br /&gt;              &amp;#60;MappingFragment StoreEntitySet=&quot;Employees&quot;&amp;#62;&lt;br /&gt;                &amp;#60;ScalarProperty Name=&quot;EmployeeID&quot; ColumnName=&quot;EmployeeID&quot; /&amp;#62;&lt;br /&gt;                &amp;#60;ScalarProperty Name=&quot;LastName&quot; ColumnName=&quot;LastName&quot; /&amp;#62;&lt;br /&gt;                &amp;#60;ScalarProperty Name=&quot;FirstName&quot; ColumnName=&quot;FirstName&quot; /&amp;#62;&lt;br /&gt;              &amp;#60;/MappingFragment&amp;#62;&lt;br /&gt;            &amp;#60;/EntityTypeMapping&amp;#62;&lt;br /&gt;          &amp;#60;/EntitySetMapping&amp;#62;&lt;br /&gt;          &amp;#60;AssociationSetMapping Name=&quot;FK_Orders_Employees&quot; TypeName=&quot;NorthwindModel.FK_Orders_Employees&quot; StoreEntitySet=&quot;Orders&quot;&amp;#62;&lt;br /&gt;            &amp;#60;EndProperty Name=&quot;Employees&quot;&amp;#62;&lt;br /&gt;              &amp;#60;ScalarProperty Name=&quot;EmployeeID&quot; ColumnName=&quot;EmployeeID&quot; /&amp;#62;&lt;br /&gt;            &amp;#60;/EndProperty&amp;#62;&lt;br /&gt;            &amp;#60;EndProperty Name=&quot;Orders&quot;&amp;#62;&lt;br /&gt;              &amp;#60;ScalarProperty Name=&quot;OrderID&quot; ColumnName=&quot;OrderID&quot; /&amp;#62;&lt;br /&gt;            &amp;#60;/EndProperty&amp;#62;&lt;br /&gt;            &amp;#60;Condition ColumnName=&quot;EmployeeID&quot; IsNull=&quot;false&quot; /&amp;#62;&lt;br /&gt;          &amp;#60;/AssociationSetMapping&amp;#62;&lt;br /&gt;        &amp;#60;/EntityContainerMapping&amp;#62;&lt;br /&gt;      &amp;#60;/Mapping&amp;#62;&lt;br /&gt;    &amp;#60;/edmx:Mappings&amp;#62;&lt;br /&gt;  &amp;#60;/edmx:Runtime&amp;#62;&lt;br /&gt;&amp;#60;/edmx:Edmx&amp;#62;&lt;pre&gt;&lt;/div&gt;&lt;br /&gt;When you build your project, MSBuild will extract the CSDL/SSDL/MSL content from the EDMX file and places these 3 seperate XML files in your project output directory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Model View&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The Model Browser window can be used to visualize the conceptual model and storage model in a well-organized tree hierarchy.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii35mjv1xsydYUhUoKMozrNlIZuFD-jjtUtLC0TVvhDpVlVPt-XXfvATc7atqyTBWd0dfevo3pU9gI8zep45jH7uFpb2Bhj4eJWyuy-zGHGzuJ_FVO7R1Z89ORRR3TQ4rQc8Sks0n6OQY/s1600-h/8.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491115282681266&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 242px; CURSOR: hand; HEIGHT: 362px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii35mjv1xsydYUhUoKMozrNlIZuFD-jjtUtLC0TVvhDpVlVPt-XXfvATc7atqyTBWd0dfevo3pU9gI8zep45jH7uFpb2Bhj4eJWyuy-zGHGzuJ_FVO7R1Z89ORRR3TQ4rQc8Sks0n6OQY/s400/8.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;• Conceptual Model&lt;br /&gt;o Entity Types : Employee&lt;br /&gt;o Associations : FK_Orders_Employees&lt;br /&gt;o Entity Container&lt;br /&gt;  1. Entity Sets : Employees&lt;br /&gt;  2. Association Sets&lt;br /&gt;  3. Function Imports&lt;br /&gt;&lt;br /&gt;• Storage Model&lt;br /&gt;o Tables / Views : Employees&lt;br /&gt;o Stored Procedures&lt;br /&gt;o Constraints&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Generating an Entity Data Model in Your Visual Studio Project&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The very first step you have to generate the Entity Data Model for your database. Here I am using the asp.net web application to create the sample of the Entity Data Mode.&lt;br /&gt;Right click on sample project -&amp;#62; Add -&amp;#62; New Item -&amp;#62; ADO.NET Entity Data Model&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKL5K9ao8rIbV5IpDFBt-mCaEyuY-Zn5j1nqCRfJnhiLdvbOCNJSeb1mNWyWLS4tx3-K5sLit877yb7Ba0Fz04NKfCy68Sazky05-nOL93oby4FigOPwbDM9a93gCPmgplxV-0cuM5XdM/s1600-h/9.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491210424135890&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 396px; CURSOR: hand; HEIGHT: 246px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKL5K9ao8rIbV5IpDFBt-mCaEyuY-Zn5j1nqCRfJnhiLdvbOCNJSeb1mNWyWLS4tx3-K5sLit877yb7Ba0Fz04NKfCy68Sazky05-nOL93oby4FigOPwbDM9a93gCPmgplxV-0cuM5XdM/s400/9.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Changed the model name to EntityDataModel.edmx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK3Nab9v5yCZ8d97HCEhVuNHf2f8jGYgChyphenhyphencAuLFEDSpx0THGELagrx3vowQ4UNz1mlzn_t9eaqnJvxuwd0VdQOpiJUpUjQIgXaLh_1hLCk3EiCyBl1kq4nK4eTgZKE6-6pi0pcZJhvus/s1600-h/10.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491250792786770&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 397px; CURSOR: hand; HEIGHT: 359px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK3Nab9v5yCZ8d97HCEhVuNHf2f8jGYgChyphenhyphencAuLFEDSpx0THGELagrx3vowQ4UNz1mlzn_t9eaqnJvxuwd0VdQOpiJUpUjQIgXaLh_1hLCk3EiCyBl1kq4nK4eTgZKE6-6pi0pcZJhvus/s400/10.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select the Generate from database and click on Next&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiii66j0Xyzj9cIQIBt4_03bzac0VCePIV2SdSDyVN9fa5n8y-RKb_VOYxOu4VTibwlayFF-UBoheXlFXldtJPVxk6qd-KrgahUyoIVDgE-A0H4J6J6l-4kIiL6_ciL9M4bZJ_OjhlgIa8/s1600-h/11.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491297239146642&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 389px; CURSOR: hand; HEIGHT: 352px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiii66j0Xyzj9cIQIBt4_03bzac0VCePIV2SdSDyVN9fa5n8y-RKb_VOYxOu4VTibwlayFF-UBoheXlFXldtJPVxk6qd-KrgahUyoIVDgE-A0H4J6J6l-4kIiL6_ciL9M4bZJ_OjhlgIa8/s400/11.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Select your database connection or create New Connection. And click on Next button&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnapDD9H3YWeDSNzHRe9-NzWaBNImlAzu8sC_CVyhugKfOChcAoknSIDsKZi44GHA5LEamcjl2uhMDb_Cm6cymNbeCJ3ir-CAoKdCrXQhpTckYu2g8khdRNBOMY_vFL_xHG-hN0l_Ab2o/s1600-h/12.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491388429954450&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 363px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnapDD9H3YWeDSNzHRe9-NzWaBNImlAzu8sC_CVyhugKfOChcAoknSIDsKZi44GHA5LEamcjl2uhMDb_Cm6cymNbeCJ3ir-CAoKdCrXQhpTckYu2g8khdRNBOMY_vFL_xHG-hN0l_Ab2o/s400/12.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can select objects (Tables, Vies, Stored Procedures) from this window. Then click on the Finish button. Blow is the graphical representation of the Entity Data Mode (EDM) that is generated by the wizard.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcmvjkqionT-EcWVY8GmKel8TQvUgICVVSJscoYjB4dbiGI7z8hsyVHZBx6G2AuEAhxnbevADMCKTw6VDOq_UeBaMTeDYAJbeF4XP1gBqGbNLKAM7QBfhVl2VKw_XqKCJN5DKQ9ZZWv94/s1600-h/13.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491428365034818&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 243px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcmvjkqionT-EcWVY8GmKel8TQvUgICVVSJscoYjB4dbiGI7z8hsyVHZBx6G2AuEAhxnbevADMCKTw6VDOq_UeBaMTeDYAJbeF4XP1gBqGbNLKAM7QBfhVl2VKw_XqKCJN5DKQ9ZZWv94/s400/13.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here I have created a .aspx page to fetch all the categories from the database with the Entity Framework Model and showing the products in the gridview by the selected category.&lt;br /&gt;The .aspx page is &lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt; &amp;#60;table width=&quot;100%&quot;&amp;#62;&lt;br /&gt;            &amp;#60;tr&amp;#62;&lt;br /&gt;                &amp;#60;td align=&quot;right&quot; &amp;#62;&lt;br /&gt;                    Category :&lt;br /&gt;                &amp;#60;/td&amp;#62;&lt;br /&gt;                &amp;#60;td&amp;#62;&lt;br /&gt;                    &amp;#60;asp:DropDownList ID=&quot;drpCategory&quot; runat=server AutoPostBack=true&lt;br /&gt;                        onselectedindexchanged=&quot;drpCategory_SelectedIndexChanged&quot; &amp;#62;&amp;#60;/asp:DropDownList&amp;#62;&lt;br /&gt;                &amp;#60;/td&amp;#62;&lt;br /&gt;            &amp;#60;/tr&amp;#62;&lt;br /&gt;            &amp;#60;tr&amp;#62;&lt;br /&gt;                &amp;#60;td colspan=&quot;2&quot; align=&quot;center&quot; style=&quot;padding-top:10px&quot; &amp;#62;&lt;br /&gt;                    &amp;#60;asp:GridView ID=&quot;dgridProducs&quot; Width=&quot;90%&quot; runat=server &amp;#62;&amp;#60;/asp:GridView&amp;#62;&lt;br /&gt;                &amp;#60;/td&amp;#62;&lt;br /&gt;            &amp;#60;/tr&amp;#62;&lt;br /&gt;   &amp;#60;/table&amp;#62;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;NORTHWNDEntities obNORTHWNDEntities = new NORTHWNDEntities();&lt;br /&gt;&lt;br /&gt;        protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (IsPostBack) return;&lt;br /&gt;            FillCategories();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void FillCategories()&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                drpCategory.DataSource = obNORTHWNDEntities.Categories;&lt;br /&gt;                drpCategory.DataTextField = &quot;CategoryName&quot;;&lt;br /&gt;                drpCategory.DataValueField = &quot;CategoryID&quot;;&lt;br /&gt;                drpCategory.DataBind();&lt;br /&gt;            }&lt;br /&gt;            catch&lt;br /&gt;            {&lt;br /&gt;                throw;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;        protected void drpCategory_SelectedIndexChanged(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            int categoryID =Convert.ToInt32(drpCategory.SelectedValue);&lt;br /&gt;&lt;br /&gt;            IQueryable&amp;#60;Products&amp;#62; products = from c in obNORTHWNDEntities.Products &lt;br /&gt;                                                where c.Categories.CategoryID ==  categoryID &lt;br /&gt;                                                select c;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            dgridProducs.DataSource = products;&lt;br /&gt;            dgridProducs.DataBind();&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Here obNORTHWNDEntities represent the NORTHWNDEntities context. To fill all the categories into the DrowDownList the FillCategories() is used. To fetch all the product of the selected categories, called the SelectedIndexChanged of the dropdownlist.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6ee7NsLF1aFb4-qh-yuzawrHhOyKdwm14eopVUs2eoID6Fmh0WZo2x5RcI2T1infH_z7yZOYAIwhY9WOB6IX28zsRk_7LPqmxVovVKo-_8skZwfVP_-UKXnrPTFNzS6G9cCvw1rMoK7o/s1600-h/14.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491469767482210&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 244px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6ee7NsLF1aFb4-qh-yuzawrHhOyKdwm14eopVUs2eoID6Fmh0WZo2x5RcI2T1infH_z7yZOYAIwhY9WOB6IX28zsRk_7LPqmxVovVKo-_8skZwfVP_-UKXnrPTFNzS6G9cCvw1rMoK7o/s400/14.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to: Add, Modify, and Delete Objects (Entity Framework)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Here I have created an Employee page where you can add, modify and delete a new employee from the database through the Entity Framework.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp-fPRNFmcy0i2__Cs4jBDzRte47ge3LXnB8tX3OC27WHH3o63EEYU3mbXdKjK9uEa1inDqPoj_orbzX4i1NyWVgCnIeWhIFqmYq1SuSkt7TzaeYrB1LjGKzIESUQaTSXmgRTaF08tmwc/s1600-h/15.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491516960167154&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 244px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp-fPRNFmcy0i2__Cs4jBDzRte47ge3LXnB8tX3OC27WHH3o63EEYU3mbXdKjK9uEa1inDqPoj_orbzX4i1NyWVgCnIeWhIFqmYq1SuSkt7TzaeYrB1LjGKzIESUQaTSXmgRTaF08tmwc/s400/15.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To show all the employees the FillEmployees() has been called on the page load event.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt; private void FillEmployees()&lt;br /&gt;        {&lt;br /&gt;            dgridEmployee.DataSource = obNORTHWNDEntities.Employees;&lt;br /&gt;            dgridEmployee.DataBind();&lt;br /&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;To add the new employee AddNewEmployee() has been used.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt; private void AddNewEmployee()&lt;br /&gt;        {&lt;br /&gt;            Employees obEmployee = new Employees();&lt;br /&gt;&lt;br /&gt;            obEmployee.EmployeeID = -1;&lt;br /&gt;&lt;br /&gt;            obEmployee.FirstName = txtFirstName.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obEmployee.LastName = txtLastName.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obEmployee.City = txtCity.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obEmployee.Country = txtCountry.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obNORTHWNDEntities.AddToEmployees(obEmployee);&lt;br /&gt;&lt;br /&gt;            obNORTHWNDEntities.SaveChanges();&lt;br /&gt;&lt;br /&gt;        }  &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Since this the new employee that’s why the employeeID has been assigned to -1. After assigning all the values to the new employee object it has to be added to the obNORTHWNDEntities context through the AddToEmployees() method. To save the employee to the database SaveChanges() is called.&lt;br /&gt;&lt;br /&gt;For modifying the employee, the EditEmployee() functions has been called. &lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt; private void EditEmployee()&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            Employees obEmployee = new Employees();&lt;br /&gt;&lt;br /&gt;            int employeeId = Convert.ToInt32(hdnEmployeeId.Value);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            //IQueryable&amp;#60;Employees&amp;#62; employees = from c in obNORTHWNDEntities.Employees&lt;br /&gt;            //                                  where c.EmployeeID == employeeId&lt;br /&gt;            //                                  select c;&lt;br /&gt;&lt;br /&gt;            //List&amp;#60;Employees&amp;#62; obCollection = employees.ToList&amp;#60;Employees&amp;#62;();&lt;br /&gt;&lt;br /&gt;            //obEmployee = obCollection[0];&lt;br /&gt;&lt;br /&gt;            //IQueryable&amp;#60;Employees&amp;#62; emp = obNORTHWNDEntities.Employees.Where(&quot;it.EmployeeID=&quot; + employeeId);&lt;br /&gt;&lt;br /&gt;            //obEmployee = emp.First();&lt;br /&gt;&lt;br /&gt;            obEmployee = obNORTHWNDEntities.Employees.Where(&quot;it.EmployeeID=&quot; + employeeId).First();&lt;br /&gt;&lt;br /&gt;            obEmployee.FirstName = txtFirstName.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obEmployee.LastName = txtLastName.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obEmployee.City = txtCity.Text.Trim();&lt;br /&gt;&lt;br /&gt;            obEmployee.Country = txtCountry.Text.Trim();&lt;br /&gt;&lt;br /&gt;            hdnEmployeeId.Value = string.Empty;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            obNORTHWNDEntities.SaveChanges();&lt;br /&gt;        }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;First of all the modified employees information is fatched. &lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;obEmployee = obNORTHWNDEntities.Employees.Where(&quot;it.EmployeeID=&quot; + employeeId).First();&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;you can also use the following code to fetch the employee information &lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;//IQueryable&amp;#60;Employees&amp;#62; employees = from c in obNORTHWNDEntities.Employees&lt;br /&gt;   //                                  where c.EmployeeID == employeeId&lt;br /&gt;   //                                  select c;&lt;br /&gt;&lt;br /&gt;   //List&amp;#60;Employees&amp;#62; obCollection = employees.ToList&amp;#60;Employees&amp;#62;();&lt;br /&gt;&lt;br /&gt;   //obEmployee = obCollection[0];&lt;br /&gt;&lt;br /&gt;After assinging the modified values you need to call the obNORTHWNDEntities.SaveChanges().&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Use stored procedure with ADO.NET Entity Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Create the stored procedure to fetch all the orders of a customer&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;br /&gt;&lt;pre&gt;Create PROCEDURE [dbo].[GetOrderByCustomer] &lt;br /&gt;@CustomerID nchar(5)&lt;br /&gt;AS&lt;br /&gt;SELECT *&lt;br /&gt;FROM Orders&lt;br /&gt;WHERE CustomerID = @CustomerID&lt;br /&gt;ORDER BY OrderID&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2. Now you have to import this stored procedure to your EDM. There are two ways: first you have to regenerate the EDM and import is via the designer, or in second way you can edit the xml file directly. Here we are using the first method.&lt;br /&gt;&lt;br /&gt;a. Right click on the Entity Designer View and click on the Update Model from Database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB1xoygwwjy6ChoDy3rtttbJ8eFdL5FwG_-KtMZJj2IhuDjypuieZlDpqelFMQLcDANswLYqwDzgSMflrp_qUi_jzCJZ0CUmmLoYQn5TYZBflJxmcP5nfzBbcvX_r8FPtiumwwCc1RfIQ/s1600-h/16.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491567061094258&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 194px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB1xoygwwjy6ChoDy3rtttbJ8eFdL5FwG_-KtMZJj2IhuDjypuieZlDpqelFMQLcDANswLYqwDzgSMflrp_qUi_jzCJZ0CUmmLoYQn5TYZBflJxmcP5nfzBbcvX_r8FPtiumwwCc1RfIQ/s400/16.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b. Choose the newly created stored procedure what you want to include.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDitMYMAChxwpTzagVoDuDxSG-df2GKcePdCLa9ETMAi3FEsb_LONvWjhg5tJZ_Mrysuo55GdTftTHR3YXrFWrSeI4dSBR1V08DZum6x_spLsrg9vIjHtNE5RFv2HOwnqhlUuL7qthum0/s1600-h/17.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491607398186114&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 285px; CURSOR: hand; HEIGHT: 258px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDitMYMAChxwpTzagVoDuDxSG-df2GKcePdCLa9ETMAi3FEsb_LONvWjhg5tJZ_Mrysuo55GdTftTHR3YXrFWrSeI4dSBR1V08DZum6x_spLsrg9vIjHtNE5RFv2HOwnqhlUuL7qthum0/s400/17.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Go to the Model Browser and search the newly imported stored procedure &lt;br /&gt;4. Right click on that stored procedure and then click on Create Function Import.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGXrH7PdmVA7s6j49M-QO2UDEWrl5qynVRyAARZgjBAVWaQ7n0AsL1er07nMig_ETFyQn5VPQBEAOVek_uU2uzqj6YjC9-vx_W_QQqoBtz3xImncZOqSx6Y7VvAkcYJSau5DIekSFtrtk/s1600-h/18.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491662164638754&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 268px; CURSOR: hand; HEIGHT: 354px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGXrH7PdmVA7s6j49M-QO2UDEWrl5qynVRyAARZgjBAVWaQ7n0AsL1er07nMig_ETFyQn5VPQBEAOVek_uU2uzqj6YjC9-vx_W_QQqoBtz3xImncZOqSx6Y7VvAkcYJSau5DIekSFtrtk/s400/18.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. A new Add Function Import window will be opened. Here select the Entities to Orders. Since this function returns the order list.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSMkJokddBBnFmuGDTeJWhaZDZ3m7T_Nns4uJLKLIl8N1iWlNtjfvC1JBl3-wMdGpNaHCDO63QOqoaGJXXOz4-Y5cUIMgTm1wzlWFNPcnIf-BrrQqUXKcX2aqrgaIRsku8iRVrXXrvbT0/s1600-h/19.JPG&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 235px; height: 174px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSMkJokddBBnFmuGDTeJWhaZDZ3m7T_Nns4uJLKLIl8N1iWlNtjfvC1JBl3-wMdGpNaHCDO63QOqoaGJXXOz4-Y5cUIMgTm1wzlWFNPcnIf-BrrQqUXKcX2aqrgaIRsku8iRVrXXrvbT0/s400/19.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5360502051042864994&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To fetch all the orders of a customer the above stored procedure is used in the c# code.&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;&lt;br /&gt;   private void FillOrder()&lt;br /&gt;        {&lt;br /&gt;            using (NORTHWNDEntities obNORTHWNDEntities = new NORTHWNDEntities())&lt;br /&gt;            {&lt;br /&gt;                ObjectResult&amp;#60;Orders&amp;#62; objectResultOrder = obNORTHWNDEntities.GetOrderByCustomer(&quot;ALFKI&quot;);&lt;br /&gt;&lt;br /&gt;                dgridOrder.DataSource = objectResultOrder;&lt;br /&gt;                dgridOrder.DataBind();&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Mapping the stored procedure&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Create the stored procedure to insert the new employee&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;BORDER-RIGHT: #ffa500 1px dotted; PADDING-RIGHT: 3px; BORDER-TOP: #ffa500 1px dotted; WIDTH: 95%; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE:10px; BACKGROUND: #ffffd2; PADDING-BOTTOM: 3px; BORDER-LEFT: #ffa500 1px dotted; PADDING-TOP: 3px; BORDER-BOTTOM: #ffa500 1px dotted; FONT-FAMILY: tahoma&quot;&gt;&lt;pre&gt;&lt;br /&gt;CREATE PROCEDURE InsertEmployee&lt;br /&gt;&lt;br /&gt;@FirstName nvarchar(20)&lt;br /&gt;,@LastName nvarchar(20)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO EMPLOYEES&lt;br /&gt;(&lt;br /&gt; FirstName&lt;br /&gt; ,LastName&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;VALUES&lt;br /&gt;(&lt;br /&gt; @FirstName&lt;br /&gt; ,@LastName&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT MAX(EmployeeID) as NewEmployeeID FROM Employees&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;END&lt;br /&gt;GO&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2. Right click on the Employee entity on the EDM and click on Stored Procedure Mapping.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3q0Mh5awIJP3yXFC_CeA1K_0DNtTBe0ePvfXXjxUPfluwUvpvtE2KFu7cJIZ-J1VcjodqCTDDgsEvzvGN-Pz1zMQtW8C6LtN_HXNHB04bAmSsz4MWDuRd2Zw5Cgj7PCBPM2ihvyfn24o/s1600-h/20.JPG&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 185px; height: 251px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3q0Mh5awIJP3yXFC_CeA1K_0DNtTBe0ePvfXXjxUPfluwUvpvtE2KFu7cJIZ-J1VcjodqCTDDgsEvzvGN-Pz1zMQtW8C6LtN_HXNHB04bAmSsz4MWDuRd2Zw5Cgj7PCBPM2ihvyfn24o/s400/20.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5360498220330841810&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you click on that, you will see the Mapping Details window &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyaLnskqq4I5wQJ_d9HQVHiJ_wr_teTSRyFHcyf7jF-3ZPoECgmoNOSynMKcIpizqUKpOX55COa9TVyLSQNASQ57G7iPoteJogob3S3nQpEc1rv9RjVkY88__YC1Bw7waP9XpczXcOrE4/s1600-h/21.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491798119278738&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 67px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyaLnskqq4I5wQJ_d9HQVHiJ_wr_teTSRyFHcyf7jF-3ZPoECgmoNOSynMKcIpizqUKpOX55COa9TVyLSQNASQ57G7iPoteJogob3S3nQpEc1rv9RjVkY88__YC1Bw7waP9XpczXcOrE4/s400/21.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here you can map your insert, update and delete stored procedure. Now you have insertEmployee stored procedure to map this procedure click on the &amp;#60;Select Insert Function&amp;#62;  then select the InsertEmployee stored procedure from the dropdownlist box.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglmborSkwT-z9_y48tVm_sq3LHSFS33RNAavOO7xSnJeKTU1vsSH7Da2mkzKC3Q8Nk6yplrwXZFggxGh3R6QOoI0zcRTeWJzOjRY7LuJueZhFz66RuWUb82PaRvWyNOcILikVHMqJ3ZEQ/s1600-h/22.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5360491838603631346&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 89px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglmborSkwT-z9_y48tVm_sq3LHSFS33RNAavOO7xSnJeKTU1vsSH7Da2mkzKC3Q8Nk6yplrwXZFggxGh3R6QOoI0zcRTeWJzOjRY7LuJueZhFz66RuWUb82PaRvWyNOcILikVHMqJ3ZEQ/s400/22.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Difference between LINQ to SQL and Entity Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;LINQ to SQL is an object-relational mapping (ORM) framework that allows the direct 1-1 mapping of a Microsoft SQL Server database to .NET classes, and query of the resulting objects using LINQ. More specifically, LINQ to SQL has been developed to target a rapid development scenario against Microsoft SQL Server where the database closely resembles the application object model and the primary concern is increased developer productivity.  LINQ2SQL was first released with C# 3.0 and .Net Framework 3.5.&lt;br /&gt;&lt;br /&gt;• LINQ to SQL supports a wide breadth of abstractions&lt;br /&gt;• LINQ to SQL support domain Model&lt;br /&gt;• Linq to SQL is only for SQL&lt;br /&gt;• LINQ to SQL is simple to use&lt;br /&gt;• LINQ to SQL is used for rapid development.&lt;br /&gt;• LINQ to SQL class uses the mapping only for the single table&lt;br /&gt;• LINQ to SQL generate only dbml file&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;LINQ to Entities (ADO.Net Entity Framework) is an ORM (Object Relational Mapper) API which allows for a broad definition of object domain models and their relationships to many different ADO.Net data providers. As such, you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc. ADO.Net Framework was released with the .Net Framework 3.5 SP1.&lt;br /&gt;&lt;br /&gt;• Entity framework supports a high level of abstraction.&lt;br /&gt;• Entity framework support conceptual data mode.&lt;br /&gt;• Entity Framework will have ability to target different database engines in addition to Microsoft SQL Server.&lt;br /&gt;• Entity framework is complex to use.&lt;br /&gt;• Entity framework is slower development but has more capabilities.&lt;br /&gt;• Entity framework map a single class to multipal tables&lt;br /&gt;• Entity framework generate the three xml files csdl, msl and ssdl.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;http://blogs.msdn.com/adonet/archive/2007/05/30/entitysql.aspx&lt;br /&gt;http://msdn.microsoft.com/en-us/library/bb399567.aspx&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; frameborder=&quot;0&quot; style=&quot;width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedrowdetail.aspx/.Public/EntityFramework.zip&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/820001837553715404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/07/adonet-entity-framework.html#comment-form' title='30 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/820001837553715404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/820001837553715404'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/07/adonet-entity-framework.html' title='ADO.NET Entity Framework'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-GD6n3mg94EH_UPzJ0zYN4thffbFsVZHTN-d_M6ZFemDVpuNrHakfd6Uxk1TRF16Xtyvk7BCeKYOyX5J8RsYDGNL3tmlUegc1a8ocwnA-cT5U5K4ar52GNZ0A2OjbUk95jmrH2WLhw-8/s72-c/1.JPG" height="72" width="72"/><thr:total>30</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-7120270001660523231</id><published>2009-05-12T23:28:00.009+05:30</published><updated>2012-03-14T16:06:29.708+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>Read and Write from the xml file with C# / ASP.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;In this article I have created different methods to read and write from the xml files. &lt;br /&gt;
Here are two applications one is class library where I have put all the methods to read and write the xml files and another is a web site. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example-1: Read the xml file&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
Here is a Config.xml file in the XMLFile folder. The structure of the file is &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;
&amp;lt;root&amp;gt;
&amp;lt;!-- site url--&amp;gt;
&amp;lt;SiteUrl&amp;gt; http://www.site.com&amp;lt;/SiteUrl&amp;gt;
&amp;lt;!-- file path--&amp;gt;
&amp;lt;FilePath&amp;gt; c:\\myfolder&amp;lt;/FilePath&amp;gt;
&amp;lt;!-- domain name--&amp;gt;
&amp;lt;DomainName&amp;gt; mydoman.com&amp;lt;/DomainName&amp;gt;
&amp;lt;/root&amp;gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Here I have put some comments also. To read this file I have created a class Configure.cs in the class liberary. &lt;br /&gt;
To read the element of the xml file I have used the document.GetElementsByTagName() method. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;public void GetValues()
{
  XmlDocument document = new XmlDocument();
  XmlNode node = null;
  try
  {
   if (String.IsNullOrEmpty(path))
   {
    return;
   }
  document.Load(path);
  node = document.GetElementsByTagName(&quot;SiteUrl&quot;).Item(0);
  this.siteUrl = node.InnerText;
  node = document.GetElementsByTagName(&quot;FilePath&quot;).Item(0);
  this.FilePath = node.InnerText;
  node = document.GetElementsByTagName(&quot;DomainName&quot;).Item(0);
  this.domainName = node.InnerText;
 }
 catch
 {
  throw;
 }
 finally
 {
  document = null;
  node = null;
 }
}&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5334998465129529826&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyzvkP_fdFjL-Yq_uqNeAiEKIbhVlZPdBAJROSqpS8BJIRrrfjAMsr9roGjtWZZoM1G1dC5xE9Ke4hrFM0P8fw-M1A7G_zfeuCAEXItmkIl6lXwoCDrew-Natw7mjyf6_93GkF9LsLqQM/s400/1.PNG&quot; style=&quot;cursor: hand; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLefC2lrC5pNEwuckILp1riczHvhIyNJeGqqIG_cx5-_Xfiz01wLqYClW1hTydytqrdlLHZJzDgdXewbnL6meKsrRDmzu-iR1w9qLv7OdICOFk9G5-XxXn7EanQDWIfEXlAaFkHp1OirQ/s1600-h/4.PNG&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To write to this file I have created WriteToFile(string filePath, string fileStreamData), where you have to pass the xml file path and data (may be the xml data in string format). For example I have used this function to create the country1. xml file with node &quot;&lt;root&gt;&lt;data&gt;Mydata&lt;/data&gt;&lt;/root&gt;&quot; in the default.aspx.cs page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; width: 95%;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;private void WriteToFile()
{
  ReadWriteXMLClassLib.Configure obConfigure = new ReadWriteXMLClassLib.Configure();

  obConfigure.WriteToFile(Server.MapPath(&quot;XMLFiles/Country1.xml&quot;), &quot;&lt;root&gt;&lt;data&gt;Mydata&lt;/data&gt;&lt;/root&gt;&quot;);

}&lt;/span&gt;&lt;b&gt;
&lt;/b&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example-2: Read the xml file&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
In the previous example there was a no repetition of elements in the file but in this example the xml file structure is different. Here are number of sub nodes or elements (Employee) are more than one and also added the attribute “id” to each sub node. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ? &amp;gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;
&amp;lt; Employees&amp;gt;
&amp;lt; Employee id=&quot;1&quot; &amp;gt;
&amp;lt; Name&amp;gt;Pankaj Saha&amp;lt; /Name&amp;gt;
&amp;lt; Age&amp;gt;26&amp;lt; /Age&amp;gt;
&amp;lt; Address&amp;gt;
&amp;lt; City&amp;gt;Baroda&amp;lt; /City&amp;gt;
&amp;lt; State&amp;gt;Gujaraat&amp;lt; /State&amp;gt;
&amp;lt; /Address&amp;gt;
&amp;lt; /Employee&amp;gt;
&amp;lt; Employee id=&quot;2&quot; &amp;gt;
&amp;lt; Name&amp;gt;Sanjay&amp;lt; /Name&amp;gt;
&amp;lt; Age&amp;gt;27&amp;lt; /Age&amp;gt;
&amp;lt; Address&amp;gt;
&amp;lt; City&amp;gt;Baroda&amp;lt; /City&amp;gt;
&amp;lt; State&amp;gt;Gujaraat&amp;lt; /State&amp;gt;
&amp;lt; /Address&amp;gt;
&amp;lt; /Employee&amp;gt;
&amp;lt; /Employees&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
To read this xml file I have created a class FileOperataion.cs in the class library. If there is only one Employee node then you can read this node value only with ReadXmlSubNodeValue() method. Since there are multiple nodes that’s why I have used ReadXmlNodeList() method to read all the node list of Employees and then fetch each node of Employees and get the value of each node of Employee through the ReadXmlSubNodeValue() method. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5334998523753402226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD0wa3PGEcFCc3C3rykzJReSwwxQ7cldXRULpQoWzrR87CZlPRF2agYqV8Q4zMF-IqRbk6p1s0YaTDkG8vl0ugLR-_ipWKKzlnDGvxZPnXnv0LkS1NOAjo2Vwbti46T_Az7TVraTHX3DQ/s400/2.PNG&quot; style=&quot;cursor: hand; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;br /&gt;
&lt;strong&gt;Example-3: Read the xml file&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
In this example I have used an xml file with the following format &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;
&amp;lt; Countries&amp;gt;
&amp;lt; Country id=&quot;1&quot; &amp;gt;India&amp;lt; /Country&amp;gt;
&amp;lt; Country id=&quot;2&quot; &amp;gt;US&amp;lt; /Country&amp;gt;
&amp;lt; Country id=&quot;3&quot; &amp;gt;Uk&amp;lt; /Country&amp;gt;
&amp;lt; /Countries&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Here each node has an attribute id and each attribute has different values. Now I need to get the node value by their attribute value, for that I have used the ReadXmlNodeList(string fileName, string xmlPath) method to get the node list and then pass each node to ReadXmlSubNodeValue(XmlNode node, string xPath, string attributeName, string attributeValue) method to get values of specific node. For example if you need to get the country which has id=1 then you can use GetCountry(1) method.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;private void GetCountry(int countryId)
{
  ReadWriteXMLClassLib.FileOperataion obFileOperataion = new ReadWriteXMLClassLib.FileOperataion();

  XmlNodeList obNodeList = obFileOperataion.ReadXmlNodeList(Server.MapPath(&quot;XMLFiles/Country.xml&quot;), &quot;//Countries&quot;);

  if (obNodeList != null)
  {
   foreach (XmlNode obNode in obNodeList)
  {
   tdContry.InnerHtml = obFileOperataion.ReadXmlSubNodeValue(obNode, &quot;Country&quot;, &quot;id&quot;, countryId.ToString());
  }
 }
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwbdns2raD4nFS69HEqoeV9VkXkUHe8FwrQ2vcKzQLnWItc7WAm1K4DZxrDLe49WhsnCB8LrnwUVn6nwPUqPZwIbwoA_r35CMMPiALfyDPJT0PAI6SzfRwiBuhMzkgNcYdy93aGtCIJUY/s1600-h/3.PNG&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5334998570601323074&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwbdns2raD4nFS69HEqoeV9VkXkUHe8FwrQ2vcKzQLnWItc7WAm1K4DZxrDLe49WhsnCB8LrnwUVn6nwPUqPZwIbwoA_r35CMMPiALfyDPJT0PAI6SzfRwiBuhMzkgNcYdy93aGtCIJUY/s400/3.PNG&quot; style=&quot;cursor: hand; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;strong&gt;Example-4: Fill gridview from xml file &lt;br /&gt;
&lt;/strong&gt; &lt;br /&gt;
In this example I have used the country.xml file. You can see in the Example4.aspx page where I have used to read the xml file to the dataset and assigned that dataset to the gridview. To read the xml file I have used the following function &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;public DataSet GenerateDataSet(string filePath)
{
  DataSet objDataSet = new DataSet();

  objDataSet.ReadXml(filePath);

  return objDataSet;
}&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In this function you have to pass the xml file path. You can also pass the xml string, for this you have to use the following function &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: #ffffd2; background-image: initial; background-origin: initial; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; width: 95%;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;public DataSet GenerateDataSetWithString(string inputXmlString)
{
  DataSet objDataSet = new DataSet();

  StringReader sr = new StringReader(inputXmlString);

  objDataSet.ReadXml(sr);

  return objDataSet;
}&lt;/span&gt;&lt;b&gt;
&lt;/b&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example-5: Create and update the xml file&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
Here I have implemented a product xml file. The format of the xml file is &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt; Items&amp;gt;
&amp;lt; Item&amp;gt;
&amp;lt; Code&amp;gt;101&amp;lt; /Code&amp;gt;
&amp;lt; Name&amp;gt;Product1&amp;lt; /Name&amp;gt;
&amp;lt; Price&amp;gt;100&amp;lt; /Price&amp;gt;
&amp;lt; Qty&amp;gt;12&amp;lt; /Qty&amp;gt;
&amp;lt; /Item&amp;gt;
&amp;lt; Item&amp;gt;
&amp;lt; Code&amp;gt;102&amp;lt; /Code&amp;gt;
&amp;lt; Name&amp;gt;Product2&amp;lt; /Name&amp;gt;
&amp;lt; Price&amp;gt;100&amp;lt; /Price&amp;gt;
&amp;lt; Qty&amp;gt;12&amp;lt; /Qty&amp;gt;
&amp;lt; /Item&amp;gt;
&amp;lt; /Items&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In this example you can add a new item, update the item and delete the items from the xml file.&lt;br /&gt;
&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5334998621166695602&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLefC2lrC5pNEwuckILp1riczHvhIyNJeGqqIG_cx5-_Xfiz01wLqYClW1hTydytqrdlLHZJzDgdXewbnL6meKsrRDmzu-iR1w9qLv7OdICOFk9G5-XxXn7EanQDWIfEXlAaFkHp1OirQ/s400/4.PNG&quot; style=&quot;cursor: hand; display: block; height: 300px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;br /&gt;
&lt;strong&gt;Example-6: Delete node from xml file / Select Nodes Using XPath Navigation&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
Whenever you need to delete a node from the xml file, first of all you have to find the node with specified value then delete that node from the file. Here the xml format is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;lt; ?xml version=&#39;1.0&#39;?&amp;gt;
&amp;lt; bookstore xmlns=&quot;urn:newbooks-schema&quot;&amp;gt;
&amp;lt; book genre=&quot;novel&quot; style=&quot;hardcover&quot;&amp;gt;
&amp;lt; title&amp;gt;Book1&amp;lt; /title&amp;gt;
&amp;lt; author&amp;gt;
&amp;lt; first-name&amp;gt;Pankaj&amp;lt; /first-name&amp;gt;
&amp;lt; last-name&amp;gt;Saha&amp;lt; /last-name&amp;gt;
&amp;lt; /author&amp;gt;
&amp;lt; price&amp;gt;19.95&amp;lt; /price&amp;gt;
&amp;lt; /book&amp;gt;
&amp;lt; book genre=&quot;novel&quot; style=&quot;other&quot;&amp;gt;
&amp;lt; title&amp;gt;Book2&amp;lt; /title&amp;gt;
&amp;lt; author&amp;gt;
&amp;lt; first-name&amp;gt;Sanjay&amp;lt; /first-name&amp;gt;
&amp;lt; last-name&amp;gt;Singh&amp;lt; /last-name&amp;gt;
&amp;lt; /author&amp;gt;
&amp;lt; price&amp;gt;11.99&amp;lt; /price&amp;gt;
&amp;lt; /book&amp;gt;
&amp;lt; /bookstore&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;public bool DeleteNode(string bookName)
{
  bool isValue = false;

  XmlDocument doc = new XmlDocument();

  try
  {

  string filePath = Server.MapPath(&quot;~/XMLFiles/Example6.xml&quot;);

  doc.Load(filePath);

  XmlNodeList nodeList;

  XmlNode root = doc.DocumentElement;

  nodeList = root.SelectNodes(&quot;descendant::book[title=&#39;&quot; + bookName.ToLower() + &quot;&#39;]&quot;);

  foreach (XmlNode obNode in nodeList)
  {
  root.RemoveChild(obNode);

  break;

  }

  doc.Save(filePath);
 }
 catch
 {
  throw;
 }
 finally
 {
 doc = null;
 }
 return isValue;
}&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example-6: Reading xml file with XmlTextReader&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
XmlTextReader is the best way when you need to read the xml file without loading the xml file in memory. When you have a very large xml file, which takes lots of time to load in the memory or document object and you need to find or read some values from the xml file then you can use the XmlTextReader class. This will help you to read the xml node value very fast. &lt;br /&gt;
Here I am using the Employee.xml file to read the xml file with the help of XmlTextReader class. You need to add the reference of using System.Xml. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt; XmlTextReader reader = new XmlTextReader( Server.MapPath(@&quot;~/XMLFiles/Employee.xml&quot;));

 StringBuilder xmlString = new StringBuilder();

 while (reader.Read())
 {
 switch (reader.NodeType)
 {
  case XmlNodeType.Element: // when node is an element
  xmlString.AppendFormat(&quot;&amp;lt;&quot; + reader.Name );

  //fetch all the attributes of the node
  while (reader.MoveToNextAttribute())
  {
   xmlString.AppendFormat(&quot; &quot; + reader.Name + &quot;=&#39;&quot; + reader.Value + &quot;&#39;&quot;);
  }

  xmlString.AppendFormat (&quot;&amp;gt;&quot;);
  break;
 case XmlNodeType.Text: //fetch the value of xml element
  xmlString.AppendFormat(reader.Value);
 break;
 case XmlNodeType.EndElement: //show the end of the element.
  xmlString.AppendFormat(&quot;&quot;);

 break;
 }
}

 Response.Write(xmlString.ToString());&lt;/span&gt;&lt;span style=&quot;font-size: 0.9em; font-weight: bold;&quot;&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Download:&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedicon.aspx/.Public/ReadWriteXMLExample.zip&quot; style=&quot;background-color: #fcfcfc; height: 115px; padding: 0; width: 98px;&quot; title=&quot;Preview&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/7120270001660523231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/05/read-and-write-from-xml-file-with-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7120270001660523231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/7120270001660523231'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/05/read-and-write-from-xml-file-with-c.html' title='Read and Write from the xml file with C# / ASP.NET'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyzvkP_fdFjL-Yq_uqNeAiEKIbhVlZPdBAJROSqpS8BJIRrrfjAMsr9roGjtWZZoM1G1dC5xE9Ke4hrFM0P8fw-M1A7G_zfeuCAEXItmkIl6lXwoCDrew-Natw7mjyf6_93GkF9LsLqQM/s72-c/1.PNG" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-1065610662955025734</id><published>2009-04-30T23:52:00.005+05:30</published><updated>2012-03-14T11:39:11.770+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Create row at run time in ASP.NET GridView</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Here I have created an ASP.NET GridView example where you can add, delete and update the row in the GridView at run time. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Steps:&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
1. Create a asp.net web application &lt;br /&gt;
&lt;br /&gt;
2. Create a global DataTable globalDataTable &lt;br /&gt;
&lt;br /&gt;
3. To create a DataTable first time I have created the following function &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
private DataTable CreateDataTable()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; DataTable dtSample = new DataTable();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; DataColumn myDataColumn;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; myDataColumn = new DataColumn();&lt;br /&gt;
&amp;nbsp; myDataColumn.DataType = Type.GetType(&quot;System.String&quot;);&lt;br /&gt;
&amp;nbsp; myDataColumn.ColumnName = &quot;Id&quot;;&lt;br /&gt;
&amp;nbsp; dtSample.Columns.Add(myDataColumn);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; myDataColumn = new DataColumn();&lt;br /&gt;
&amp;nbsp; myDataColumn.DataType = Type.GetType(&quot;System.String&quot;);&lt;br /&gt;
&amp;nbsp; myDataColumn.ColumnName = &quot;FirstName&quot;;&lt;br /&gt;
&amp;nbsp; dtSample.Columns.Add(myDataColumn);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; myDataColumn = new DataColumn();&lt;br /&gt;
&amp;nbsp; myDataColumn.DataType = Type.GetType(&quot;System.String&quot;);&lt;br /&gt;
&amp;nbsp; myDataColumn.ColumnName = &quot;LastName&quot;;&lt;br /&gt;
&amp;nbsp; dtSample.Columns.Add(myDataColumn);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; return dtSample;&lt;br /&gt;
}&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;First time when the page is loaded it call this function to create the gridview and then store the gridview into the Session[&quot;dtSample&quot;]. You can also use viewstate here instead of session. &lt;br /&gt;
&lt;br /&gt;
4. To create a new row in the gridview the following function has been created : &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
private void AddNewRow(string firstname, string lastname, DataTable myTable)&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; DataRow row;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; row = myTable.NewRow();&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; row[&quot;Id&quot;] = myTable.Rows.Count + 1;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; row[&quot;FirstName&quot;] = firstname;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; row[&quot;LastName&quot;] = lastname;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; myTable.Rows.Add(row);&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; rowCount = myTable.Rows.Count;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;6. To Edit and Delete from the gridview the following event has been added to the gridview&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; DataTable userDataTable = (DataTable)Session[&quot;dtSample&quot;];&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; userDataTable.Rows[e.RowIndex].Delete();&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; Session[&quot;dtSample&quot;] = userDataTable;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; this.GridView1.DataSource = ((DataTable)Session[&quot;dtSample&quot;]).DefaultView;&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; this.GridView1.DataBind();&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; DataTable userDataTable = (DataTable)Session[&quot;dtSample&quot;];&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; if (userDataTable != null)&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; lblMsg.Text = Convert.ToString(userDataTable.Rows[e.NewEditIndex][&quot;Id&quot;]);&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; txtFirstName.Text = Convert.ToString(userDataTable.Rows[e.NewEditIndex][&quot;FirstName&quot;]);&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; txtLastName.Text = Convert.ToString(userDataTable.Rows[e.NewEditIndex][&quot;LastName&quot;]);&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;font-family: arial; font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;7. We have saved the data on the Submit button click.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;protected void btnSubmit_Click(object sender, EventArgs e)&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp;if (txtFirstName.Text.Trim() == &quot;&quot;)&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;this.lblMsg.Text = &quot;You must fill a name.&quot;;&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return;&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; else&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp;if (lblMsg.Text != &quot;&quot;)&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; DataTable dtSample = (DataTable)Session[&quot;dtSample&quot;];&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #ffffd2;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for (int iCount = 0; iCount &amp;lt; dtSample.Rows.Count; iCount++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; if (Convert.ToString(dtSample.Rows[iCount][&quot;Id&quot;]) == lblMsg.Text)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dtSample.Rows[iCount][&quot;FirstName&quot;] = txtFirstName.Text;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dtSample.Rows[iCount][&quot;LastName&quot;] = txtLastName.Text;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;{&lt;br /&gt;
&amp;nbsp; AddNewRow(this.txtFirstName.Text.Trim(), this.txtLastName.Text.Trim(), (DataTable)Session[&quot;dtSample&quot;]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;this.GridView1.DataSource = ((DataTable)Session[&quot;dtSample&quot;]).DefaultView; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.GridView1.DataBind();&lt;br /&gt;
this.txtFirstName.Text = &quot;&quot;;&lt;br /&gt;
this.txtLastName.Text = &quot;&quot;;&lt;br /&gt;
this.lblMsg.Text = &quot;&quot;;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
}&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5330551799363928754&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkQwi57kd_RHM2iOk7ULom2UoXhvQRxJdZQdESE8XLWLLtZxFtVT4rY5lEpvpvA7rCqmOTQRjbHRJPLNGqH9DtBHF6Hep2sENSnTgP1SX4D7GFgBrMiYQnLbGKIQjkUysIaUQQffRiCs8/s400/1.PNG&quot; style=&quot;display: block; height: 243px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 400px;&quot; /&gt; &lt;br /&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;
Download: &lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedrowdetail.aspx/.Public/GridViewExample.zip&quot; style=&quot;background-color: white; border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; border-right: #dde5e9 1px solid; border-top: #dde5e9 1px solid; height: 66px; margin: 3px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 240px;&quot;&gt;&lt;/iframe&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/1065610662955025734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/create-row-at-run-time-in-aspnet.html#comment-form' title='129 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/1065610662955025734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/1065610662955025734'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/create-row-at-run-time-in-aspnet.html' title='Create row at run time in ASP.NET GridView'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkQwi57kd_RHM2iOk7ULom2UoXhvQRxJdZQdESE8XLWLLtZxFtVT4rY5lEpvpvA7rCqmOTQRjbHRJPLNGqH9DtBHF6Hep2sENSnTgP1SX4D7GFgBrMiYQnLbGKIQjkUysIaUQQffRiCs8/s72-c/1.PNG" height="72" width="72"/><thr:total>129</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-5931592563711652533</id><published>2009-04-29T23:00:00.000+05:30</published><updated>2009-04-30T12:06:19.569+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Use email template and send email with ASP.NET</title><content type='html'>Sometimes you need to send the email with the formatted manner. Here I have created a sample application by which you can send mail with the html template.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;1. Created an Email Class library, where a SendMail has been created which contins the properties and functions to send the mail.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;2. Created a Web Application “EmailApplication” and added the reference of Email Class library.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;3. Create the Test.html page to send the formatted mail. With the $ sign you can set the values at the run time. For example if I need to set the title of the email then I used $Title in html page.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;4. Set the following things in the web.config file&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt; key=&quot;SmtpServer&quot; value=&quot;mail.mailserver.com&quot;&gt;&lt;br /&gt;&lt; key=&quot;SiteUrl&quot; value=&quot;www.mysite.com/default.aspx&quot; /&gt;&lt;br /&gt;&lt; key=&quot;IsSend&quot; value=&quot;Yes&quot;&gt;&lt;br /&gt;&lt; key=&quot;SendMailBackground&quot; value=&quot;Yes&quot;&gt;&lt;br /&gt;   &amp;#60;system.net&gt;&lt;br /&gt;    &amp;#60;mailSettings&gt;&lt;br /&gt;      &amp;#60;smtp&gt;&lt;br /&gt;&lt; host=&quot;mail.mailserver.com&quot; port=&quot;25&quot; username=&quot;&quot; password=&quot;&quot;&gt;&lt;br /&gt;&lt; / smtp &gt;&lt;br /&gt;&lt; / mailSettings &gt;&lt;br /&gt;&lt; / system.net &gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;Here SmptServer represent the SMTP Server name, SiteUrl represent the your site url , SendMailBackground specify whether the mail should be send by background or not and IsSend represent whether you want to send the mail or not. If you want to stop the mail send facility then you don’t need to change the code you just need to change the web.config file to set the value of IsSend to “No”.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;5. To send the mail through the site I have created a UI as Default.aspx, where you have to specify the sender email address, subject, message and attached file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;Download: &lt;iframe style=&quot;BORDER-RIGHT: #dde5e9 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #dde5e9 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #dde5e9 1px solid; WIDTH: 240px; PADDING-TOP: 0px; BORDER-BOTTOM: #dde5e9 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: #ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedrowdetail.aspx/.Public/EmailApplication.zip&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/5931592563711652533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/use-email-template-and-send-mail-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/5931592563711652533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/5931592563711652533'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/use-email-template-and-send-mail-with.html' title='Use email template and send email with ASP.NET'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-5516793885686205030</id><published>2009-04-27T20:05:00.000+05:30</published><updated>2009-04-27T20:13:26.624+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Get user Permission from file or folder in asp.net</title><content type='html'>Here I have upload the sample example to get the specific user permission on a specified file or folder. To get the permission I have created a function&lt;br /&gt;public string GetDirectoryAccessControlInformation(string objectPath, string userName)&lt;br /&gt;{&lt;br /&gt;---------------------&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Where we have to pass the file/folder path and the username.&lt;br /&gt;&lt;br /&gt;Download: &lt;iframe scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; frameborder=&quot;0&quot; style=&quot;width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;&quot; src=&quot;http://cid-3d62a81c29fa2c5a.skydrive.live.com/embedrowdetail.aspx/.Public/GetPermission.zip&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/5516793885686205030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/get-user-permission-from-file-or-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/5516793885686205030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/5516793885686205030'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/get-user-permission-from-file-or-folder.html' title='Get user Permission from file or folder in asp.net'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-3920078334744246376</id><published>2009-04-26T22:52:00.002+05:30</published><updated>2009-04-30T00:04:14.853+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>implement impersonation in an ASP.NET application</title><content type='html'>Impersonation in .Net allows you to run an application in a particular user account which is determined by you. Usually the account in which the application runs is ASPNET or NETWORK SERVICE depending on the version of IIS you are running in your machine. With IIS 5.0 the ASPNET account is used and it is not possible to override this account in the web.config file. In the IIS 6.0 you can configure this in the web.config file so that you can run the application on a different user account. With the help of impersonation, application can be run by a different user with different permission levels.&lt;br /&gt;We can implement Impersonation in three ways:&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;1. Impersonate the Microsoft IIS Authenticated Account or User:&lt;/strong&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To impersonate the IIS authenticating user on every request for every page in an ASP.NET application, we must include an tag in the Web.config file of this application and set the impersonate attribute to true. By default impersonation is disabled and the anonymous user account is used by IIS. &lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt; impersonate=&quot;&#39;&quot;&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR1SV9uF6qmFkwvrXysAm_ZjHF9o48VfGIvX70scq-WBNgxemB7sTMQFyaKKJdyripDvQ0bCwVJX1xhNZSj5uU_zl1jf8di5YmdNi3lWAMnbWsQ7FaX9VZy2DcklQbxW-h9v1240UFvP0/s1600-h/2.PNG&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;2. Impersonate a Specific User:&lt;br /&gt;&lt;/strong&gt;To impersonate a specific user for all the requests on all pages of an ASP.NET application, you can specify the userName and password attributes in the &lt;identity&gt;tag of the Web.config file for that application. &lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt; impersonate=&quot;&#39;&quot; username=&quot;AccountName&quot; password=&quot;password&quot;&gt;&lt;/strong&gt;&lt;/div&gt;&lt;identity impersonate=&quot;true&quot;&gt;&lt;/ identity&gt;&lt;identity impersonate=&quot;true&quot; username=&quot;AccountNAME&quot; password=&quot;Password&quot;&gt;&lt;identity impersonate=&quot;true&quot; username=&quot;AccountNAME&quot; password=&quot;Password&quot;&gt;&lt;identity impersonate=&quot;true&quot; username=&quot;AccountNAME&quot; password=&quot;Password&quot;&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;strong&gt;3. Impersonate through the code:&lt;br /&gt;&lt;/strong&gt;I have a machine A (Server) from where I have to use its resources. That machine is very secure and does not allow accessing its resources to everyone (Client). To accessing its resources I have to implement the Impersonation. Since there are numbers of users who will access those resources, that’s why I have to implement the Impersonation through the code. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjqUsbA-f-XdK-SiO3QIUKlxgLoWF19yhd2rvTpH9dC3FoZRsT8EeU2X0rRBw0q2-iuc3TpqDSZYIYlYFgeyk9ZAVhO-Zj_gTesYjeOZimZFbMQjcS8P2VKXXgRkVM36cvLlrRbX0bOQ/s1600-h/1.PNG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5329052020672403474&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 170px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjqUsbA-f-XdK-SiO3QIUKlxgLoWF19yhd2rvTpH9dC3FoZRsT8EeU2X0rRBw0q2-iuc3TpqDSZYIYlYFgeyk9ZAVhO-Zj_gTesYjeOZimZFbMQjcS8P2VKXXgRkVM36cvLlrRbX0bOQ/s400/1.PNG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; Figure-1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;As you can see in the Figrue-1, there is a Machine A and I have to read and write a Myfile.xml file, which is located in the file system of the Machine A. Since no any client can read/write that file, so that I have created a Web Service in ASP.NET and apply the impersonation into that web service, and all the clients can access that web service and easily read/write into that file. You can also implement the same scenario to create/delete the file or folders in the server. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;&lt;strong&gt;Steps:&lt;/strong&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;1. Create a new web service. &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;2. Change into the web.config file. Add the following tag in the &lt;appsettings&gt;tag. &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;&lt; key=&quot;FilePath&quot; value=&quot;D:\Projects\Impersonation\Myfile.xml&quot;&gt;&lt;br /&gt;&lt; key=&quot;UserName&quot; value=&quot;Pankaj&quot;&gt;&lt;br /&gt;&lt; key=&quot;Pwd&quot; value=&quot;password&quot;&gt;&lt;br /&gt;&lt; key=&quot;DomainName&quot; value=&quot;DomainName&quot;&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;&lt;add key=&quot;UserName&quot; value=&quot;pankaj&quot;&gt;&lt;add key=&quot;Pwd&quot; value=&quot;password&quot;&gt;&lt;add key=&quot;DomainName&quot; value=&quot;domain&quot;&gt;Change the appropriate values according to the authenticated user of that machine. &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;3. Include the AuthenticateUser class in the web service. This class is used to impersonate your code.&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;4. Add the following function to the Service.cs class &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;private void AuthenticateUser()&lt;br /&gt;{&lt;br /&gt;AuthenticateUser obAuthenticateUser = new AuthenticateUser();&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;obAuthenticateUser.Authenticate();&lt;br /&gt;}&lt;br /&gt;catch&lt;br /&gt;{&lt;br /&gt;throw;&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;obAuthenticateUser = null;&lt;br /&gt;}&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;4. Call the AuthenticateUser(); method into the every method of the web service. This method should be the called first in the each method, because this method will authenticate your code to run in the context. For example I have to get the Folder Path from the MyFile.xml, then I have created a function GetFolderPath in the service.asmx.cs file and write the code in the following manner&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;br /&gt;[WebMethod]&lt;br /&gt;public string GetFolderPath()&lt;br /&gt;{&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;//authenticate the user&lt;br /&gt;AuthenticateUser();&lt;br /&gt;string folderPath = string.Empty;&lt;br /&gt;FileOperation.FileOperation obFileOperation = new FileOperation.FileOperation();&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;folderPath = obFileOperation.FolderPath;&lt;br /&gt;}&lt;br /&gt;catch&lt;br /&gt;{&lt;br /&gt;throw;&lt;br /&gt;}&lt;br /&gt;return folderPath;&lt;br /&gt;}&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;5. Create a Web Application and add the reference of the web service. Now your web application can read and write the xml file which is located to another machine.&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;Why I have used Web Service:&lt;/strong&gt; When we have a two or more then two machines (hosting server), and we need to read/write the file from a specified machine (hosting server) and each machine have different authentication, then web service is the best solution. I will create a web service and integrate each web service in each machine with their specified user authentication. Now each machine have same web service with their authentication to read/write file of that machine. Now any user to read/write that file of any machine then it does not need to be authenticated, since web service is already authenticated, it just need to call the web service of that specified machine. To call the specified web service of a machine, we can call by the setting of url of the web service object at run time. For example, suppose I am userA and I need to access the Machine-A web service to read/write the file of Machine-A. There is also another machine Machine-AA where my web application is hosted. Now I need to access the Machine-A file though the hosted web application of Machine-AA. Then I will pass the IP address of the Machine-A and set the url property of the Machine-A&#39;s web service object. i.e.&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;obMachine-AWebService.Url = &quot;http://&quot; + IPAddressOfmachine-A + &quot;WebserviceName&quot; ;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div&gt;Now we can access the any machine&#39;s file/web service only just passing the IP address of that machine with the same web application.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;Download: &lt;iframe style=&quot;BORDER-RIGHT: #dde5e9 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #dde5e9 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #dde5e9 1px solid; WIDTH: 240px; PADDING-TOP: 0px; BORDER-BOTTOM: #dde5e9 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: #ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/3920078334744246376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/impersonation-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3920078334744246376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3920078334744246376'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/impersonation-in.html' title='implement impersonation in an ASP.NET application'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjqUsbA-f-XdK-SiO3QIUKlxgLoWF19yhd2rvTpH9dC3FoZRsT8EeU2X0rRBw0q2-iuc3TpqDSZYIYlYFgeyk9ZAVhO-Zj_gTesYjeOZimZFbMQjcS8P2VKXXgRkVM36cvLlrRbX0bOQ/s72-c/1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-4148505383632262019</id><published>2009-04-21T23:32:00.002+05:30</published><updated>2010-01-09T22:30:30.209+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Sorting in a Asp.net Gridview with custom data object</title><content type='html'>&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;This article explains about how to sort the gridview with the custom object. Here I have used viewstate and no need to any server call for the sorting.&lt;br /&gt;Here I have filled the gridview with all the files or folder within a directory. To get the properties of the file/folder I have created a class FileObject class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public class FileObject&lt;br /&gt;{&lt;br /&gt;private string name;&lt;br /&gt;private string path;&lt;br /&gt;private int size;&lt;br /&gt;private string type;&lt;br /&gt;private string modified;&lt;br /&gt;&lt;br /&gt;public string Modified&lt;br /&gt;{&lt;br /&gt;get { return modified; }&lt;br /&gt;set { modified = value; }&lt;br /&gt;}&lt;br /&gt;public string Type&lt;br /&gt;{&lt;br /&gt;get { return type; }&lt;br /&gt;set { type = value; }&lt;br /&gt;}&lt;br /&gt;public int Size&lt;br /&gt;{&lt;br /&gt;get { return size; }&lt;br /&gt;set { size = value; }&lt;br /&gt;}&lt;br /&gt;public string Path&lt;br /&gt;{&lt;br /&gt;get { return path; }&lt;br /&gt;set { path = value; }&lt;br /&gt;}&lt;br /&gt;public string Name&lt;br /&gt;{&lt;br /&gt;get { return name; }&lt;br /&gt;set { name = value; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To store all the object to a collection I have created a custom collection class.&lt;br /&gt;public class DataCollection&lt;t&gt; : IEnumerable&lt;t&gt;&lt;br /&gt;{&lt;br /&gt;private List&lt;t&gt; listData = new List&lt;t&gt;();&lt;br /&gt;&lt;br /&gt;public T GetData(int index)&lt;br /&gt;{&lt;br /&gt;return listData[index];&lt;br /&gt;}&lt;br /&gt;public void AddData(T c)&lt;br /&gt;{&lt;br /&gt;listData.Add(c);&lt;br /&gt;}&lt;br /&gt;public void ClearData()&lt;br /&gt;{&lt;br /&gt;listData.Clear();&lt;br /&gt;}&lt;br /&gt;public int Count&lt;br /&gt;{&lt;br /&gt;get { return listData.Count; }&lt;br /&gt;}&lt;br /&gt;// IEnumerable&lt;t&gt; extends IEnumerable, therefore&lt;br /&gt;// we need to implement both versions of GetEnumerator().&lt;br /&gt;IEnumerator&lt;t&gt; IEnumerable&lt;t&gt;.GetEnumerator()&lt;br /&gt;{&lt;br /&gt;return listData.GetEnumerator();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()&lt;br /&gt;{&lt;br /&gt;return listData.GetEnumerator();&lt;br /&gt;}&lt;br /&gt;public void Add(T c)&lt;br /&gt;{&lt;br /&gt;listData.Add(c);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To sort the data in the collection I have created a GenericComparer class which is inherited from the IComparer.&lt;br /&gt;public sealed class GenericComparer&lt;t&gt; : IComparer&lt;t&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public enum SortOrder { Ascending, Descending };&lt;br /&gt;&lt;br /&gt;#region member variables&lt;br /&gt;&lt;br /&gt;private string sortColumn;&lt;br /&gt;&lt;br /&gt;private SortOrder sortingOrder;&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;#region constructor&lt;br /&gt;&lt;br /&gt;public GenericComparer(string sortColumn, SortOrder sortingOrder)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;this.sortColumn = sortColumn;&lt;br /&gt;&lt;br /&gt;this.sortingOrder = sortingOrder;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;#region public property&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Column Name(public property of the class) to be sorted.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public string SortColumn&lt;br /&gt;{&lt;br /&gt;get { return sortColumn; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Sorting order.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public SortOrder SortingOrder&lt;br /&gt;{&lt;br /&gt;get { return sortingOrder; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;#region public methods&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Compare interface implementation&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;/// &lt;param name=&quot;x&quot;&gt;First Object&lt;/param&gt;&lt;br /&gt;/// &lt;param name=&quot;y&quot;&gt;Second Object&lt;/param&gt;&lt;br /&gt;/// &lt;returns&gt;Result of comparison&lt;/returns&gt;&lt;br /&gt;public int Compare(T x, T y)&lt;br /&gt;{&lt;br /&gt;PropertyInfo propertyInfo = typeof(T).GetProperty(sortColumn);&lt;br /&gt;IComparable obj1 = (IComparable)propertyInfo.GetValue(x, null);&lt;br /&gt;IComparable obj2 = (IComparable)propertyInfo.GetValue(y, null);&lt;br /&gt;if (sortingOrder == SortOrder.Ascending)&lt;br /&gt;{&lt;br /&gt;return (obj1.CompareTo(obj2));&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return (obj2.CompareTo(obj1));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To Sort the gridview I have used the following gridview command&lt;br /&gt;&lt;br /&gt;protected void dgrid_Sorting(object sender, GridViewSortEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (ViewState[&quot;SortBy&quot;] == null)&lt;br /&gt;{&lt;br /&gt;ViewState[&quot;SortBy&quot;] = &quot;DESC&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else if (ViewState[&quot;SortBy&quot;].ToString().Equals(&quot;ASC&quot;))&lt;br /&gt;{&lt;br /&gt;ViewState[&quot;SortBy&quot;] = &quot;DESC&quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;ViewState[&quot;SortBy&quot;] = &quot;ASC&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;BindData(e.SortExpression);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks for my colleague Poonam to help me for this.&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWeXR7HS5cjT5Q7jhWRKJYCJxxmnvWGTfxnD5qbjgKB_crm1GXoWMi_NUXEu5fRoBw6SQ0_6lGLGtEZr3-HDQZYpAFTsKu2UpAO2A7vibtBRhzXp6xJ28s6cKvYO3t_SJ0oH1xDeqt1c/s1600-h/1.PNG&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5327206797259135650&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 243px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWeXR7HS5cjT5Q7jhWRKJYCJxxmnvWGTfxnD5qbjgKB_crm1GXoWMi_NUXEu5fRoBw6SQ0_6lGLGtEZr3-HDQZYpAFTsKu2UpAO2A7vibtBRhzXp6xJ28s6cKvYO3t_SJ0oH1xDeqt1c/s400/1.PNG&quot; border=&quot;0&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold&quot;&gt;Download&lt;/span&gt;: &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(136,136,136); LINE-HEIGHT: 15px&quot;&gt;&lt;iframe style=&quot;BORDER-RIGHT: #dde5e9 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #dde5e9 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #dde5e9 1px solid; WIDTH: 240px; PADDING-TOP: 0px; BORDER-BOTTOM: #dde5e9 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: #ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;http://cid-2ae16a45fb1389d5.skydrive.live.com/embedrowdetail.aspx/Public/SortingWithCustomCollection.zip&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/4148505383632262019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/sorting-in-aspnet-gridview-with-custom.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/4148505383632262019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/4148505383632262019'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/sorting-in-aspnet-gridview-with-custom.html' title='Sorting in a Asp.net Gridview with custom data object'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWeXR7HS5cjT5Q7jhWRKJYCJxxmnvWGTfxnD5qbjgKB_crm1GXoWMi_NUXEu5fRoBw6SQ0_6lGLGtEZr3-HDQZYpAFTsKu2UpAO2A7vibtBRhzXp6xJ28s6cKvYO3t_SJ0oH1xDeqt1c/s72-c/1.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-5198116720379191599</id><published>2009-04-20T23:44:00.001+05:30</published><updated>2009-04-27T20:33:58.769+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>Validation of XML with XSD in C#</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;&lt;span style=&quot;color:#666666;&quot;&gt;&lt;/span&gt;This article explains about how to validate an XML document with XSD schema. The validation is performed by checking whether the XML document is a well-formed one by programmatically using .NET classes in C#.&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Verdana;font-size:15;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;Xml Document&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;&lt;o:p&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Georgia;font-size:16;&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xml&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;version&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;1.0&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;utf-8&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Employees&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Employee&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;FirstName&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;Pankaj&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a31515;&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;LastName&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;Saha&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a31515;&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Age&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;26&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a31515;&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Address&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;City&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;?xml:namespace prefix = st1 /&gt;&lt;st1:city st=&quot;on&quot;&gt;&lt;st1:place st=&quot;on&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;Baroda&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;City&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Country&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;st1:country-region st=&quot;on&quot;&gt;&lt;st1:place st=&quot;on&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;India&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:country-region&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Country&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Address&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Employee&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Employee&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;FirstName&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;Animesh&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a31515;&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;LastName&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;Sing&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a31515;&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Age&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;27&lt;span style=&quot;color:blue;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color:#a31515;&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Address&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;City&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;st1:city st=&quot;on&quot;&gt;&lt;st1:place st=&quot;on&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;Baroda&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:city&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;City&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Country&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;st1:country-region st=&quot;on&quot;&gt;&lt;st1:place st=&quot;on&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;India&lt;/span&gt;&lt;/st1:place&gt;&lt;/st1:country-region&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Country&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Address&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Employee&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;Employees&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(0,0,255);font-family:&#39;Courier New&#39;;font-size:13;&quot;  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(0,0,255);font-family:&#39;Courier New&#39;;font-size:13;&quot;  &gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;Here I have created two xsd file, one is valid or another is invalid.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;You can create the xsd file from a xml file with the visual studio.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol style=&quot;MARGIN-TOP: 0in&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify;color:black;&quot; &gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;&quot;&gt;Open the xml file in the visual studio.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify;color:black;&quot; &gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;&quot;&gt;Go to the xml menu&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify;color:black;&quot; &gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;&quot;&gt;click on Create Schema&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:Verdana;font-size:48;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdyNyD68UHSTbZFR5NJrhdE4g2Jkvi_t97h2lBuYJ7Bj7tEp6kPTrPWckdRMSem3OUirfsRXLdJhz-tmGZEAEiNwH_DEmuBArbF75ivvgaHEGhedlKrq84c2hu1OatXmJ3Dv4wQc-_aj0/s1600-h/1.PNG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5326838841794847890&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: pointer; HEIGHT: 200px; TEXT-ALIGN: justify&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdyNyD68UHSTbZFR5NJrhdE4g2Jkvi_t97h2lBuYJ7Bj7tEp6kPTrPWckdRMSem3OUirfsRXLdJhz-tmGZEAEiNwH_DEmuBArbF75ivvgaHEGhedlKrq84c2hu1OatXmJ3Dv4wQc-_aj0/s320/1.PNG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;WHITE-SPACE: pre&quot;&gt; &lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;WHITE-SPACE: normal&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;WHITE-SPACE: pre&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;WHITE-SPACE: normal;font-size:23;&quot; &gt;Figure-1&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(0,0,255);font-family:&#39;Courier New&#39;;font-size:13;&quot;  &gt;&lt;/span&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(0,0,255);font-family:&#39;Courier New&#39;;font-size:13;&quot;  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1iyYkHe8ekc5HKpaU55BVIMKTZK2-pIu0URIADdPmjsnYH5Rkzd534DtshBwxFOt1aFZ6aRXxE5w7pkPqDG-rAz0uuPaPCQCV5X7-Wj3AhFS6cKUgGSW5Mnplj5ZDVkw5vo5RMksOho8/s1600-h/2.PNG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5326839096875851314&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: pointer; HEIGHT: 194px; TEXT-ALIGN: justify&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1iyYkHe8ekc5HKpaU55BVIMKTZK2-pIu0URIADdPmjsnYH5Rkzd534DtshBwxFOt1aFZ6aRXxE5w7pkPqDG-rAz0uuPaPCQCV5X7-Wj3AhFS6cKUgGSW5Mnplj5ZDVkw5vo5RMksOho8/s320/2.PNG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;WHITE-SPACE: pre&quot;&gt; &lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;WHITE-SPACE: normal&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;WHITE-SPACE: pre&quot;&gt;&lt;/span&gt;Figure-2&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;To created invalid xsd I have removed one tag LastName after the FirstName tag in the valid xsd.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:11;color:black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;a name=&quot;more&quot;&gt;&lt;span style=&quot;font-family:Verdana;color:black;&quot;&gt;Valid XSD schema&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xml&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;version&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;1.0&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;utf-8&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:schema&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;attributeFormDefault&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;unqualified&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;elementFormDefault&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;qualified&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns:xs&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Employees&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt; &lt;/span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;maxOccurs&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;unbounded&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 4&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;maxOccurs&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;unbounded&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Employee&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt; &lt;/span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 5&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 6&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;span style=&quot;BACKGROUND: yellow; mso-highlight: yellow&quot;&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;FirstName&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;LastName&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Age&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:unsignedByte&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Address&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 8&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 9&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 10&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;City&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 10&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Country&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 9&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 8&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 6&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 5&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 4&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:schema&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:8;color:black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;span style=&quot;mso-bookmark: more&quot;&gt;&lt;/span&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;color:black;&quot;&gt;Invalid&lt;/span&gt;&lt;span style=&quot;font-size:11;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family:Verdana;color:black;&quot;&gt;XSD schema&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xml&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;version&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;1.0&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;utf-8&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:schema&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;attributeFormDefault&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;unqualified&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;elementFormDefault&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;qualified&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;xmlns:xs&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Employees&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 4&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;maxOccurs&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;unbounded&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Employee&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 5&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 5&quot;&gt;&lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;FirstName&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Age&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:unsignedByte&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Address&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 8&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 9&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 10&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;City&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 10&quot;&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:red;&quot;  &gt;name&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;=&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;&quot; &gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;Country&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt;xs:string&lt;/span&gt;&quot;&lt;span style=&quot;color:blue;&quot;&gt; /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 9&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 8&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 7&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 6&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 5&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 4&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 3&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:sequence&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 2&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:complexType&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;span style=&quot;mso-tab-count: 1&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:element&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:#a31515;&quot;  &gt;xs:schema&lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;FONT-WEIGHT: normal;font-family:Verdana;color:black;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;FONT-WEIGHT: normal;font-family:Verdana;color:black;&quot;  &gt;To check whether the xml is valid or not I have done the following steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;FONT-SIZE: 8pt; mso-bidi-font-weight: boldfont-size:12;color:blue;&quot;  &gt;&lt;span style=&quot;mso-list: Ignore&quot;&gt;1.&lt;span style=&quot;FONT: 7pt &#39;Times New Roman&#39;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;FONT-WEIGHT: normal; mso-bidi-font-weight: bold&quot;&gt;Created class XmlValidator&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;MARGIN-LEFT: 0.5in; TEXT-INDENT: -0.25in; TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;FONT-SIZE: 8pt; mso-bidi-font-weight: boldfont-size:12;color:blue;&quot;  &gt;&lt;span style=&quot;mso-list: Ignore&quot;&gt;2.&lt;span style=&quot;FONT: 7pt &#39;Times New Roman&#39;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;FONT-WEIGHT: normal; mso-bidi-font-weight: bold&quot;&gt;The ValidationCallBack event is used to define an event handler for receiving the notification about XSD schema validation errors. &lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;/span&gt;If any validation error occurs, an exception is thrown, and the XmlValidatingReader cannot be restarted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;MARGIN-LEFT: 0.25in; TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;FONT-WEIGHT: normal; mso-bidi-font-weight: boldfont-size:11;color:black;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;MARGIN-LEFT: 0.25in; TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;Courier: ;font-size:8;color:blue;&quot;  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h3 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;color:black;&quot;&gt;Conclusion&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;color:black;&quot;&gt;This article explained about the XML document, XSD schema, and how to validate XML document against XSD schema using Microsoft .NET framework classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Verdana;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold&quot;&gt;Download&lt;/span&gt;: &lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(136,136,136)&quot;&gt;&lt;iframe style=&quot;BORDER-RIGHT: #dde5e9 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #dde5e9 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #dde5e9 1px solid; WIDTH: 240px; PADDING-TOP: 0px; BORDER-BOTTOM: #dde5e9 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: #ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;http://cid-2ae16a45fb1389d5.skydrive.live.com/embedrowdetail.aspx/Public/XmlValidation.zip&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:8;color:black;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/h4&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;TEXT-ALIGN: justify&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/5198116720379191599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/validation-of-xml-with-xsd-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/5198116720379191599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/5198116720379191599'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/validation-of-xml-with-xsd-in-c.html' title='Validation of XML with XSD in C#'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdyNyD68UHSTbZFR5NJrhdE4g2Jkvi_t97h2lBuYJ7Bj7tEp6kPTrPWckdRMSem3OUirfsRXLdJhz-tmGZEAEiNwH_DEmuBArbF75ivvgaHEGhedlKrq84c2hu1OatXmJ3Dv4wQc-_aj0/s72-c/1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-6184662813165943061</id><published>2009-04-19T23:00:00.002+05:30</published><updated>2010-03-24T11:57:14.165+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>Custom paging in asp.net with Jquery</title><content type='html'>Here I have created a custom grid with &lt;a href=&quot;http://docs.jquery.com/&quot;&gt;Jquery&lt;/a&gt; in Asp.net. When we use web control (datagrid, GridView etc.) in asp.net to show the information then it takes time as the number of users increased. As well as if we have to go for the next page in the Gridview a postback happened and it increase the load on the server. I have used here a Jquery &lt;a href=&quot;http://docs.jquery.com/Ajax&quot;&gt;Ajax&lt;/a&gt; method to fetch and save the data without postback.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUpNcv3tFtDDN2aZMGNFmHp-kTJcgopoYS8x2fI4Qt8PZAUv_g7oSeWpF2n1HHFJZjbxlUAAcWtYyLw8a6l5OdhgyFm5nE8eHkR3P_hmQvD7cpu6PiZcvKN63ZR8CKMljLjHmZBaXMJBg/s1600-h/2.bmp&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5326457271296075666&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 194px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUpNcv3tFtDDN2aZMGNFmHp-kTJcgopoYS8x2fI4Qt8PZAUv_g7oSeWpF2n1HHFJZjbxlUAAcWtYyLw8a6l5OdhgyFm5nE8eHkR3P_hmQvD7cpu6PiZcvKN63ZR8CKMljLjHmZBaXMJBg/s320/2.bmp&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b style=&quot;mso-bidi-font-weight: normal&quot;&gt;Steps:&lt;/b&gt;&lt;br /&gt;&lt;ol style=&quot;MARGIN-TOP: 0in&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;Here I have used Link To SQL for the datalayer. I have created the procedures to insertUser (to insert the new user) , GetTotalUserCount (get the total number of users)&lt;span style=&quot;mso-spacerun: yes&quot;&gt; &lt;/span&gt;and GetAllUsers (to fetch all the users).&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;Created a class user in the datalayer to fetch the users by pageSize, pageNo and SortColumn.&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;Created a BusinessLayer.&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;Created JSONHelper.JSON and added the reference to the BusinessLayer.&lt;span style=&quot;mso-spacerun: yes&quot;&gt; &lt;/span&gt;JSONHelper.JSON is used to convert the object to the Json string.&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia;&quot;&gt;Included the&lt;a href=&quot;http://docs.jquery.com/Downloading_jQuery&quot;&gt; jquery-1.3.2.min.js&lt;/a&gt;&lt;span style=&quot;Courier: ;font-size:10;color:blue;&quot;  &gt; &lt;/span&gt;&lt;span style=&quot;Courier: ;font-size:10;color:blue;&quot;  &gt;&lt;/span&gt;in the default.aspx page. No need to write any server site code. You can also use any .html page instead of .aspx page.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold&quot;&gt;&lt;span style=&quot;mso-fareast-Times: ;font-family:&#39;Times New Roman&#39;;font-size:12;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: normal&quot;&gt;Include CustomeUserGrid.js and Employee.js files where I fetch the data from the database and also save the new user information&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold&quot;&gt;&lt;span style=&quot;mso-fareast-Times: ;font-family:&#39;Times New Roman&#39;;font-size:12;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: normal&quot;&gt;To save/fetch the data from the database with Jquery Ajax method I have created a DataPage.aspx. &lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold;font-family:Georgia;&quot; &gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;&lt;span style=&quot;mso-fareast-Times: ;font-family:&#39;Times New Roman&#39;;font-size:12;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Georgia;&quot;&gt;Restore the database EmployeeManagement.bak.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo1; tab-stops: list .5in&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold&quot;&gt;&lt;span style=&quot;mso-fareast-Times: ;font-family:&#39;Times New Roman&#39;;font-size:12;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: normal&quot;&gt;Set the default.aspx page Set as start page.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;b style=&quot;mso-bidi-font-weight: normal&quot;&gt;Technolgoes:&lt;/b&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt; &lt;/span&gt;asp.net 3.5, Linq to SQL, Jquery&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;b style=&quot;mso-bidi-font-weight: normal&quot;&gt;Written By:&lt;/b&gt; Pankaj Saha &lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;FONT-WEIGHT: bold&quot;&gt;Download:&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;COLOR: rgb(136,136,136)&quot;&gt;&lt;iframe style=&quot;BORDER-RIGHT: #dde5e9 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #dde5e9 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #dde5e9 1px solid; WIDTH: 240px; PADDING-TOP: 0px; BORDER-BOTTOM: #dde5e9 1px solid; HEIGHT: 66px; BACKGROUND-COLOR: #ffffff&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; src=&quot;http://cid-2ae16a45fb1389d5.skydrive.live.com/embedrowdetail.aspx/Public/Employee%20Management.zip&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;Thanks my friend Animesh Singh to help me out for this blog.</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/6184662813165943061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/custom-pagging-in-aspnet.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/6184662813165943061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/6184662813165943061'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2009/04/custom-pagging-in-aspnet.html' title='Custom paging in asp.net with Jquery'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUpNcv3tFtDDN2aZMGNFmHp-kTJcgopoYS8x2fI4Qt8PZAUv_g7oSeWpF2n1HHFJZjbxlUAAcWtYyLw8a6l5OdhgyFm5nE8eHkR3P_hmQvD7cpu6PiZcvKN63ZR8CKMljLjHmZBaXMJBg/s72-c/2.bmp" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-3498394625307860536</id><published>2008-09-17T12:50:00.001+05:30</published><updated>2012-04-09T16:23:45.975+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Copy database diagrams from one database to another database in sqlserver2005</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Generally we face a situation when we need to move the one Database diagram to another Database. Suppose you have created a database A which contains some database diagram and there is the same or different database B which does not contains any database diagram.&amp;nbsp;Now you&amp;nbsp;have to move only the database diagram of A to the B.&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;The entire diagram’s information is stored in the&amp;nbsp;&lt;b&gt;dbo.sysdiagrams.&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;If you wish to see the table&amp;nbsp;&lt;b&gt;dbo.sysdiagrams&lt;/b&gt;&amp;nbsp;which is in&amp;nbsp;&lt;b&gt;System Table&lt;/b&gt;&amp;nbsp;folder of&amp;nbsp;&lt;b&gt;A,&lt;/b&gt;then write the following statement&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;A&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;dbo&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;sysdiagrams&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwRG3TC6ogE0i9_zKSkHHxhQ8pcU70MVtlFRiKsvqA08JYQQGJ_M6JGiQc7LygcuGMfvji43J6SHwSmqCRoA1eN3RlnI0N-gsyqak_6uqCoCNZjcf9Tsl6HW0Gq7kzwVejwpNtwzGBIQI/s1600/DatabaseDiagram.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;63&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwRG3TC6ogE0i9_zKSkHHxhQ8pcU70MVtlFRiKsvqA08JYQQGJ_M6JGiQc7LygcuGMfvji43J6SHwSmqCRoA1eN3RlnI0N-gsyqak_6uqCoCNZjcf9Tsl6HW0Gq7kzwVejwpNtwzGBIQI/s320/DatabaseDiagram.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;It will list all the diagram information.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Now if you need to move or copy the all the diagrams of database A to the B then write the following sql statement and run:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;insert&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;into&lt;/span&gt;&amp;nbsp;B&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;dbo&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;sysdiagrams&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt;&amp;nbsp;[name]&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;principal_id&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;version&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;definition&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;A&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;dbo&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;sysdiagrams&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;It will copy all the diagrams of database A to the database B&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: scroll; background-clip: initial; background-color: #ffffd2; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: repeat repeat; border-bottom-color: rgb(255, 165, 0); border-bottom-style: dotted; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(255, 165, 0); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(255, 165, 0); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(255, 165, 0); border-top-style: dotted; border-top-width: 1px; font-family: tahoma; font-weight: bold; min-width: 95%; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;&quot;&gt;&lt;pre&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;insert&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;into&lt;/span&gt;&amp;nbsp;B&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;dbo&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;sysdiagrams&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt;&amp;nbsp;[name]&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;diagram_id&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;version&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;definition&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;A&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;dbo&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;sysdiagrams&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt;&amp;nbsp;diagram_id&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;13&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/3498394625307860536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2008/09/copy-database-diagrams-from-database-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3498394625307860536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/3498394625307860536'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2008/09/copy-database-diagrams-from-database-to.html' title='Copy database diagrams from one database to another database in sqlserver2005'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwRG3TC6ogE0i9_zKSkHHxhQ8pcU70MVtlFRiKsvqA08JYQQGJ_M6JGiQc7LygcuGMfvji43J6SHwSmqCRoA1eN3RlnI0N-gsyqak_6uqCoCNZjcf9Tsl6HW0Gq7kzwVejwpNtwzGBIQI/s72-c/DatabaseDiagram.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6471229722965206301.post-957367991252570933</id><published>2008-09-16T16:33:00.001+05:30</published><updated>2012-02-15T20:13:41.326+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Paging with Sqlserver2005</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Some time we need to implement the paging concept for our web and windows application.&lt;span style=&quot;font-size: 0px;&quot;&gt; &lt;/span&gt;To achieve this we generally do very completed code or we have to do the paging with our controls such as Datagrid, Gridview etc. However this control s may affect the performance of our application. For example if there are 1000000 records and if we implement the paging then we have to do the server site code or if we fetch whole the record from database to the application then it will affect the performance, and if we use web application then we have to very much care about the performance of the application.&lt;span style=&quot;font-size: 0px;&quot;&gt; &lt;/span&gt;But don’t worry friends there a very simple procedure to implement the paging through the database. We can filter the recodes in our procedure and then we can fetch only those records what we need. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;1.&lt;span style=&quot;font-size: 0px;&quot;&gt; &lt;/span&gt;Using the Employees table of northwind&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;2. Now create a procedure &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;SET &lt;span style=&quot;color: blue;&quot;&gt;ANSI_NULLS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;SET &lt;span style=&quot;color: blue;&quot;&gt;QUOTED_IDENTIFIER&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;-- =============================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;-- Author:&lt;span style=&quot;font-size: 0px;&quot;&gt; &lt;/span&gt;Pankaj Saha&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;-- Create date: &lt;create&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/create&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;-- Description:&lt;span style=&quot;font-size: 0px;&quot;&gt; &lt;/span&gt;To fetch the records by paging&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;-- =============================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;CREATE &lt;span style=&quot;color: blue;&quot;&gt;PROCEDURE&lt;/span&gt; GetEmployees&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;@CurrentPageNo &lt;span style=&quot;color: blue;&quot;&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;@PageSize &lt;span style=&quot;color: blue;&quot;&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;-- SET NOCOUNT ON added to prevent extra result sets from&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;-- interfering with SELECT statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;SET&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NOCOUNT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;WITH EmployeeCTE&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*,&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;ROW_NUMBER&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;OVER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;BY&lt;/span&gt; EmployeeID&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; RowNumber &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; Employees&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;SELECT &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; EmployeeCTE &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; RowNumber &lt;span style=&quot;color: grey;&quot;&gt;between&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;((&lt;/span&gt;@CurrentPageNo&lt;span style=&quot;color: grey;&quot;&gt;-&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;)*&lt;/span&gt;@PageSize&lt;span style=&quot;font-size: 0px;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)+&lt;/span&gt; 1&lt;span style=&quot;color: grey;&quot;&gt;and&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@CurrentPageNo&lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt;@PageSize&lt;span style=&quot;color: grey;&quot;&gt;-&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;3. Execute the following statement&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;execute GetEmployees 1 ,10&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;The output would show the top 10 employees information, if you run &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;execute GetEmployees 2 ,10 &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;The output would be the next 10 records.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://cid-2ae16a45fb1389d5.skydrive.live.com/embedrowdetail.aspx/Public/pagging%20with%20sql.PDF&quot; style=&quot;background-color: white; border-bottom: rgb(221,229,233) 1px solid; border-left: rgb(221,229,233) 1px solid; border-right: rgb(221,229,233) 1px solid; border-top: rgb(221,229,233) 1px solid; height: 66px; margin: 3px; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt; width: 240px;&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sahapankaj.blogspot.com/feeds/957367991252570933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sahapankaj.blogspot.com/2008/09/paging-with-sqlserver2005.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/957367991252570933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6471229722965206301/posts/default/957367991252570933'/><link rel='alternate' type='text/html' href='http://sahapankaj.blogspot.com/2008/09/paging-with-sqlserver2005.html' title='Paging with Sqlserver2005'/><author><name>Pankaj</name><uri>http://www.blogger.com/profile/04879022419007322647</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-u93s8OJzCEq_KbgGAzbrAba4inBMipq9ZGZcTvXb68rL1F2Cg7UgoIMrP_4UUJmv9mu2bb0oWhDMqNyZbak8Ud8yaScDB1SiFONXXSDf5PL3z1BBxX3SZ_di9u1ovw/s220/190620113016.jpg'/></author><thr:total>0</thr:total></entry></feed>