In this article, I would like to show how to create a SQL Server Database Backup file programmatically in C#.Net. Using this code you can make database backup utility in your programs/apps.

There are two types of session events available in

  • Session_Start
  • Session_End

You can auto generate number with character by this code-

On multi-core processors to improve application performance background just-in-time compilation is available to be utilized optionally. We can achieve this using ProfileOptimization class. ProfileOptimization class improves the startup performance of application domains in applications that require the just-in-time (JIT) compiler by performing background compilation of methods that are likely to be executed, based on profiles created during previous compilations.

Instead of enabling tracing for individual pages, you can enable it for your entire application. In that case, every page in your application displays trace information. Application tracing is useful when you are developing an application because you can easily enable it and disable it without editing individual pages. When your application is complete, you can turn off tracing for all pages at once.


Finalizers are special methods that are automatically called by the GC before the object is collected. They can only be called by the GC provided they exist. The .NET ultimate base class Object has a Finalize method that can be overridden by child objects (anyone basically). The purpose of finalizers is to ensure all unmanaged resources the object may be using are properly cleaned up prior to the end of the object lifetime.
If a type has an implemented (overridden) finalizer at the time of collection, the GC will first put the object in the finalization queue, then call the finalizer and then the object is destroyed.Finalizers are not directly supported by C# compilers; instead you should use destructors using the ~ character, like so:

The .NET framework comes with an entire namespace for handling e-mails, the System.Net.Mail namespace. In the following examples, we will use two classes from this namespace: The MailMessage class, for the actual e-mail, and the SmtpClient class, for sending the e-mail. 
As you may be aware, mails are sent through an SMTP server, and to send mails with the .NET framework, you will need access to an SMTP server. If you are testing things locally, the company that supplies your with Internet access, will usually have an SMTP server that you can use, and if you wish to use one of these examples on your actual website, the company that hosts your website will usually have an SMTP server that you can use. 

VIEWSTATE The hidden form field that is used to transfer the state from the server to the client and back View State The mechanism that enables the controls to store state at the client. 
VIEWSTATE concepts

  • VIEWSTATEis an ASP.NET feature that provides for retaining the values of page and control properties that change from one execution of a page to another.
  • Before ASP.NET sends a page back to the client, it determines what changes the program has made to the properties of the page and its controls. These changes are encoded into a string that is assigned to the value of a hidden input field named C.
  • When the page is posted back to the server, the VIEWSTATE field is sent back to the server along with the HTTP request. Then, ASP.NET retrieves the property values from the VIEWSTATE field and uses them to restore the page and control properties.
  • ASP.NET also uses view state to save the values of the page properties it uses, such as IsPostBack.
  • VIEWSTATE  is not used to restore data entered by a user into a text box or any other input control unless the control responds to change events.
  • If VIEWSTATE  is enabled for a data-bound control, the control will not be rebound when the page is reposted. Instead, the controls values will be restored from view state.

ASP.NET uses session state to track the state of each user of an application. To do that, it creates a session stale object that contains a unique session ID for each users session. This ID is passed back to the browser as part of the response and then turned to the server with the next request. can then use the session ID to get the session state object thats associated with the request.

To create a cookie, you instantiate an object from the HttpCookie class. Then, you include it in the HTTP response that the server sends back to the browser, and the users browser stores the cookie either in its own memory or in a text file on the client machines disk. 
A cookie that stored in the browser memory is called a session cookie because it exists only for that session. When the browser session ends, the contents of any session cookies are lost. Session cookies are what uses to track session IDs. In contrast, persistent cookies are written to disk, so they are maintained after the browser session ends. Whether session or persistent, though, once a cookie is sent to a browser, it is automatically returned to the server with each HTTP request.
Besides using cookies for session IDs, you can use cookies to save information that identifies each user so the users do not have to enter that information each time they visit your web site. You can also use cookies to store information that lets you personalize the web pages that are displayed for a user.
When you use cookies to store this type of information, you should keep in mind that some users may have disabled cookies on their browsers. In that case, you would not be able to save cookies on the users computer. Unfortunately, does not provide a way for you to determine whether a user has disabled cookies. As a result, if you use cookies in an application, you may need to notify the user that cookies must be enabled to use it.

Displaying 1 of 2Next
1 2
Need Help? Contact Us.

Log in


Forgot password?


New User