<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6009548706836831313</id><updated>2024-09-04T15:34:41.023-07:00</updated><title type='text'>kapil Kshirsagar</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6009548706836831313.post-6299559504751304351</id><published>2015-05-13T07:09:00.002-07:00</published><updated>2015-05-14T00:40:36.302-07:00</updated><title type='text'>Test for time</title><content type='html'>

&lt;!-- Google Tag Manager --&gt;
&lt;noscript&gt;&lt;iframe src=&quot;//www.googletagmanager.com/ns.html?id=GTM-WQNW4G&quot;
height=&quot;0&quot; width=&quot;0&quot; style=&quot;display:none;visibility:hidden&quot;&gt;&lt;/iframe&gt;&lt;/noscript&gt;
&lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({&#39;gtm.start&#39;:
new Date().getTime(),event:&#39;gtm.js&#39;});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=&#39;dataLayer&#39;?&#39;&amp;l=&#39;+l:&#39;&#39;;j.async=true;j.src=
&#39;//www.googletagmanager.com/gtm.js?id=&#39;+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,&#39;script&#39;,&#39;dataLayer&#39;,&#39;GTM-WQNW4G&#39;);&lt;/script&gt;
&lt;!-- End Google Tag Manager --&gt;


&lt;a href=&quot;http://kapilkshirsagar.blogspot.com/2015/05/functionwdsliwlwlwl.html&quot;&gt; This is the rhythm of the life!! &lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/6299559504751304351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/05/functionwdsliwlwlwl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/6299559504751304351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/6299559504751304351'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/05/functionwdsliwlwlwl.html' title='Test for time'/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6009548706836831313.post-2065118458676702787</id><published>2015-03-19T07:26:00.004-07:00</published><updated>2015-03-19T07:27:04.118-07:00</updated><title type='text'>How to make all columns as Text in excel export in ASP.NET</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some time integer or any other datatype columns internally get formatted and shows scientific numbers instead of actual value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve this issue we can use following &quot;style&quot; to make all columns as Text in excel.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;string &lt;/span&gt;style = &lt;span style=&quot;color: #990000;&quot;&gt;@&quot;&amp;lt;style&amp;gt; TD { mso-number-format:\@; } &amp;lt;/style&amp;gt;&quot;&lt;/span&gt;;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/2065118458676702787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/03/how-to-make-all-columns-as-text-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/2065118458676702787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/2065118458676702787'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/03/how-to-make-all-columns-as-text-in.html' title='How to make all columns as Text in excel export in ASP.NET'/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6009548706836831313.post-8163832268421434907</id><published>2015-02-13T02:59:00.002-08:00</published><updated>2015-02-13T03:00:03.043-08:00</updated><title type='text'>View State Vs. Session State Vs. Application State</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are a number of articles and 
blogs available about ASP.NET state management. I have tried writing 
this article for beginners explaining these concepts in simple language 
and step-by-step.&lt;br /&gt;
&lt;br /&gt;
This is a very basic article for beginners that
 show various state management techniques. It is very confusing for the 
developers when working with states in ASP.NET web applications. This 
article will help to understand how practically we should use these. 
Working with ASP.NET it is very important to understand and use the 
various states maintenance techniques available. Maintaining states 
during ASP.NET requests is very important from the application 
perspective.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Stateless Nature of Web application&lt;/b&gt;&lt;br /&gt;
Web
 applications run on HTTP protocols and this HTTP protocol is stateless 
in nature, meaning it does not remember state or retain any state 
between requests and responses.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Web application Processing&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Whenever
 a web application is compiled, the entire source code of the project is
 compiled into an intermediate language and generates an output assembly
 that is a DLL residing in the bin folder of the project directory.&lt;br /&gt;
&lt;br /&gt;
When
 the application URL is requested by a user, The web server loads the 
requested project DLL into memory and creates an instance of the web 
form requested that results in the creation of a new instance of web 
form and all the controls and variables available on that requested web 
form.&lt;br /&gt;
&lt;br /&gt;
After creation it completes the page life cycle and renders
 the output as HTML and sends back the HTML output to the browser as a 
response. Then the web form object is immediately destroyed, meaning 
that the web form with their control is immediately something after 
rendering.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Various state management techniques&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;A.&lt;/b&gt; Client-side State Management:&amp;nbsp; 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;View State 
&lt;/li&gt;
&lt;li&gt;Hidden Field 
&lt;/li&gt;
&lt;li&gt;Cookies 
&lt;/li&gt;
&lt;li&gt;Control State &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;B.&lt;/b&gt; Server-side State Management:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Session 
&lt;/li&gt;
&lt;li&gt;Application Object 
&lt;/li&gt;
&lt;li&gt;Caching &lt;/li&gt;
&lt;/ul&gt;
We can see a number of ways of doing 
state management as listed above. But I am going to explain View state, 
Session State and application state in this article.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;View State&lt;/b&gt;&lt;br /&gt;
View
 State is a technique to maintain the state of controls during page 
post-back, meaning it stores the page value at the time of post-back 
(sending and receiving information from the server) of your page and the
 view state data can be used when the page is posted back to the server 
and a new instance of the page is created.&lt;br /&gt;
&lt;br /&gt;
View state data is 
nothing but a serialized base-64 encoded string stored in a hidden input
 field on the page and it travels between the browser and the server on 
every user request and response.&lt;br /&gt;
&lt;br /&gt;
On the web server it is encoded on the page init event of the page&#39;s 
life and assigned back to the variable and after the HTML rendering and 
sent back to the browser with the values to client.&lt;br /&gt;
&lt;br /&gt;
View State advantages:&amp;nbsp; 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Very easy to implement. 
&lt;/li&gt;
&lt;li&gt;Stored on the client browser in a hidden field as a form of Base64 Encoding String not encrypted and can be decoded easily. 
&lt;/li&gt;
&lt;li&gt;Good with HTTP data transfer &lt;/li&gt;
&lt;/ul&gt;
View State disadvantages:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The performance overhead for the page is larger data stored in the view state. 
&lt;/li&gt;
&lt;li&gt;Stored as encoded and not very safe to use with sensitive information. &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Where to Use&lt;/b&gt;&lt;br /&gt;
View
 state should be used when the user needs to store a small amount of 
data at the client browser with faster retrieval. The developer should 
not use this technique to retain state with larger data since it will 
create a performance overhead for the webpage. It should be used for 
sending data from one page to another. Not very secure to store 
sensitive information.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ASP.NET Session State&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Session
 State is another state management technique to store state, meaning it 
helps in storing and using values from previous requests. Whenever the 
user requests a web form from a web application it will get treated as a
 new request. an ASP.NET session will be used to store the previous 
requests for a specified time period.&lt;br /&gt;
&lt;br /&gt;
Session variables are stored in a SessionStateItemCollection object that is exposed through the HttpContext.Session property.&lt;br /&gt;
&lt;br /&gt;
By
 default, an ASP.NET session state is enabled for all ASP.NET 
applications. Session state data is shared across all the web pages, in 
other words when navigating from one page session the data would 
available.&lt;br /&gt;
&lt;br /&gt;
Session variables are single-user global data stored on the web server, 
meaning by default a session state variable is stored in the web server 
memory and is available across all pages but it will be for a single 
session.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SessionID&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Client Machine Cookies
 are being used by a session to store a session id. This Session ID is 
being used by the web server to differentiate among requests of the same
 user or different ones. SessionID is nothing but a property to uniquely
 identify a browser with session data on the server. The SessionID value
 is randomly generated by ASP.NET and stored in a non-expiring session 
cookie in the browser. The SessionID value is then sent in a cookie with
 each request to the ASP.NET application.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Definition Reference: MSDN &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Dear friends, unfortunately I am not explaining much about cookies here but it is important to spend some time for cookies also.&lt;br /&gt;
&lt;br /&gt;
Cookies
 are nothing but a small bit of text that accompanies requests and pages
 as they go between the web server and the browser. The cookie contains 
information about the web application that can be read whenever the user
 visits the site. &lt;br /&gt;
&lt;br /&gt;
The Session id will be sent as part of the URL in every request and if 
the session id is removed or changed it will be taken as a new request. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://localhost:7291/%28S%28hkjtkowaucoyytjjfgha41ab%29%29/Default.aspx&quot;&gt;http://localhost:7291/(S(hkjtkowaucoyytjjfgha41ab))/Default.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Session Modes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Session modes explain how session 
variables are being stored, in other words what storage type is used by 
the variable and what is their behavior.&lt;br /&gt;
&lt;br /&gt;
The default behavior is in memory in an ASP .NET worker process.&lt;br /&gt;
&lt;br /&gt;
Here are the various session modes available in ASP.NET.&amp;nbsp; 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Off 
&lt;/li&gt;
&lt;li&gt;InProc 
&lt;/li&gt;
&lt;li&gt;StateServer 
&lt;/li&gt;
&lt;li&gt;SQLServer 
&lt;/li&gt;
&lt;li&gt;Custom &lt;/li&gt;
&lt;/ul&gt;
Each mode has a different behavior in a web application. They have their own advantages and disadvantages.&lt;br /&gt;
&lt;br /&gt;
Guys,
 It is very important to understand about the session modes when you are
 working with an ASP.NET application with session variables as state 
management techniques. The session modes selected as mode in webconfig 
enables the ways session variable are stored and it will be then 
responsible for the application behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Off&lt;/b&gt;If
 an application has no requirement or need for session state then it&#39;s 
very important to use the off mode. By using this application 
performance will be better.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;InProc Mode&lt;/b&gt;&lt;br /&gt;
InProc
 mode can be done in an ASP.NET web application using a configuration 
file by setting the mode attribute in the element SessionState.&lt;br /&gt;
&lt;br /&gt;
When Inproc session state is used the session variables are being stored
 on the web server memory inside the ASP.NET worker process.&lt;br /&gt;
&lt;br /&gt;
Confused?&lt;br /&gt;
&lt;br /&gt;
Here is the MSDN Definition that says:&lt;br /&gt;
&lt;br /&gt;
ASP.NET
 runs within a process known as the ASP.NET worker process. All ASP.NET 
functionality runs within the scope of this process.&lt;br /&gt;
&lt;br /&gt;
Basically session variables are stored in the executable that is an IIS 
worker process. So if the request is coming from the same user the data 
will be available.&lt;br /&gt;
&lt;br /&gt;
Advantages of InProc:&amp;nbsp; 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Easy to Implement. 
&lt;/li&gt;
&lt;li&gt;Complex Objects can be added without serialization. 
&lt;/li&gt;
&lt;li&gt;Best in performance compared to out-of-process modes. &lt;/li&gt;
&lt;/ul&gt;
Disadvantages of InProc :&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Not
 able to sustain the session values when the worker process/IIS is 
restarted. In that case data loss will happen witch make the application
 break. 
&lt;/li&gt;
&lt;li&gt;Scalability is a major problem. 
&lt;/li&gt;
&lt;li&gt;Not good for applications with a large user base. &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Where to Use&lt;/b&gt;&lt;br /&gt;
In
 Proc mode is best suited for the application that is hosted on a single
 server and mid size use base or the session variable used is not big, 
to avoid data loss and scalability issues. When there is a requirement 
for a web farm&amp;nbsp; or web garden deployments the “out of process “modes 
like state server or SQL Server modes are the best option.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;State Server Session Mode&lt;/b&gt;&lt;br /&gt;
The
 disadvantage of session data loss is due to the worker process recycle 
that can be reduced using another mode, the state server mode.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference MSDN Definition&lt;/b&gt;StateServer
 mode, that stores session state in a separate process called the 
ASP.NET state service. This ensures that session state is preserved if 
the web application is restarted and also makes session state available 
to multiple Web servers in a Web farm.&lt;br /&gt;
&lt;br /&gt;
ASP.NET is a Windows services that stores the session variable data in their process.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Procedure to &lt;/b&gt;&lt;b&gt;set up state server mode&lt;/b&gt;&lt;br /&gt;
Go to Run&amp;nbsp;then enter &quot;Services.msc&quot; then Start ASP.NET State Service.&lt;br /&gt;
&lt;br /&gt;
By default ASP.NET state service is in manual mode.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Server Name/IP Port&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
StateConnectionstring basically consists of the following;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Server/system:&lt;/b&gt; where an ASP.NET Windows service is running.&lt;br /&gt;
&lt;b&gt;Port:&lt;/b&gt; By default the state service listens to the TCP port 42424 that is configurable using the registry.&lt;br /&gt;
&lt;br /&gt;
Here
 in my example I am using my machine&#39;s Windows service to implement the 
state server mode. It could be a separate dedicated machine or a web 
server in the network depending on requirements.&lt;br /&gt;
&lt;br /&gt;
So now the 
session state variables are stored in a Widows service of the my machine
 so the recycling process of the ASP.NET worker process does not have 
any impact on the session variables.&lt;br /&gt;
&lt;br /&gt;
Advantages of State Server Mode:&amp;nbsp; 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Worker process recycling does not impact session variable data 
&lt;/li&gt;
&lt;li&gt;Can be stored on the same web server or different dedicated machine&lt;/li&gt;
&lt;/ul&gt;
Disadvantage of State Server Mode:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Restart of sate service could lead to session data loss. 
&lt;/li&gt;
&lt;li&gt;Slower than in proc mode &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;SQL Server Session Mode&lt;/b&gt;&lt;br /&gt;
When
 the Session mode of an ASP.NET application is set by SQL Server then 
the session variables are being stored in the SQL Server database. This 
mode also provides a reliable way to store session data and preserve 
values after an IIS or web server restart and best suited for the web 
farm like application deployment.&lt;br /&gt;
&lt;br /&gt;
Since we are storing the session variables in a SQL Server database we need a databse and table to store the data.&lt;br /&gt;
&lt;br /&gt;
At the location &quot;C:\Windows\Microsoft.NET\Framework64\v4.0.30319&quot; an exe named aspnet_regsql is present.&lt;br /&gt;
&lt;br /&gt;
It
 depends on the Window&#39;s operating system and the version of .Net 
framework installed on the machine. In my case I have Windows 7 and 
framework version 4.0 installed.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Procedure&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Go to Run then enter cmd&amp;nbsp;then open a command window&amp;nbsp;then enter&amp;nbsp;&quot;cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319&quot;.&lt;br /&gt;
&lt;br /&gt;
This will navigate to the location where aspnet_regsql.exe is present.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;aspnet regsql exe&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/aspnet%20regsql%20exe.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Run the tool from that location using the command below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Run the tool from location&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/Run%20the%20tool%20from%20location.jpg&quot; /&gt; &lt;br /&gt;
&lt;img alt=&quot;script&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/script.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;cmd exe&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/cmd%20exe.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;cmd exe page&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/cmd%20exe%20page.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;database&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/database.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Web Config&lt;/b&gt;&lt;br /&gt;
Do change the mode to SQL Server and provide the SQL connection string.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-xml&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;sessionState&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;mode&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;SQLServer&quot;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;customProvider&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;DefaultSessionProvider&quot;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;sqlConnectionString&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;Data&amp;nbsp;Source=abhishek-HP\devAbhi;integrated&amp;nbsp;security=SSPI&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
After doing all the required set up now our application is ready to run with SQL Server session mode.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;ql server session mode&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/Images/sql%20server%20session%20mode.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Advantages of SQL Server Mode 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Very secure and most reliable option for the session management. 
&lt;/li&gt;
&lt;li&gt;Session data will be able to survive after worker process restart or state window service restart. 
&lt;/li&gt;
&lt;li&gt;Most scalable compared to the other modes. 
&lt;/li&gt;
&lt;li&gt;Most suited for web garden&amp;nbsp;or web farm type deployments and able to handle larger data in the session. &lt;/li&gt;
&lt;/ul&gt;
Disadvantages of SQL Server mode&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Slow performance
&lt;/li&gt;
&lt;li&gt;Overhead for serialization and deserialization of complex data. &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Where to Use&lt;/b&gt;&lt;br /&gt;
Here
 we have learned about session state and various modes to store data in 
session variables. Every mode has some advantages and disadvantages for 
use in web applications. Basically it depends on the application 
behavior, use base and kind of deployment which session should be used. 
Guys, be careful when choosing the session modes since it leads to 
performance issues and data loss that hamper the web application.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Application State&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The MSDN Definition says:&amp;nbsp;&lt;/b&gt;Application
 state is a data repository available to all classes in an ASP.NET 
application. Application state is stored in memory on the server and is 
faster than storing and retrieving information in a database. Unlike 
session state, which is specific to a single user session, application 
state applies to all users and sessions.&lt;br /&gt;
&lt;br /&gt;
Application state is 
stored in an instance of the HttpApplicationState class. This class 
exposes a key-value dictionary of objects.&lt;br /&gt;
&lt;br /&gt;
Application state 
variables are also used to store data when navigatiing from one page to 
another. It&#39;s multi-user Global data meaning it will be accessible 
across all pages and all sessions. Application state variables are 
stored on the web server in ASP.NET worker process memory.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sample Code&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Addition of data in application variables.&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;Test&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;partial&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;applicationState&amp;nbsp;:&amp;nbsp;System.Web.UI.Page&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt;&amp;nbsp;Page_Load(&lt;span class=&quot;keyword&quot;&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;EventArgs&amp;nbsp;e)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&amp;nbsp;(!IsPostBack)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&amp;nbsp;(Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;]&amp;nbsp;==&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;0;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TextBox1.Text&amp;nbsp;=&amp;nbsp;Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;].ToString();&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt;&amp;nbsp;Button1_Click(&lt;span class=&quot;keyword&quot;&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;EventArgs&amp;nbsp;e)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&amp;nbsp;(Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;]&amp;nbsp;!=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;int&lt;/span&gt;&amp;nbsp;ApplicationCounter&amp;nbsp;=&amp;nbsp;(&lt;span class=&quot;keyword&quot;&gt;int&lt;/span&gt;)Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;]&amp;nbsp;+&amp;nbsp;1;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TextBox1.Text&amp;nbsp;=&amp;nbsp;ApplicationCounter.ToString();&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;ApplicationCounter;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt;&amp;nbsp;Button2_Click(&lt;span class=&quot;keyword&quot;&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;EventArgs&amp;nbsp;e)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Redirect(&lt;span class=&quot;string&quot;&gt;&quot;ApplicationStateTest.aspx&quot;&lt;/span&gt;);&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
Reading data from application variables:&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;ol class=&quot;dp-c&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;namespace&lt;/span&gt;&amp;nbsp;Test&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;&amp;nbsp;partial&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;class&lt;/span&gt;&amp;nbsp;ApplicationStateTest&amp;nbsp;:&amp;nbsp;System.Web.UI.Page&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;void&lt;/span&gt;&amp;nbsp;Page_Load(&lt;span class=&quot;keyword&quot;&gt;object&lt;/span&gt;&amp;nbsp;sender,&amp;nbsp;EventArgs&amp;nbsp;e)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&amp;nbsp;(Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;]&amp;nbsp;!=&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;null&lt;/span&gt;)&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Label1.Text&amp;nbsp;=&amp;nbsp;Application[&lt;span class=&quot;string&quot;&gt;&quot;Counter&quot;&lt;/span&gt;].ToString();&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
An
 application state variable does not have any default time unlike 
