<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7538122901722277480</atom:id><lastBuildDate>Fri, 25 Oct 2024 07:28:01 +0000</lastBuildDate><category>.Net Technology</category><category>Sockets</category><title>Tech Fun.</title><description>Discuss about different technology and programming language e.g. .Net ,Java ,AWS etc.&#xa;&#xa;Would prefer comments and suggestion from readers for shared posts and how to share knowledge to more and more people and get knowledge from more and more people.&#xa; </description><link>http://ivarunsingh.blogspot.com/</link><managingEditor>noreply@blogger.com (Varun Singh)</managingEditor><generator>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-6338718435799503389</guid><pubDate>Fri, 28 Aug 2015 15:05:00 +0000</pubDate><atom:updated>2015-08-28T20:35:06.883+05:30</atom:updated><title>AWS Datapipeline and Python Script</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;i&gt;AWS Datapipeline and Python Script&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;
I had a task to do and it was supposed to be done quickly. Then I got to know that there is a language which can do certain task efficiently and easily as compared to other languages and its called &quot;Python&quot;.&lt;br /&gt;
&lt;br /&gt;
Python has lots of powerful library to perform tasks quickly as it is like a scripting language.&lt;br /&gt;
Although, I hadn&#39;t had any knowledge of using this wonderful language but I thought of giving it a try and guess what!!! , &amp;nbsp;it is similar to other languages like Java,C# and also need less time to do certain tasks as lot of libraries support in python.&lt;br /&gt;
&lt;br /&gt;
Let me tell you I had a task in which I need to do some of the manipulations in AWS resources and save result in other AWS resources and python has a powerful library called Boto which is very easy to work on . Have a look at the boto library &lt;a href=&quot;http://boto.readthedocs.org/en/latest/&quot;&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I was able to complete my work quickly using python &amp;nbsp;and created a python script and now there is some requirement to schedule this script so that this script runs daily at a certain time and perform its task.&lt;br /&gt;
&lt;br /&gt;
As we are using heavily the AWS resources for our work so it was not the difficult task to choose AWS Datapipeline to do this work for us using EMR clusters.&lt;br /&gt;
&lt;br /&gt;
So, now I have all of the resources - my script was ready and i can also schedule that script by using aws datapiplines but a question pop up in my mind whether I can schedule a python script using datapipeline or not.&lt;br /&gt;
FYI, I was also new on datapipeline.&lt;br /&gt;
&lt;br /&gt;
I decided to research on that and after lot of effort -searching on internet ;) and various hit and trial on datapipeline options .I was successfully able to schedule my python script using boto library on aws datapipeline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, Here are some of the points to schedule python script on aws datapipeline, so that it would be easy for you guys :-&lt;br /&gt;
Step1: Have your python script ready.&lt;br /&gt;
Step2: AWS account and console.&lt;br /&gt;
Step3: Choose Datapipeline and start creating a datapipeline.&lt;br /&gt;
Step4: Choose source as EmrActivity and provide the S3 path of &amp;nbsp;your script in &quot;input&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;and provide output path to another S3 bucket location.&lt;br /&gt;
Step 5: In order to run python from EMR cluster ,you need to add &amp;nbsp;&lt;span style=&quot;background-color: #eeeeee; color: #000066; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 12px;&quot;&gt;&quot;preStepCommand&quot; : &quot;&lt;command boto=&quot;&quot; download=&quot;&quot; library=&quot;&quot; to=&quot;&quot;&gt;&lt;/command&gt;&quot;&lt;/span&gt;&amp;nbsp; &amp;nbsp;.&lt;br /&gt;
Step 6:Choose EMR cluster and choose the desired configuration of the hardware.&lt;br /&gt;
Step7 : Schedule your job and you can also add preconditions so that datapipeline checks for precondition fulfillment before each run.&lt;br /&gt;
Step8: Setup logs in your S3 logs directory so that you can check problem in your job and debug issue using those logs.&lt;br /&gt;
&lt;br /&gt;
Step8: Set SNS topics and subscribe for job completion and job failure notifications.&lt;br /&gt;
&lt;br /&gt;
Finally, have fun and let other hard work to be done for you by datapipelines. &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
</description><link>http://ivarunsingh.blogspot.com/2015/08/aws-datapipeline-and-python-script.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-5983560919283921131</guid><pubDate>Sat, 23 Mar 2013 07:27:00 +0000</pubDate><atom:updated>2013-03-23T12:57:40.961+05:30</atom:updated><title>Mutex-Simply</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;u&gt;&lt;span style=&quot;font-size: 13.5pt; line-height: 115%;&quot;&gt;Mutex&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;font-size: 13.5pt; line-height: 115%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt; line-height: 115%;&quot;&gt;- I just came across a very simple definition and
example of mutex from&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;background: white; color: #555555; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.5pt; line-height: 115%;&quot;&gt;Threading in C#, by Joe
Albahari,&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 13.5pt; line-height: 115%;&quot;&gt;so I just thought of sharing it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin: 12pt 0in 0.0001pt;&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;_Mutex&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 16.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 16.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 12.75pt; margin-bottom: 8.4pt; margin-left: 0in; margin-right: 0in; margin-top: 8.4pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;is like a C#&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;lock&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;, but it can work across multiple processes. In other words,&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;can be&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;i&gt;computer-wide&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;as well
as&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;i&gt;application-wide&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; border: solid teal 2.25pt; margin-left: .25in; margin-right: .25in; mso-element: para-border-div; padding: 12.0pt 12.0pt 12.0pt 31.0pt;&quot;&gt;

