Show

Articles of level

Intermediate

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.

If you call a non-static method in static method then you should make an object of that non-static method and call it. Example- 

you can get the path of running .exe file written by this sample 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.

Serialization is the process of converting objects in to persistent data formats.

  • .NET 2.0 provides built-in classes to convert data to formats that are portable, or easy to transport to another location. 
  • This process of converting data into a portable format is called serialization. 
  • The process of restoring the object or data to its original state is called deserialization.
  • Portable/persistent format includes text files or series of bytes or we can store in the database.
  • The process of converting objects and data into these common format for storage or transportation is called serialization.
The following are the basic advantages of serialization:
  1. Serialization Creates a clone of an object
  2. It facilitate the transportation of an object through a network
We can achieve Serialization by any  of the following types:
  1. Binary Serialization
  2. SOAP Serialization
  3. XML Serialization
In this post we are going to discuss about Binary Serialization,

To load a Picture into the PictureBox control drag a PictureBox control and a Command Button from the Toolbox. When you click the Command Button, the picture you specified will be loaded into the Picturebox. The following code is a demonstration: 

Finalizers

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:

A date and time format string defines the text representation of a DateTime value that results from a formatting operation. In C# by calling any of the overloads of the DateTime constructor that allow you to specify specific elements of the date and time value like year , month or day.
  DateTime newDate = new DateTime(2015, 5, 1);
Here newDate represents year as 2015 and month as May and date as 1 .

Anonymous methods provide a technique to pass a code block as a delegate parameter. Anonymous methods are the methods without a name, just the body.
You need not specify the return type in an anonymous method; it is inferred from the return statement inside the method body.

Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*