session variables. It will end when the application hosting process is 
restarted or the application ends.&lt;br /&gt;
&lt;br /&gt;
Application state variable 
data is not reliable for web farms or web garden type deployment since 
they are not shared across multiple web servers or multiple worker 
processes on the same machine so using application variable data could 
cause the problem of data loss and the application breaks.&lt;br /&gt;
&lt;br /&gt;
An 
application state variable is not thread safe, meaning multiple users 
from a different session can access the variable and can manipulate the 
variable.&lt;br /&gt;
&lt;br /&gt;
To ensure the data integrity and resolve concurrency 
issues while using application state variables, lock and unlock methods 
should be used.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Important Note&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Web farm:&lt;/b&gt; It&#39;s a situation where the web application is deployed on different servers with load balancer.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;Web garden&lt;/b&gt;: It&#39;s a situation where the web application is deployed on the same server with multiple worker processes.&lt;br /&gt;
&lt;br /&gt;
Advantages of application state:&amp;nbsp; 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Application variable data is multi-user global data stored in memory. 
&lt;/li&gt;
&lt;li&gt;Easy to access. 
&lt;/li&gt;
&lt;li&gt;Fast retrieval. &lt;/li&gt;
&lt;/ul&gt;
Disadvantages of application state:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Application variable data is not able to survive the IIS restart and worker process recycling. 
&lt;/li&gt;
&lt;li&gt;Not suited for web farm and web garden like deployment situation. &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Where to Use&lt;/b&gt;&lt;br /&gt;
An
 application variable is used only when the variable needs to have 