&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin: 9.6pt 0in 0.1in; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;Acquiring
and releasing an uncontended&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;takes a
few microseconds — about 50 times slower than a&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;lock&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 12.75pt; margin-bottom: 8.4pt; margin-left: 0in; margin-right: 0in; margin-top: 8.4pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;With a&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;class, you call the&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;WaitOne&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;method to
lock and&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;ReleaseMutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;to
unlock. Closing or disposing a&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;automatically releases it. Just as with the&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;lock&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;statement, a&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;can be
released only from the same thread that obtained it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 12.75pt; margin-bottom: 8.4pt; margin-left: 0in; margin-right: 0in; margin-top: 8.4pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;A common use for a
cross-process&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;is to
ensure that only one instance of a program can run at a time. Here’s how it’s
done:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: whitesmoke; border: solid #CCCCCC 1.0pt; mso-border-alt: solid #CCCCCC .75pt; mso-element: para-border-div; padding: 3.0pt 6.0pt 3.0pt 4.0pt;&quot;&gt;

&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;OneAtATimePlease&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;Main()&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;// Naming a Mutex makes it available computer-wide. Use a name
that&#39;s&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;// unique to your company and application (e.g., include your
URL).&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;mutex &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;Mutex&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dc1414; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&quot;oreilly.com OneAtATimeDemo&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;))&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;// Wait a few seconds if contended, in case another instance&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: green; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;// of the program is still in the process of shutting down.&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(!&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;mutex&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;.WaitOne&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;TimeSpan&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;.FromSeconds&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;))&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Console&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;.WriteLine&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dc1414; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&quot;Another
app instance is running. Bye!&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;RunProgram();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;RunProgram()&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;.WriteLine&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dc1414; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&quot;Running. Press Enter to
exit&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;.ReadLine();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin-bottom: 0.0001pt; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background: white; border: solid teal 2.25pt; margin-left: .25in; margin-right: .25in; mso-element: para-border-div; padding: 12.0pt 12.0pt 12.0pt 31.0pt;&quot;&gt;

&lt;div class=&quot;MsoNormal&quot; style=&quot;background-position: initial initial; background-repeat: initial initial; border: none; line-height: 12.75pt; margin: 9.6pt 0in 0.1in; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;If
running under Terminal Services, a computer-wide&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444466; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Mutex&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;is
ordinarily visible only to applications in the same terminal server session. To
make it visible to all terminal server sessions, prefix its name with&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;i&gt;Global\&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Note : For more in depth knowledge you can go to &lt;a href=&quot;http://www.albahari.com/threading/part2.aspx&quot;&gt;link&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://ivarunsingh.blogspot.com/2013/03/mutex-simply.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-5618130216798179213</guid><pubDate>Sat, 23 Feb 2013 14:19:00 +0000</pubDate><atom:updated>2013-02-23T19:49:49.169+05:30</atom:updated><title>Unit Test not running in VS 2010 after installation of VS2012.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Many of developers might have experienced this scenario of unit test not getting executing in VS 2010 after installation of VS2012 next to VS2010.&lt;br /&gt;
&lt;br /&gt;
The simple solution to this problem is to install &lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=23691&quot;&gt;VS2010 SP1&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
For more insight on the issue have a look on this &lt;a href=&quot;http://connect.microsoft.com/VisualStudio/feedback/details/728659/mstest-not-working-after-installing-vs11-next-to-vs10&quot;&gt;link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Hope this helps :)&lt;/div&gt;
</description><link>http://ivarunsingh.blogspot.com/2013/02/unit-test-not-running-in-vs-2010-after.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-7143296801448678913</guid><pubDate>Sun, 20 Jan 2013 14:29:00 +0000</pubDate><atom:updated>2013-01-20T19:59:46.844+05:30</atom:updated><title>Prime Numbers Up to a range K</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In order to find all of the prime numbers up to a range &amp;nbsp;K, we can use Sieve of &amp;nbsp;Eratosthene.Please find below the algorithm:-&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 17.77777862548828px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: whitesmoke; font-family: Consolas, Monaco, &#39;Liberation Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12.222222328186035px; line-height: 20px; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; white-space: pre-wrap; width: 580px;&quot;&gt;isPrime[0] = false
isPrime[1] = false
for i = 2 to K do
    isPrime[i] = true