global access and when you need them for the entire time, during the 
lifetime of an application.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;
Guys,
 in the preceding explanation of view state, the session state and 
application state management techniques all have some advantages and 
disadvantages in web applications. We should very intelligently pick the
 technique analyzing our application usage and functionality used in the
 application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/8163832268421434907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/02/view-state-vs-session-state-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/8163832268421434907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/8163832268421434907'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/02/view-state-vs-session-state-vs.html' title='View State Vs. Session State Vs. Application State'/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6009548706836831313.post-6548748620032878415</id><published>2015-02-13T02:53:00.001-08:00</published><updated>2015-02-13T02:53:14.649-08:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;What is running on your SQL Server? &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;We can check execution status on our SQL Server by using sys.dm_exec_requests like follows. It also tell us the execution status:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;e.g.&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&amp;nbsp; &lt;/span&gt;t.text, r.*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;sys.dm_exec_requests&lt;/span&gt; r&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;CROSS APPLY&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;sys.dm_exec_sql_text&lt;/span&gt;(r.sql_handle) t&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/6548748620032878415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/02/what-is-running-on-your-sql-server-we.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/6548748620032878415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/6548748620032878415'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/2015/02/what-is-running-on-your-sql-server-we.html' title=''/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6009548706836831313.post-5360117716674455659</id><published>2011-01-26T22:47:00.000-08:00</published><updated>2011-01-29T07:40:58.433-08:00</updated><title type='text'>How to dump DLL exports</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h5 class=&quot;post-title entry-title&quot;&gt;You can dump .dll using this method &lt;/h5&gt;&lt;div class=&quot;post-header&quot;&gt;&lt;/div&gt;To print the function names that a Windows dynamic link library exports (DLL), you can use the &lt;span style=&quot;font-family: courier new;&quot;&gt;dumpbin.exe&lt;/span&gt; tool, which comes with Visual Studio. For example, the following command line exports all functions in &lt;a href=&quot;http://www.google.co.in/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBYQFjAA&amp;amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTrident_%28layout_engine%29&amp;amp;rct=j&amp;amp;q=mshtml.dll%20wiki&amp;amp;ei=1RBBTdT0GtDIrQe5nL0E&amp;amp;usg=AFQjCNEVNr_5d8Xa6AA8UcF1VMnKv1n_nQ&amp;amp;sig2=jNHYlUGySrcboo9FwfT9hg&amp;amp;cad=rja&quot;&gt; mshtml.dll &lt;/a&gt; :&lt;br /&gt;