for i = 2 to sqrt(K) do
    if isPrime[i] then
        for j = i * i to K with step i do
            isPrime[j] = false&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; font-family: Consolas, Monaco, &#39;Liberation Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12.222222328186035px; line-height: 20px; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; white-space: pre-wrap; width: 580px;&quot;&gt;where you can consider isPrime as array of bool up to K. &lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Monaco, Liberation Mono, Lucida Console, monospace;&quot;&gt;&lt;span style=&quot;font-size: 12.222222328186035px; line-height: 20px; white-space: pre-wrap;&quot;&gt;I find out about this interesting algorithm during a programming contest and it can be useful for fast calculation of all prime numbers up to a &lt;/span&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px; white-space: pre-wrap;&quot;&gt;particular&lt;/span&gt;&lt;span style=&quot;font-size: 12.222222328186035px; line-height: 20px; white-space: pre-wrap;&quot;&gt; range.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Monaco, Liberation Mono, Lucida Console, monospace;&quot;&gt;&lt;span style=&quot;font-size: 12.222222328186035px; line-height: 20px; white-space: pre-wrap;&quot;&gt;For &lt;/span&gt;&lt;span style=&quot;font-size: 12px; line-height: 20px; white-space: pre-wrap;&quot;&gt;further reading , please refer to below link:&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; margin-bottom: 10px; overflow: auto; padding-left: 5px; padding-top: 5px; width: 580px;&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes&quot;&gt;&lt;span style=&quot;background-color: transparent; font-size: 12px; line-height: 20px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Monaco, Liberation Mono, Lucida Console, monospace;&quot;&gt;http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Monaco, &#39;Liberation Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12.222222328186035px; line-height: 20px; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;/div&gt;
</description><link>http://ivarunsingh.blogspot.com/2013/01/prime-numbers-up-to-range-k.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-4878379656920249542</guid><pubDate>Fri, 20 Jul 2012 04:51:00 +0000</pubDate><atom:updated>2012-07-20T10:21:04.184+05:30</atom:updated><title>Transaction got aborted ,WHY?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #3a3e43; font-family: inherit; font-size: 1.75em; font-style: inherit; line-height: 31px;&quot;&gt;Transaction Exception: The operation is not valid for the state of the transaction.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #3a3e43; font-family: inherit; font-size: 1.75em; font-style: inherit; line-height: 31px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;There may be different reasons for transaction exception in distributed transaction when we are using &lt;b&gt;TransactionScope &lt;/b&gt;in our code :-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;1. Transaction may get timed out and can cause this type of exception.So, when facing this type of exception in our code we should first check whether the transaction can be completed in specified time or not. If not then we should increase the transaction time .&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;Options to increase the transaction time out can be easily find out by going to msdn sites.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;2. Majority of time we got this type of exception when we are using TransactionScope and inside that TransactionScope ,we are opening some sql connection and executing some sql query.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TransactionScope&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Scope&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TransactionScope&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;TransactionScopeOption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;RequiresNew&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;using&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLServer&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Sql&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLServer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;m_connstring&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; border: 0px; color: grey; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;//code for sql query .&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;There may be couple of reason to get this type of error in such situations:-&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #3a3e43; line-height: 31px;&quot;&gt;Whenever we are calling some sql procedure and in sql procedure we might be using transaction due to which when any exception occurs in procedure then transaction gets rolled back and when we try to do other stuff inside the transaction Scope then we will get this error as transaction is already rolled back and we are trying to do operation using that invalid transaction.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;We might not be able to find out the cause of this error on code side when exception occurs in database side whenever we use &lt;b&gt;sqlreader &lt;/b&gt;in our code in try ,catch block (and in catch block we are eating exception).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;So, beware and try to lookout for&lt;b&gt; SQL reader&lt;/b&gt; in code when you face any such exception and then check stored procedure whether its throwing any exception or not.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;You might also look for transaction log,which system &amp;nbsp;generates for any distributed transaction.Since its not in scope of this post ,I am not talking about that in this post.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;&lt;i&gt;I hope this post can be helpful to you guys when you face this type of transaction exception.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #3a3e43;&quot;&gt;&lt;span style=&quot;line-height: 31px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://ivarunsingh.blogspot.com/2012/07/transaction-got-aborted-why.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-7412544811987560677</guid><pubDate>Wed, 27 Jun 2012 17:47:00 +0000</pubDate><atom:updated>2012-06-27T23:19:04.315+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Technology</category><title>Interesting .Net, Web concepts</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Interesting .Net and Web concepts&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Gac:-&lt;/i&gt;&lt;/u&gt;&lt;/b&gt; &amp;nbsp;&lt;a href=&quot;http://www.codeproject.com/Articles/4352/Demystifying-the-NET-Global-Assembly-Cache&quot;&gt;http://www.codeproject.com/Articles/4352/Demystifying-the-NET-Global-Assembly-Cache&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Sessions in Asp.Net:-&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://www.codeproject.com/Articles/32545/Exploring-Session-in-ASP-Net&quot;&gt;http://www.codeproject.com/Articles/32545/Exploring-Session-in-ASP-Net&lt;/a&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;i&gt;Values Type/Reference Type:-&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx&quot;&gt;http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;i&gt;Stack memory &amp;nbsp;in .Net:-&lt;/i&gt;&lt;/b&gt;&lt;/u&gt;&amp;nbsp;&lt;a href=&quot;http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx&quot;&gt;http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Http concepts:- &lt;/i&gt;&lt;/u&gt;&amp;nbsp;&lt;u&gt;&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;a href=&quot;http://www.jmarshall.com/easy/http/&quot;&gt;http://www.jmarshall.com/easy/http/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;i&gt;TPL introduction:-&lt;/i&gt;&lt;/b&gt;&lt;/u&gt;&amp;nbsp;&lt;a href=&quot;http://www.codeproject.com/Articles/152765/Task-Parallel-Library-1-of-n&quot;&gt;http://www.codeproject.com/Articles/152765/Task-Parallel-Library-1-of-n&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Single responsibility principle:-&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://www.developerfusion.com/article/137636/taking-the-single-responsibility-principle-seriously/&quot;&gt;http://www.developerfusion.com/article/137636/taking-the-single-responsibility-principle-seriously/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;i&gt;Event vs delegates:-&lt;/i&gt;&lt;/b&gt;&lt;/u&gt;&amp;nbsp;&lt;a href=&quot;http://blog.monstuff.com/archives/000040.html&quot;&gt;http://blog.monstuff.com/archives/000040.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u style=&quot;font-style: italic; font-weight: bold;&quot;&gt;Serialization in .Net:- &lt;/u&gt;&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms973893.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/ms973893.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note :-I will keep on adding other interesting topics in c# ,.net and of web concepts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://ivarunsingh.blogspot.com/2012/06/interested-net-web-concepts.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-9048930830909569512</guid><pubDate>Sun, 11 Mar 2012 10:17:00 +0000</pubDate><atom:updated>2012-03-11T22:28:39.360+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sockets</category><title>Sockets overview</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;u&gt;Sockets:Use it or Not&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Many of us have listened about socket &amp;nbsp;in our programming language but we may not have given enough attention to it.&lt;br /&gt;
Some basic questions comes in mind when we listen about socket :-&lt;br /&gt;
&lt;i&gt;What is socket? Why should I use socket ? What are &amp;nbsp;the benefits of using socket ? Should I use socket or not in my coding ? Is there other alternatives to socket programming ? What are the other ways ,using which I can do coding &amp;nbsp;without need of using sockets? &amp;nbsp;And One important question, I haven&#39;t used sockets till yet in my programming&amp;nbsp;career,so why should i bother of using it or pay attention to understand the process of socket communication?&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
These are some of questions which came to my mind also, when i first started doing some programming using sockets.So,I started doing research about this topic and found it very interesting . It is basically the &lt;b&gt;&lt;i&gt;base of &amp;nbsp;network communication&lt;/i&gt;&lt;/b&gt; in our programming world.&lt;br /&gt;
&lt;br /&gt;
The socket concept is not specific to any programming language, it is basically same concept in c#,java,c++ and other known programming languages for network communication.&lt;br /&gt;
&lt;br /&gt;
Here in this post ,&lt;i&gt;I will talk about sockets in c#.&lt;/i&gt;&lt;br /&gt;
So ,&lt;br /&gt;
Q -What is socket?&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;Ans-Sockets is a method for communication between a&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://searchenterprisedesktop.techtarget.com/definition/client&quot; style=&quot;background-color: white; color: #663366; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;client&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;program and a&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://whatis.techtarget.com/definition/0,,sid9_gci212964,00.html&quot; style=&quot;background-color: white; color: #663366; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;server&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;program in a network. A socket is defined as &quot;the endpoint in a connection.&quot; Sockets are created and used with a set of programming requests or &quot;function calls&quot; sometimes called the sockets application programming interface (&lt;/span&gt;&lt;a href=&quot;http://searchexchange.techtarget.com/definition/application-program-interface&quot; style=&quot;background-color: white; color: #663366; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; outline-color: initial; outline-style: initial; outline-width: 0px; text-align: -webkit-auto; text-decoration: none;&quot;&gt;API&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Calibri, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;).&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;The most common sockets API is the Berkeley &amp;nbsp;interface for sockets. Sockets can also be used for communication between processes within the same computer.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;That&#39;s the answer I found from a site which I think will give you a good definition to understand sockets and its use.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri, Helvetica, Arial, sans-serif; line-height: 19px;&quot;&gt;Also ,refer to link for &lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.aspx&quot; style=&quot;font-family: Calibri, Helvetica, Arial, sans-serif; line-height: 19px;&quot;&gt;sockets in .net&lt;/a&gt;&amp;nbsp;for further understanding of socket APIs in .net.&lt;br /&gt;
&lt;br /&gt;
For other above questions answers, I would say we have WCF &amp;nbsp;in .net for network communication.Internally WCF uses sockets for network communication. So, we can say WCF is just a wrapper on socket programming &amp;nbsp;which gives us many more &amp;nbsp;facilities than network communication e.g security ,&amp;nbsp;reliability&amp;nbsp;and other options when doing communication between services and clients.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sending &amp;nbsp;and Receiving data on network (Communication)&lt;/b&gt;&lt;br /&gt;
Before sending data using sockets on network we need to convert data into streams.Here comes the other concepts serialization and deserialization in our programming language to convert data into stream and converted stream back into data objects. FYI, In WCF we have DataContractSerialization and in web services we use normally XmlSerialization. I will not go&amp;nbsp;further into serialization and deserialization. You can easily found topics on serialization and deserialization by searching on Google but I am sharing msdn link on &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms731073.aspx&quot;&gt;serialization and deserialization in .net&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
So,our purpose to know what is socket and why should we use it.. is almost complete.&lt;br /&gt;
For more information on sockets, how they communicate and what type of data can be passed from one socket to another ,please refer the &lt;a href=&quot;http://www.rickylou.com/SCOPE/html/body_socket_overview.html&quot;&gt;link&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Next.. in this socket series , I will post &amp;nbsp;a simple example of web server using socket... (And also a simple comparison &amp;nbsp;of our web server code with IIS.. web server.)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
Please share your views on this topic and let me know .. what more you think .. i should add in this socket series.
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://ivarunsingh.blogspot.com/2012/03/sockets-overview.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-3255301651309117745</guid><pubDate>Fri, 16 Dec 2011 07:09:00 +0000</pubDate><atom:updated>2011-12-16T19:35:34.178+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Technology</category><title>Microsoft Report Viewer 2010</title><description>&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; style=&quot;background: white; line-height: 23.25pt; margin-bottom: .0001pt; margin-bottom: 0in; mso-outline-level: 1;&quot;&gt;&lt;b&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; font-size: 21pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;Using to Report Viewer 2010 in Asp.net web application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 23.25pt; margin-bottom: .0001pt; margin-bottom: 0in; mso-outline-level: 1;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; font-family: Arial, sans-serif; font-size: 10pt; line-height: 115%; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;To upgrade to Report viewer 2010 in a asp.net application, one has to do follow following steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Install report viewer 2010 redistributable in your machine from following location&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=6442&quot;&gt;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=6442&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;System requirement needed to install this report viewer package is provided on the link location.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Some configurations need to be done on web page where we want to use report viewer control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;Register and using report viewer control on the web page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;Web page should contain following lines of code:&lt;o:p&gt;&lt;/o:p&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/AVvXsEiMetI6gq0gR9B7wbCm1UJabz2JJUL6XHpGz7EuW7y5IRIzVCSImpgG-GfNtSQMIUR_Cq-IrRSV4hmjEGSJ-_Cn39xWgxUTbbnmz1wsZahHX6A1ixuLQvr67NDVASPWwEuFAwTntoVeA46C/s1600/RegisterReportviewer.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMetI6gq0gR9B7wbCm1UJabz2JJUL6XHpGz7EuW7y5IRIzVCSImpgG-GfNtSQMIUR_Cq-IrRSV4hmjEGSJ-_Cn39xWgxUTbbnmz1wsZahHX6A1ixuLQvr67NDVASPWwEuFAwTntoVeA46C/s1600/RegisterReportviewer.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Changes need to be done in web.config file to use report viewer 2010 and for more information on reportviewer 2010 ,see link&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; text-indent: 0px;&quot;&gt;:&lt;/span&gt;&lt;a href=&quot;http://gotreportviewer.com/&quot; style=&quot;text-indent: 0px;&quot;&gt;http://gotreportviewer.com/&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;Sample of web.config is shown below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&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/AVvXsEjKZzU-cSbuyyEjvCJ9pAQkGdvDcdJYwxypp21i8-Nl_O5-BtcOAb7amu8eHKlBJJ9r2Xf2ArPmvjEf-yNKOk4_ibPcAZZGIvkCOPQtICiQOM7BTm2X9uqC3PwYHBd_r1C6WeBWq3bDAllt/s1600/Reportviewer+webconfig.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKZzU-cSbuyyEjvCJ9pAQkGdvDcdJYwxypp21i8-Nl_O5-BtcOAb7amu8eHKlBJJ9r2Xf2ArPmvjEf-yNKOk4_ibPcAZZGIvkCOPQtICiQOM7BTm2X9uqC3PwYHBd_r1C6WeBWq3bDAllt/s1600/Reportviewer+webconfig.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://ivarunsingh.blogspot.com/2011/12/report-viewer-2010.html</link><author>noreply@blogger.com (Varun Singh)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMetI6gq0gR9B7wbCm1UJabz2JJUL6XHpGz7EuW7y5IRIzVCSImpgG-GfNtSQMIUR_Cq-IrRSV4hmjEGSJ-_Cn39xWgxUTbbnmz1wsZahHX6A1ixuLQvr67NDVASPWwEuFAwTntoVeA46C/s72-c/RegisterReportviewer.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-558505064762315868</guid><pubDate>Sat, 10 Dec 2011 06:58:00 +0000</pubDate><atom:updated>2011-12-16T19:35:34.207+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Technology</category><title>Microsoft.Build.Utilities.v3.5  &amp; Report Viewer 2008</title><description>&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:21.0pt; font-family:&amp;quot;inherit&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;border:none windowtext 1.0pt;mso-border-alt: none windowtext 0in;padding:0in;mso-font-kerning:18.0pt&quot;&gt;Microsoft.Build.Utilities.v3.5&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size:21.0pt; font-family:&amp;quot;inherit&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;border:none windowtext 1.0pt;mso-border-alt: none windowtext 0in;padding:0in;mso-font-kerning:18.0pt&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;I had to convert one of my Asp.net web applications from .Net 3.5 version to .Net 4.0 version i.e my task needs me to use only .Net 4 dll in replacement of .Net 3.5 dll. Now, I had to convert all of the related projects or libraries used by my web application to work with .Net 4.I had done the same by changing each of projects .Net framework to 4 from 3.5. Certainly, it’s a very easy task; even I got no sweat to do so in our Air-conditioned office&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt; font-family:Wingdings;mso-ascii-font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-hansi-font-family:Arial;mso-bidi-font-family:Arial;border:none windowtext 1.0pt; mso-border-alt:none windowtext 0in;padding:0in;mso-font-kerning:18.0pt; mso-char-type:symbol;mso-symbol-font-family:Wingdings;mso-bidi-font-weight: bold&quot;&gt;J&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in; padding:0in;mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;.  After changing, .net framework of all the related projects to 4 from 3.5 and done with some cosmetic changes to my web application to be compatible with .net framework 4, I had changed my web application  web.config( whatever changes one need  to do in web.config can be found in msdn ).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;After all these changes with my web application, I tested my application and it was working fine on my development machine. This is not the end of story of this blog, real challenge starts from this onwards. Now I have to test my application on clean windows 2K8 server with IIS7. Then, I deployed my web application there on IIS7 in windows 2k8 server. When I entered username and password to web application then application crashed and showed me an error that it failed to load Microsoft.Build.Utilities.v3.5 dll. Now, it was my time to get surprised, how can it (web application) fail to load a .net 3.5 framework dll? And  If I had forgotten to convert some project from .net 3.5 to .net 4 version then it should had been caught by me while I was testing the application on my development  machine(windows 7) which hadn’t had .net 3.5 version installed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;After that I checked my web application again , I checked all projects , all of them were already targeted to .net framework version 4.Then I suspected my web.config  but there was no sign that I was trying to use any .net framework 3.5 dll or especially Microsoft.Build.Utilities.v3.5 dll. Then I got to know that IIS 7 has a feature from where I can enable .net framework 3.5 and I checked that feature but it was also disabled. Now, it was hard to believe about this abnormal behavior by my web application. Finally, I searched info about this dll on internet and get to know that the dll has something to do with SSRS Report Viewer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;I checked about the report viewer in my application and my application was using repot viewer 2008 and finally I got to know about the real culprit report viewer 2008.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt&quot;&gt;Summary:-&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;Report Viewer 2008 does use Microsoft.Build.Utilities.v3.5 dll.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;To remove reference of culprit Microsoft.Build.Utilities.v3.5 dll, I upgraded report viewer from 2008 to 2010 &lt;/span&gt;&lt;span style=&quot;font-size:10.0pt;font-family:Wingdings;mso-ascii-font-family: Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;mso-hansi-font-family:Arial; mso-bidi-font-family:Arial;border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in; padding:0in;mso-font-kerning:18.0pt;mso-char-type:symbol;mso-symbol-font-family: Wingdings;mso-bidi-font-weight:bold&quot;&gt;J&lt;/span&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:21.0pt; font-family:&amp;quot;inherit&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;border:none windowtext 1.0pt;mso-border-alt: none windowtext 0in;padding:0in;mso-font-kerning:18.0pt&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; border:none windowtext 1.0pt;mso-border-alt:none windowtext 0in;padding:0in; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom:0in;margin-bottom:.0001pt;line-height: 23.25pt;mso-outline-level:1;background:white&quot;&gt;&lt;span style=&quot;font-size:10.0pt; font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-font-kerning:18.0pt;mso-bidi-font-weight:bold&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;</description><link>http://ivarunsingh.blogspot.com/2011/12/microsoftbuildutilitiesv35-report.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-6694384287375954275</guid><pubDate>Sun, 30 Jan 2011 12:29:00 +0000</pubDate><atom:updated>2011-12-16T19:35:34.214+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Technology</category><title>Simple Asp.net page</title><description>Simple ASP.net page (using Visual studio)!!!&lt;br /&gt;&lt;br /&gt;If you are going to start developing a web application in microsoft technology then asp.net is the platform you are looking for...&lt;br /&gt;&lt;br /&gt;Before start writing code for a simple asp.net page, a question clicks on my mind .....&lt;br /&gt;&lt;br /&gt;Q- As a beginner, what i would expect when i have to start coding to make a  simple  web page  using asp.net technology?&lt;br /&gt;A- I would like to see my web page running along with knowing some of the basic funda&#39;s of doing  coding using asp.net at that time .&lt;br /&gt;&lt;br /&gt;Some of the concepts to keep in mind before starting:&lt;br /&gt;1 - We can use any language C# or VB to do coding in Asp.net as basic .net framework is there to  handle language compatibility.&lt;br /&gt;&lt;br /&gt;2 - Unlike a traditional desktop program (which users start by running a stand-alone EXE file), ASP.NET applications are almost always divided into multiple web pages. This division means a user can enter an ASP.NET application at several different points or follow a link from the application to another part of the website or another web server.&lt;br /&gt;&lt;br /&gt;3 - ASP.NET File Types:-&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Ends with .aspx&lt;/span&gt;  -&gt; These are ASP.NET web pages.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Ends with .ascx&lt;/span&gt; -&gt; These are ASP.NET user controls. User controls are similar to web pages,except that the user can’t access these files directly. Instead, they must be hosted inside an ASP.NET web page. User controls allow you to develop a small piece of user interface and reuse it in as many web forms as you want without repetitive code. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Ends with .asmx&lt;/span&gt;  -&gt; These are ASP.NET web services—collections of methods that can be called over the Internet. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;web.config&lt;/span&gt;  -&gt; This is the XML-based configuration file for your ASP.NET application. It includes settings for customizing security, state management, memory management, and much more.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Global.asax &lt;/span&gt;-&gt; This is the global application file. You can use this file to define global variables (variables that can be accessed from any web page in the webapplication) and react to global events (such as when a web applicationfirst starts). &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Ends with .cs&lt;/span&gt; -&gt; These are code-behind files that contain C# code. They allow you to separate the application logic from the user interface of a web page.&lt;/li&gt;&lt;/ul&gt;4 -ASP.NET server-side controls:-&lt;br /&gt;ASP.NET actually provides two sets of server-side controls that you can incorporate into your web forms.&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;HTML server controls&lt;/span&gt; -&gt; These are server-based equivalents for standard HTML elements.These controls are ideal if you’re a seasoned web programmer who prefers to work with familiar HTML tags (at least at first). They are also useful when migrating ordinary HTMLpages or ASP pages to ASP.NET, because they require the fewest changes.&lt;/li&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Web controls&lt;/span&gt; -&gt; These are similar to the HTML server controls, but they provide a richer object model with a variety of properties for style and formatting details. They also provide more events and more closely resemble the controls used for Windows development.Web controls also feature some user interface elements that have no direct HTML equivalent,such as the GridView, Calendar, and validation controls.&lt;/li&gt;&lt;/ul&gt;Now, lets start to create a simple new web form in Visual Studio. To do this,&lt;br /&gt;select Website -&gt; Add New Item. In the Add New Item dialog box, choose Web Form, type a name for the new page (such as SimplePage.aspx), make sure the Place Code in Separate File option is checked,and click Add to create the page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the new web form, some of the basic code would be automatically included  in the .aspx file.The  code contains many elements one such is page directive.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The page directive&lt;/span&gt; gives ASP.NET basic information about how to compile the page.&lt;br /&gt;It indicates the language you’re using for your code and the way you connect your event handlers.If you’re using the code-behind approach, which is recommended, the page directive&lt;br /&gt;also indicates where the code file is located and the name of your custom page class.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;CodeFile=&quot;SimplePage.aspx.cs&quot; Inherits=&quot;SimplePage&quot; %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In an ASP.NET web form, the doctype gets second place, and appears just underneath the page directive.&lt;br /&gt;The doctype indicates the type of markup (for example, HTML or XHTML) that you’re&lt;br /&gt;using to create your web page. Technically, the doctype is optional, but Visual Studio adds it&lt;br /&gt;automatically. This is important, because depending on the type of markup you’re using there&lt;br /&gt;may be certain tricks that aren’t allowed. For example, strict XHTML doesn’t let you use HTML&lt;br /&gt;formatting features that are considered obsolete and have been replaced by CSS.&lt;br /&gt;The doctype is also important because it influences how a browser interprets your web page.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Every XHTML document starts out with this basic structure (right after the doctype):&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &quot;&lt;&quot;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;  head runat=&quot;server&quot;&lt;/span&gt;  &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;  title&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; Untitled Page  &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/title&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;  /head&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;   body&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; /body&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt; &quot;&lt;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/html&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you create a new web form in Visual Studio, this is the structure you start with.&lt;br /&gt;Here’s what you get:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; XHTML documents start with the  tag and end with the tag. This element contains the complete content of the web page.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; Inside the  element, the web page is divided into two portions. The first portion is the  element, which stores some information about the web page. You’ll use this to store the title of your web page, which will appear in the title bar in your web browser. (You can also add other details here like search keywords, although these are mostly ignored by web browsers these days.) When you generate a web page in Visual Studio, the  section has a runat=&quot;server&quot; attribute. This gives you the ability to manipulate it in your code (a topic you’ll explore in the next chapter).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; The second portion is the  element, which contains the actual page content that appears in the web browser window.&lt;/li&gt;&lt;/ul&gt;In an ASP.NET web page, there’s at least one more element. Inside the  element is a&lt;br /&gt;&lt;form&gt; element. The  element is required because it defines a portion of the page that&lt;br /&gt;can send information back to the web server. This becomes important when you start adding&lt;br /&gt;text boxes, lists, and other controls. As long as they’re in a form, information like the current&lt;br /&gt;text in the text box and the current selection in the list will be sent to the web server using a&lt;br /&gt;process known as a postback.&lt;br /&gt;&lt;br /&gt;As far as we are familiar with the basic structure of .aspx page in web application in asp.net now, we will see where can we do the coding in web form.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Writing Code :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Code-Behind Class:-&lt;br /&gt;When you switch to code view, you’ll see the page class for your web page.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;&lt;br /&gt;public partial class SimplePage: System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;             protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;               {&lt;br /&gt;                }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This simple page is the class where we can add logic(Although good practice is to write business logic code in some class library which can be referenced into your asp.net web application ) to do some simple work in our application.&lt;br /&gt;&lt;br /&gt;Now in order to show some thing on the webpage, I am writing some code in Page_Load event :&lt;br /&gt;&lt;br /&gt;public partial class SimplePage: System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;              protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;               {&lt;br /&gt;                         Response.Write(&quot;Hello World&quot;);&lt;br /&gt;                }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This code will display &quot; Hello World &quot; on your first web page when we run the website using F5 command in visual studio.&lt;br /&gt;&lt;br /&gt;Finally its over ,your first web page is running....:)&lt;br /&gt;&lt;br /&gt;* Please try to see the Page Life Cycle overview from http://msdn.microsoft.com/en-us/library/ms178472.aspx to go for next stage.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope this would prove somewhat  helpful for you guys to get some  conceptual view  before running you first web page in asp.net  technology.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;</description><link>http://ivarunsingh.blogspot.com/2011/01/simple-aspnet-page.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-379239070330308059</guid><pubDate>Thu, 06 Aug 2009 17:25:00 +0000</pubDate><atom:updated>2011-12-16T19:35:34.191+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Technology</category><title>Difference between two dates as x month and y days.</title><description>If you have to find the difference between two dates as x month and y days .&lt;br /&gt;&lt;br /&gt;Let the two dates  be &quot;StartDate&quot; and &quot;EndDate&quot; and x be the month and y be the days after taking difference between StartDate and EndDate.&lt;br /&gt;int x,y;&lt;br /&gt;x= MonthDifference(StartDate,EndDate);&lt;div id=&quot;:zd&quot; class=&quot;ii gt&quot;&gt;&lt;wbr&gt;&lt;/div&gt;&lt;br /&gt;where  MonthDifference(startDate,EndDate) is a function :&lt;br /&gt;&lt;br /&gt;public int MonthDifference(DateTime startDate, DateTime endDate)&lt;br /&gt;        {&lt;br /&gt;            int noOfYears = endDate.Year - startDate.Year;&lt;br /&gt;            int noOfMonths = (endDate.Month - startDate.Month);&lt;br /&gt;            noOfMonths = noOfMonths + (noOfYears * 12);&lt;br /&gt;            return noOfMonths;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//To calculate No of Days and Month ..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (System.DateTime.DaysInMonth(EndDate.Year, EndDate.Month)== (EndDate.Day - StartDate.Day + 1))&lt;div id=&quot;:139&quot; class=&quot;ii gt&quot;&gt;&lt;wbr&gt;&lt;br /&gt;        {&lt;br /&gt;                    x = x+ 1;&lt;br /&gt;                    y = 0;&lt;br /&gt;        }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    if(EndDate.Day &lt; StartDate.Day)&lt;br /&gt;                    {&lt;br /&gt;                         y = System.DateTime.DaysInMonth(&lt;wbr&gt;user.EndDate.AddMonths(-1).&lt;wbr&gt;Year,&lt;br /&gt;user.EndDate.AddMonths(-1).&lt;wbr&gt;Month) -&lt;br /&gt;                            StartDate.Day + EndDate.Day + 1;&lt;br /&gt;                        x = x - 1;&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                    {&lt;br /&gt;                        y= EndDate.Day -StartDate.Day + 1;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In this way you can get the difference between two  dates  as x month and y days.&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;Varun</description><link>http://ivarunsingh.blogspot.com/2009/08/difference-between-two-dates-as-x-month.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7538122901722277480.post-547698010814801401</guid><pubDate>Mon, 03 Aug 2009 16:35:00 +0000</pubDate><atom:updated>2011-12-16T19:35:34.198+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net Technology</category><title>Default parameters in c# 4</title><description>I just read about a very cool feature of &quot;default parameter&quot;  in a webblog of a microsoft employee.I just want that others should also be aware of this feature so,I am included this in my post also.&lt;br /&gt;&lt;br /&gt;Presently in c# 3.5 we all are just using the function overloading in order to provide the default or optional parameter functionality.e.g&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; oldclass&lt;br /&gt;  {&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; A{ get; set; }&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; B{ get; set; }&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; C{ get; set; }&lt;br /&gt;    &lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; oldclass(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; a)&lt;br /&gt;      {&lt;br /&gt;          A= a;&lt;br /&gt;          B= &quot;B&quot;;&lt;br /&gt;          C= &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;      }&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; oldclass(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; a, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; b)&lt;br /&gt;      {     &lt;br /&gt;          A= a;&lt;br /&gt;          B= b;&lt;br /&gt;          C= &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;       &lt;br /&gt;      }&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; oldclass(&lt;span class=&quot;kwrd&quot;&gt;string &lt;/span&gt;a, &lt;span class=&quot;kwrd&quot;&gt;string &lt;/span&gt;b, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; c)&lt;br /&gt;      {&lt;br /&gt;          A= a;&lt;br /&gt;          B= b;&lt;br /&gt;          C= c;&lt;br /&gt;      }&lt;br /&gt;  }&lt;/pre&gt;But now in c# 4 what we do is:-&lt;br /&gt;&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; newclass&lt;br /&gt;  {&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; A{ get; set; }&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; B{ get; set; }&lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; C{ get; set; }&lt;br /&gt;            &lt;br /&gt;      &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; newclass(&lt;span class=&quot;kwrd&quot;&gt;string &lt;/span&gt;a, &lt;span class=&quot;kwrd&quot;&gt;string &lt;/span&gt;b=&quot;B&quot;, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; c=&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Empty)&lt;br /&gt;      {&lt;br /&gt;          A= a;&lt;br /&gt;          B= b;&lt;br /&gt;          C= c;&lt;br /&gt;      }&lt;br /&gt;  }&lt;/pre&gt; if we initialize constructor using-&gt;  new newclass(&quot;A&quot;);&lt;br /&gt;then values for A=&quot;A&quot;,B=&quot;B&quot;and C=&quot;&quot;.&lt;br /&gt;&lt;br /&gt;So,Its quite cool to include this feature in c# 4 so that now,we don&#39;t have to use function overloading  for getting functionality of optional parameters.</description><link>http://ivarunsingh.blogspot.com/2009/08/default-parameters-in-c-4.html</link><author>noreply@blogger.com (Varun Singh)</author><thr:total>0</thr:total></item></channel></rss>