&lt;div style=&quot;font-family: courier new;&quot;&gt;C:\&amp;gt;dumpbin.exe /exports C:\WINDOWS\ie8\mshtml.dll&lt;br /&gt;
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01&lt;br /&gt;
Copyright (C) Microsoft Corporation.  All rights reserved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dump of file C:\WINDOWS\ie8\mshtml.dll&lt;br /&gt;
&lt;br /&gt;
File Type: DLL&lt;br /&gt;
&lt;br /&gt;
Section contains the following exports for MSHTML.dll&lt;br /&gt;
&lt;br /&gt;
00000000 characteristics&lt;br /&gt;
41107F09 time date stamp Wed Aug 04 11:45:37 2004&lt;br /&gt;
0.00 version&lt;br /&gt;
1 ordinal base&lt;br /&gt;
19 number of functions&lt;br /&gt;
19 number of names&lt;br /&gt;
&lt;br /&gt;
ordinal hint RVA      name&lt;br /&gt;
&lt;br /&gt;
1    0 00141BB8 CreateHTMLPropertyPage&lt;br /&gt;
2    1 000BDFF6 DllCanUnloadNow&lt;br /&gt;
3    2 0013D3C2 DllEnumClassObjects&lt;br /&gt;
4    3 000E1AA6 DllGetClassObject&lt;br /&gt;
5    4 0013D243 DllInstall&lt;br /&gt;
6    5 0013D319 DllRegisterServer&lt;br /&gt;
7    6 0013D38D DllUnregisterServer&lt;br /&gt;
8    7 0019BCA4 MatchExactGetIDsOfNames&lt;br /&gt;
9    8 00140BD5 PrintHTML&lt;br /&gt;
10    9 001AD7CB RNIGetCompatibleVersion&lt;br /&gt;
11    A 001AA454 RunHTMLApplication&lt;br /&gt;
12    B 001A691E ShowHTMLDialog&lt;br /&gt;
13    C 001A692E ShowHTMLDialogEx&lt;br /&gt;
14    D 001A689A ShowModalDialog&lt;br /&gt;
15    E 001A5FEA ShowModelessHTMLDialog&lt;br /&gt;
16    F 001AD7D6 com_ms_osp_ospmrshl_classInit&lt;br /&gt;
17   10 001ADA6E com_ms_osp_ospmrshl_copyToExternal&lt;br /&gt;
18   11 001ADB14 com_ms_osp_ospmrshl_releaseByValExternal&lt;br /&gt;
19   12 001AD80C com_ms_osp_ospmrshl_toJava&lt;br /&gt;
&lt;br /&gt;
Summary&lt;br /&gt;
&lt;br /&gt;
D000 .data&lt;br /&gt;
1F000 .reloc&lt;br /&gt;
1B000 .rsrc&lt;br /&gt;
29A000 .text&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/5360117716674455659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kapilkshirsagar.blogspot.com/2011/01/how-to-dump-dll-exports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/5360117716674455659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/5360117716674455659'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/2011/01/how-to-dump-dll-exports.html' title='How to dump DLL exports'/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6009548706836831313.post-5440573475894003035</id><published>2010-11-02T02:16:00.001-07:00</published><updated>2010-11-02T03:13:34.666-07:00</updated><title type='text'>How to configure SQL Server 2005 to allow remote connections</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;h3 id=&quot;tocHeadRef&quot; style=&quot;font-size: 13px; margin: 15px 0px 5px;&quot;&gt;Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition&lt;/h3&gt;You must enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps:&lt;ol style=&quot;position: inherit;&quot;&gt;&lt;li style=&quot;position: inherit;&quot;&gt;Click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Start&lt;/strong&gt;, point to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Programs&lt;/strong&gt;, point to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Microsoft SQL Server 2005&lt;/strong&gt;, point to&lt;strong class=&quot;uiterm&quot;&gt;Configuration Tools&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server Surface Area Configuration&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;On the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server 2005 Surface Area Configuration&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;page, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Surface Area Configuration for Services and Connections&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;On the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Surface Area Configuration for Services and Connections&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;page, expand&lt;strong class=&quot;uiterm&quot;&gt;Database Engine&lt;/strong&gt;, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Remote Connections&lt;/strong&gt;, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Local and remote connections&lt;/strong&gt;, click the appropriate protocol to enable for your environment, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Apply&lt;/strong&gt;.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;OK&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;when you receive the following message:&lt;div class=&quot;message&quot; style=&quot;padding: 10px 30px;&quot;&gt;Changes to Connection Settings will not take effect until you restart the Database Engine service.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;On the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Surface Area Configuration for Services and Connections&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;page, expand&lt;strong class=&quot;uiterm&quot;&gt;Database Engine&lt;/strong&gt;, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Service&lt;/strong&gt;, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Stop&lt;/strong&gt;, wait until the MSSQLSERVER service stops, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Start&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;to restart the MSSQLSERVER service. &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h3 id=&quot;tocHeadRef&quot; style=&quot;font-size: 13px; margin: 15px 0px 5px;&quot;&gt;Enable the SQL Server Browser service&lt;/h3&gt;If you are running SQL Server 2005 by using an instance name and you are not using a specific TCP/IP port number in your connection string, you must enable the SQL Server Browser service to allow for remote connections. For example, SQL Server 2005 Express is installed with a default instance name of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;var&gt;Computer Name&lt;/var&gt;\SQLEXPRESS. You are only required to enable the SQL Server Browser service one time, regardless of how many instances of SQL Server 2005 you are running. To enable the SQL Server Browser service, follow these steps.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Important&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;These steps may increase your security risk. These steps may also make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We recommend the process that this article describes to enable programs to operate as they are designed to, or to implement specific program capabilities. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this process in your particular environment. If you choose to implement this process, take any appropriate additional steps to help protect your system. We recommend that you use this process only if you really require this process.&lt;ol style=&quot;position: inherit;&quot;&gt;&lt;li style=&quot;position: inherit;&quot;&gt;Click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Start&lt;/strong&gt;, point to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Programs&lt;/strong&gt;, point to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Microsoft SQL Server 2005&lt;/strong&gt;, point to&lt;strong class=&quot;uiterm&quot;&gt;Configuration Tools&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server Surface Area Configuration&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;On the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server 2005 Surface Area Configuration&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;page, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Surface Area Configuration for Services and Connections&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;On the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Surface Area Configuration for Services and Connections&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;page, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server Browser&lt;/strong&gt;, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Automatic&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;for&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Startup type&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Apply&lt;/strong&gt;.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;When you click the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Automatic&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;option, the SQL Server Browser service starts automatically every time that you start Microsoft Windows.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;Click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Start&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;Note&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;When you run the SQL Server Browser service on a computer, the computer displays the instance names and the connection information for each instance of SQL Server that is running on the computer. This risk can be reduced by not enabling the SQL Server Browser service and by connecting to the instance of SQL Server directly through an assigned TCP port. Connecting directly to an instance of SQL Server through a TCP port is beyond the scope of this article. For more information about the SQL Server Browser server and connecting to an instance of SQL Server, see the following topics in SQL Server Books Online:&lt;ul style=&quot;position: inherit;&quot;&gt;&lt;li style=&quot;position: inherit;&quot;&gt;SQL Server Browser Service&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;Connecting to the SQL Server Database Engine&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;Client Network Configuration&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;topOfPage&quot; style=&quot;margin: 10px 0px;&quot;&gt;&lt;a href=&quot;http://support.microsoft.com/kb/914277#top&quot; style=&quot;color: #07679a; text-decoration: none;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;h3 id=&quot;tocHeadRef&quot; style=&quot;font-size: 13px; margin: 15px 0px 5px;&quot;&gt;Create exceptions in Windows Firewall&lt;/h3&gt;These steps apply to the version of Windows Firewall that is included in Windows XP Service Pack 2 (SP2) and in Windows Server 2003. If you are using a different firewall system, see your firewall documentation for more information.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you are running a firewall on the computer that is running SQL Server 2005, external connections to SQL Server 2005 will be blocked unless SQL Server 2005 and the SQL Server Browser service can communicate through the firewall. You must create an exception for each instance of SQL Server 2005 that you want to accept remote connections and an exception for the SQL Server Browser service.&lt;br /&gt;
&lt;br /&gt;
SQL Server 2005 uses an instance ID as part of the path when you install its program files. To create an exception for each instance of SQL Server, you must identify the correct instance ID. To obtain an instance ID, follow these steps:&lt;ol style=&quot;position: inherit;&quot;&gt;&lt;li style=&quot;position: inherit;&quot;&gt;Click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Start&lt;/strong&gt;, point to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Programs&lt;/strong&gt;, point to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Microsoft SQL Server 2005&lt;/strong&gt;, point to&lt;strong class=&quot;uiterm&quot;&gt;Configuration Tools&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server Configuration Manager&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;In SQL Server Configuration Manager, click the SQL Server Browser service in the right pane, right-click the instance name in the main window, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Properties&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;On the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;SQL Server Browser Properties&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;page, click the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Advanced&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;tab, locate the instance ID in the property list, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;To open Windows Firewall, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Start&lt;/strong&gt;, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Run&lt;/strong&gt;, type&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;userInput&quot; style=&quot;font-weight: bold; margin: 10px 0px;&quot;&gt;firewall.cpl&lt;/span&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;OK&lt;/strong&gt;.&lt;h4 id=&quot;tocHeadRef&quot; style=&quot;font-size: 12px; margin: 10px 0px 5px;&quot;&gt;Create an exception for SQL Server 2005 in Windows Firewall&lt;/h4&gt;To create an exception for SQL Server 2005 in Windows Firewall, follow these steps:&lt;ol style=&quot;position: inherit;&quot;&gt;&lt;li style=&quot;position: inherit;&quot;&gt;In Windows Firewall, click the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Exceptions&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;tab, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Add Program&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;In the Add a Program window, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Browse&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;Click the C:\Program Files\Microsoft SQL Server\&lt;var&gt;MSSQL.1&lt;/var&gt;\MSSQL\Binn\sqlservr.exe executable program, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Open&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;OK&lt;/strong&gt;.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;The path may be different depending on where SQL Server 2005 is installed.&lt;var&gt;MSSQL.1&lt;/var&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is a placeholder for the instance ID that you obtained in step 3 of the previous procedure.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;Repeat steps 1 through 3 for each instance of SQL Server 2005 that needs an exception.&lt;/li&gt;
&lt;/ol&gt;&lt;h4 id=&quot;tocHeadRef&quot; style=&quot;font-size: 12px; margin: 10px 0px 5px;&quot;&gt;Create an exception for the SQL Server Browser service in Windows Firewall&lt;/h4&gt;To create an exception for the SQL Server Browser service in Windows Firewall, follow these steps:&lt;ol style=&quot;position: inherit;&quot;&gt;&lt;li style=&quot;position: inherit;&quot;&gt;In Windows Firewall, click the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Exceptions&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;tab, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Add Program&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;In the Add a Program window, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Browse&lt;/strong&gt;.&lt;/li&gt;
&lt;li style=&quot;position: inherit;&quot;&gt;Click the C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe executable program, click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;Open&lt;/strong&gt;, and then click&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class=&quot;uiterm&quot;&gt;OK&lt;/strong&gt;.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;The path may be different depending on where SQL Server 2005 is installed.&lt;/li&gt;
&lt;/ol&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://kapilkshirsagar.blogspot.com/feeds/5440573475894003035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kapilkshirsagar.blogspot.com/2010/11/how-to-configure-sql-server-2005-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/5440573475894003035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6009548706836831313/posts/default/5440573475894003035'/><link rel='alternate' type='text/html' href='http://kapilkshirsagar.blogspot.com/2010/11/how-to-configure-sql-server-2005-to.html' title='How to configure SQL Server 2005 to allow remote connections'/><author><name>kapil kshirsagar</name><uri>http://www.blogger.com/profile/17225792343554204944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ1B4oMmmo6WcCydTH6NwfTpRDP6vmugXGkXBl9UrQ9fI_vZOXgSQOxvF8a_AFIbMA9sQD4ZwGtxk6T90iFvP9PAbi2LLT5292rvZgyLY4mFxcLAKUqeqS-BU5EY10w/s220/DSC01664.JPG'/></author><thr:total>0</thr:total></entry></feed>