19 March 2013

ADO.Net Interview Questions and Answers Part-I



ADO.Net Interview Questions and Answers:
Part -I
1)       What is an ADO.Net?
ADO.Net is commonly termed as ActiveX Data Objects which is a part of .Net Framework. ADO.Net framework has set of classes which are used to handle data access by connecting with different databases like SQL, Access, Oracle, etc…

      2)   What are two important objects of ADO.Net?
There are two important objects of ADO.Net:
DataReader and DataSet.

     3)    What are the namespaces used in ADO.Net to connect to a database?
                         The Following namespaces are used to connect to Database.
·         System.Data
·         System.Data.OleDb – A data provider used to access database such as Access, Oracle, or SQL.
·         System.Data.SQLClient -- Used to access SQL as the data provider.
·          
     4)  What are the data providers in ADO.NET framework?
Below Data Providers are used in ADO.NET framework.
·         .NET Framework Data Provider for SQL Server – A Data provider that provides access to Microsoft SQL Server 7.0 or later version and it uses the System.Data.SQLClient namespace.
·         .NET Framework Data Provider for OLE DB – A Data Provider that provides access to any database exposed by using OLE DB and it uses the System.Data.OleDb namespace.
·         .NET Framework Data Provider for ODBC – A Data Provider that provides access to any databases exposed by using ODBC and It uses the System.Data.Odbc namespace.
·         .NET Framework Data Provider for Oracle – A Data Provider that provides access to Oracle database 8.1.7 or later versions and it uses the System.Data.OracleClient namespace.

     5)  What is DataReader Object?
A DataReader is an object of ADO.Net which provides access to data from a specified data source. It consists of classes which sequentially read data from a data source like Oracle, SQL or Access.

    6)  What is Dataset Object?
A Dataset is set to be collection of data with a tabular column representation. Each column in the table represents a variable and the row represents to value of a variable. This Dataset object can be obtained from the database values.

    7) What is object pooling?
An Object pooling is nothing but a repository of the objects in memory which can be used later. This object pooling reduces the load of object creation when it is needed. Whenever there is a need of object, object pool manager will take the request and serve accordingly.

    8) What is connection pooling?
                                A Connection pooling consists of database connection so that the connection can be used or reused whenever there is request to the database. This pooling technique enhances the performance of executing the database commands. This pooling definitely reduces our time and effort.

9)  What is Data view?
Data view is the representation of data in various formats and it can be requested by the users. Data can be exposed in different sort orders or filter on the user condition with the help of Data view. Data Customization is also possible through Data View.

10) What is Data Adapter?
Data Adapter is a part of ADO.NET data provider which acts as a communicator between Dataset and the Data source. This Data adapter can perform Select, Insert, Update and Delete operations in the requested data source.

11)  What is the use of SqlCommand object?
SQLCommand object that allows user to interact with the database. This object mainly used to query the database and it can be of different types – Select, Insert, Update and Delete.

12)   What is the difference between ADO and ADO.Net?
ADO works with the connected data whereas ADO.Net works in a disconnected manner. ADO has main object called Recordset which is used to reference data. But ADO.Net has various objects to access the database.
ADO allows creating client side cursors whereas ADO.Net deals with both server side and server side cursors. ADO allows persisting records in XML format and ADO.Net allows manipulating data using XML.

13)   What are the benefits of ADO.Net?
The Following are the benefits of ADO.Net:
·         Programmability.
·         Maintainability.
·         Interoperability.
·         Performance.
·         Scalability.

14)  Connection string for SQL Server?
Standard Security
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
Trusted Connection:
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

 15)   What is the use of connection object?
ADO.Net Connection object is used to establish a connection between application and the data source. SQL Commands can be executed once this connection has been established. It is mandatory to close the connection object once data base activities are completed.

16)   What are all features of ADO.Net?
The Following are the features of ADO.Net:
·         Data Paging
·         Bulk Copy Operation
·         New Data Controls
·         DataReader’s execute methods.

17)   What is the difference between Responses. Expires and Response.ExpiresAbsolute?
Response. Expires property specify the minutes of page in cache from the time, the request has been served from server.
But Response.ExpiresAbsolute property provides exact time at which the page in cache expires.
Example -
Response. Expires – Set to 10 mins and it will stay in cache for 10 mins from time it has been requested
Response.ExpiresAbsolute – Oct 30 12:20:15. Till this specified time, Page will be in cache.
18)   What is the difference between Datareader and Dataset?
Following table gives difference between DataReader and Dataset:
DataReader
Dataset
Forward only
Loop through Dataset
Connected Recordset
Disconnected Recordset
Single table involved
Multiple tables involved
No relationship required
Relationship between tables maintained
No XML storage
Can be stored as XML
Occupies Less Memory
Occupies More memory
Read only
Can do addition / Updating and Deletion

19)   What are all components of ADO.Net data provider?
Following are the components of ADO.Net Data provider:
  • Connection object – Represents connection to the Database
  • Command object – Used to execute stored procedure and command on Database
  • ExecuteNonQuery – Executes command but doesn’t return any value
  • ExecuteScalar – Executes and returns single value
  • ExecuteReader – Executes and returns result set
  • DataReader – Forward and read only recordset
  • DataAdapter – This acts as a bridge between database and a dataset.

 20)   What are the differences between OLEDB and SQLClient Providers?
OLEDBprovider is used to access any database and provides flexibility of changing the database at any time.
SQLClientprovider is used to access only SQL Server database but it provides excellent performance than OLEDB provider while connecting with SQL Server database.
21)   What are the different execute methods of Ado.Net?
Following are different execute methods of ADO.Net command object:
  • ExecuteScalar – Returns single value from the dataset
  • ExecutenonQuery – Returns resultset from dataset and it has multiple values
  • ExecuteReader – Forwardonly resultset
  • ExecuteXMLReader – Build XMLReader object from a SQL Query

 22)   What are all the commands used with Data Adapter?
DataAdapter is used to retrieve data from a data source .Insertcommand, UpdateCommand and DeleteCommand are the commands object used in DataAdapter to manage update on the database.

 23)   What are all the different methods under sqlcommand?
There are different methods under SqlCommand and they are:
·         Cancel – Cancel the query
·         CreateParameter – returns SQL Parameter
·         ExecuteNonQuery – Executes and does not return result set
·         ExecuteReader – executes and returns data in DataReader
·         ExecuteScalar – Executes and returns single value
·         ExecuteXmlReader – Executes and return data in XMLDataReader object
·         ResetCommandTimeout – Reset Timeout property

 24)   What is the difference between Dataset. Clone and Dataset. Copy?
Dataset. Clone object copies structure of the dataset including schemas, relations and constraints. This will not copy data in the table.
Dataset. Copy – Copies both structure and data from the table.

25)   What is the difference between Command and CommandBuilder object?
Command is used to execute all kind of queries like DML and DDL. DML is nothing but Insert, Update and Delete. DDL are like Create and drop tables.
Command Builder object is used to build and execute DML queries like Create and Drop Tables.

26)  Is it possible to load multiple tables in a Dataset?
Yes, it is possible to load multiple tables in a single dataset.

27)  Which provider is used to connect MS Access, Oracle, etc…?
OLEDB Provider and ODBC Provider are used to connect to MS Access and Oracle. Oracle Data Provider is also used to connect exclusively for oracle database.

28)   Do we use stored procedure in ADO.Net?
Yes, stored procedures are used in ADO.Net and it can be used for common repetitive functions.

29)  What are the methods of XML dataset object?
There are various methods of XML dataset object:
GetXml() – Get XML data in a Dataset as a single string.
GetXmlSchema() – Get XSD Schema in a Dataset as a single string.
ReadXml() – Reads XML data from a file.
ReadXmlSchema() – Reads XML schema from a file.
WriteXml() – Writes the contents of Dataset to a file.
WriteXmlSchema() – Writes XSD Schema into a file.

 30)  What are all the different authentication techniques used to connect to MS SQL Server?
SQL Server should authenticate before performing any activity in the database. There are two types of authentication:
·         Windows Authentication – Use authentication using Windows domain accounts only.
·         SQL Server and Windows Authentication Mode – Authentication provided with the combination of both Windows and SQL Server Authentication.

31)  What are the Data providers in ADO.Net?
Following are the Data Providers used in ADO.Net:.
·         MS SQL Server.
·         OLEDB.
·         ODBC.

 32)  Which method is used by command class to execute SQL statements that return single value?
Execute Scalar method is used by command class to execute SQL statement which can return single values.

33)  Which keyword is used to accept variable number of parameters?
Params keyword is used to accept variable number of parameters.

34)  Which method in OLEDBAdapter is used to populate dataset with records?
Fill Method is used to populate dataset with records.

35)  Which object needs to be closed?
OLEDBReader and OLDDBConnectionobject need to be closed. This will stay in memory if it is not properly closed.

36)  What are different layers of ADO.Net?
There are three different layers of ADO.Net:
·         Presentation Layer
·         Business Logic Layer
·         Database Access Layer

 37)   What are typed and untyped dataset?
Typed datasets use explicit names and data types for their members but untyped dataset uses table and columns for their members.

38)  Which object is used to add relationship between two Datatables?
Data Relation object is used to add relationship between two or more datatable objects.

39) Which is the best method to get two values from the database?
ExecuteNonQuery is the best method to get two values from the database.

40)  What are all the classes that are available in System.Data Namespace?
The Following are the classes that are available in System.Data Namespace:
·         Dataset.
·         DataTable.
·         DataColumn.
·         DataRow.
·         DataRelation.
·         Constraint.

41)   What are the uses of Stored Procedure?
The Following are uses of Stored Procedure:
·         Improved Performance.
·         Easy to use and maintain.
·         Security.
·         Less time and effort taken to execute.
·         Less Network traffic.

 42) What is the default Timeout for SqlCommand.CommandTimeout property?
The default timeout of Sqlcommand. Command Timeout property is 30 Seconds.

43)  What are the classes in System.Data.Common Namespace?
There are two classes involved in System.Data.Common Nameapce:
·         DataColumnMapping.
·         DataTableMapping.

44) What extra features does ADO.Net 2.0 have?
         The following are the features in ADO.Net 2.0:
Bulk Copy Operation
               Data Paging
               Batch Update
               Load and Save Methods

              New Data Controls
              DataReader's New Execute Method

45) What’s difference between “Optimistic” and “Pessimistic” locking?
Optimistic: Optimistic Locking allows multiple clients to use the same data.
Pessimistic: Client who wants to make updating must check out the data and do the work. If it is checked out by some user. it won’t be updated by other user.




Thanks to Google

Dot Net -- Questions and Answers[Difference Between] Part-I



Dot Net -- Questions and Answers:[Difference Between]

Part-I
1. What is the difference between public, static and void?
      Public: The keyword public is an access modifier that tells the C# compiler that the Main method is accessible by anyone.
    Static: The keyword static declares that the Main method is a global one and can be called without creating an instance of the class. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created.
Void: The keyword void is a type modifier that states that the Main method does not return any value.

2. What are value types and reference types?
                Value types are stored in the Stack.
Examples: bool, byte, chat, decimal, double, Enum, float, int, long, sbyte, short, strut, uint, ulong, ushort.
Reference types are stored in the Heap.
Examples: class, delegate, interface, object, string.

3. What is the difference between private and public keyword?
                    Private: The private keyword is the default access level and most restrictive among all other access levels. It gives least permission to a type or type member. A private member is accessible only within the body of the class in which it is declared.   
 Public: The public keyword is most liberal among all access levels, with no restrictions to access what so ever. A public member is accessible not only from within, but also from outside, and gives free access to any member declared within the body or outside the body.

4. How is method overriding different from method overloading?
                When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.

5. What is the difference between ref & out parameters?
                An argument passed to a ref parameter must first be initialized. Compare this to an out parameter, whose argument does not have to be explicitly initialized before being passed to an out parameter.

6. What is Authentication and Authorization?
                Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password).
Authorization performs after authentication. Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.
7. What is difference between constants, read only and, static?
    Constants: The value can’t be changed.
    Read-only: The value will be initialized only once from the constructor of the class.
    Static: Value can be initialized once.

8. What is the difference between string keyword and System? String class?
                String keyword is an alias for System. String class. Therefore, System. String and string keyword are the same, and you can use whichever naming convention you prefer. The String class provides many methods for safely creating, manipulating, and comparing strings.

9. What is the difference between Custom Control and User Control?
                Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.

User Controls are similar to those of ASP include files, easy to create, cannot be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.

10. What is the difference between break and continue statement?
                The break statement is used to terminate the current enclosing loop or conditional statements in which it appears. We have already used the break statement to come out of switch statements.
The continue statement is used to alter the sequence of execution. Instead of coming out of the loop like the break statement did, they continue statement stops the current iteration and simply returns control back to the top of the loop.

11. What is the difference between static and instance methods?
                A method declared with a static modifier is a static method. A static method does not operate on a specific instance and can only access static members.

A method declared without a static modifier is an instance method. An instance method operates on a specific instance and can access both static and instance members. The instance on which an instance method was invoked can be explicitly accessed as this. It is an error to refer to this in a static method.

12. What is the difference between Array and Arraylist?
                An array is a collection of the same type. The size of the array is fixed in its declaration. A linked list is similar to an array but it doesn’t have a limited size.

13. What is the difference between console and window application?                
    A console application, which is designed to run at the command line with no user interface.
    A Windows application, which is designed to run on a user’s desktop and has a user interface.

14. What is the difference between Array and Linked List?
                Array is a simple sequence of numbers which are not concerned about each others positions. They are independent of each others positions. Adding, removing or modifying any array element is very easy. Compared to arrays, linked list is a complicated sequence of numbers.

15. What is the difference between CONST and READONLY?
                Both are meant for constant values. A const field can only be initialized at the declaration of the field. A read only field can be initialized either at the declaration or.

16. What is the main difference between a sub procedure and a function?
                Sub procedures do not return a value, while functions do.

17. How does C# differ from C++?
v  C# does not support #include statement. It uses only using statement.
v  In C# , class definition does not use a semicolon at the end.
v  C# does not support multiple code inheritance.
v  Casting in C# is much safer than in c++.
v  In C# switch can also be used on string values.
v  Command line parameters array behave differently in C# as compared to C++.

18. What is the difference between Shadowing and Overriding?            
   Overriding redefines only the implementation while shadowing redefines the whole element.
    In overriding derived classes can refer the parent class element by using "ME" keyword, but in shadowing you can access it by "MYBASE".

19. What is a basic difference between the while loop and do while loop in C#?
                The while loop tests its condition at the beginning, which means that the enclosed set of
Statements run for zero or more number of times if the condition evaluates to true. The do while loop iterates a set of statements at least once and then checks the condition at the end.

20. What is the main difference between a subprocedure and a function?
                Subprocedures do not return a value, while functions do.

21. What is the difference between an abstract method & virtual method?
                An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class), where as the virtual method has an implementation and leaves an option to override it in the deriving class. Thus Virtual method has an implementation & provides the derived class with the option of overriding it. Abstract method does not provide an implementation & forces the derived class to override the method.
.
22. What are the differences between System. String and System.Text.StringBuilder classes?
System. String is immutable. When we modify the value of a string variable then a new memory is allocated to the new value and the previous memory allocation released. System.StringBuilder was designed to have concept of a mutable string where a variety of operations can be performed without allocation separate memory location for the modified string.

23. What’s the difference between the System.Array.CopyTo () and System.Array.Clone ()?
Using Clone () method, we creates a new array object containing all the elements in the original array and using CopyTo () method, all the elements of existing array copies into another existing array. Both the methods perform a shallow copy.

 24.   What is the difference between Finalize () and Dispose () methods?
Dispose () is called when we want for an object to release any unmanaged resources with them. On the other hand Finalize () is used for the same purpose but it doesn’t assure the garbage collection of an object.

25.   What is difference between is and as operators in c#?
“is” operator is used to check the compatibility of an object with a given type and it returns the result as Boolean.
“as” operator is used for casting of object to a type or a class.

26.   What is difference between the “throw” and “throw ex” in .NET?
“Throw” statement preserves original error stacks whereas “throw ex” has the stack trace from their throw point. It is always advised to use “throw” because it provides more accurate error information.
27.   What is the difference between direct cast and ctype?
Direct Cast is used to convert the type of an object that requires the run-time type to be the same as the specified type in Direct Cast.
Ctype is used for conversion where the conversion is defined between the expression and the type.

28. What’s the difference between and XML documentation tag?
Single line code example and multiple-line code example.

29. What’s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.

30.       What is the difference between VB and VB.Net?
Following are the differences between VB and VB.Net:
VB
VB.Net
Platform dependent
Platform Independent
VB is backward compatible
VB.Net is not backward compatible
Interpreted
Compiler Language
Exception Handling by ‘On Error…..Goto’
Exception Handling by ‘Try….Catch’
Cannot develop multi-threaded applications
Can develop multi thread applications
31.       What is the difference between C# and VB.Net?
                Following table gives differences between C# and VB.Net:
VB.Net
C#
Optional Parameters are accepted
Optional Parameters are not accepted
Not case sensitive
Case Sensitive
Nothing is used to release unmanaged resources
‘Using’ is used to release unmanaged resources
Support of Both structured and unstructured error handling
Unstructured error handling

Thanks to GOOGLE.

22 January 2013

C#.net Interview Question with Answers -II

Dispose vs Final?
Dispose is a method for realse from the memory for an object.
Finalize is used to fire when the object is going to realize the memory.We can set a alert message to says that this object is going to dispose.

Types of Error?
Configuration Errors.
Parse Errors.
Compilation Errors.
Run-Time Errors.

DataReader vs Dataset?
Data Reader is connected, read only forward only record set.
Dataset is in memory database that can store multiple tables, relations and constraints; moreover dataset is disconnected and is not aware of the

data source.

What is the use of var keyword in C#?
This is the new feature in C# 3.0. This enable us to declare a variable whose type is implicitly inferred from the expression used to initialize the

variable.
eg.
var age = 10;
Because the initialization value (10) of the variable age is integer type of age will be treated as integer type of variable. There are few limitation of

the var type of variables.
They are:
 They can't be initialized as null.
 They need to be declared and initialized in the same statement.
 They can't be used as a member of the class.

Features of C# 3.0:
Implicitly typed variables (var):C# 3.0 supports implicitly typed local variables by making use of a new keyword var. These variables are not

typeless; rather, their type is inferred at compile time.
Auto properties:Auto-implemented properties are another helpful new feature to save us some typing and reduce the potential to introduce bugs.
Object initialization:C# 3.0 introduces two new features that help when instantiating and initializing object instances. Using object and collection

initializers, you can instantiate and initialize either an object or a collection in one compound statement.
Partial Methods :C# 2.0 introduced partial class definitions.C# 3.0 adds to that by introducing partial methods. Using partial methods, We can

implement the methods in separate file (same partial class) .
Extension Methods:Extension methods are one of the most exciting new features.Extension methods enable you to add methods to existing types

without creating a new derived type.
LINQ (Language Integrated Query):The granddaddy of all new C# 3.0 features has to be LINQ, which builds upon all of the new features,

especially extension methods, lambda expressions, and anonymous types.You can use LINQ to access data from multiple sources. That means

from native object collections, SQL data stores, and XML. 

C# 2.0—Generics (.NET Framework support was added, and C# benefited from this); iterator pattern (the yield keyword); anonymous methods

(the delegate keyword), nullable types, and the null coalescing operator .
 C# 3.0—Anonymous types, extension methods, object initializers,collection initializers, implicitly typed local variables (var keyword),lambda

expressions (=>), and the LINQ query expression pattern.
 C# 4.0—Optional Parameters and Named Arguments, Dynamic typing (dynamic type), improved COM-Interop, and Contra and Co-Variance.

Covariance vs Contravariance:
Convariance : Convert from Wider(Double) to Narrow(Float).
Contravariance: Convert from Narrow(Float) to Wider(Double).

Sealed Class:
The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another

class. (A sealed class cannot also be an abstract class).
static vs Readonly?
Static: A variable that retains the same data throughout the execution of a program.
ReadOnly: you can’t change its value.

String vs StringBuilder?
String Class
Once the string object is created, its length and content cannot be modified.
Slower
StringBuilder
Even after object is created, it can be able to modify length and content.
Faster

Parse vs TryParse?
Parse method is used to parse any value to specified data type.
TryParse is a good method if the string you are converting to an interger is not always numeric. The TryParse method returns a boolean to denote

whether the conversion has been successfull or not, and returns the converted value through an out parameter.
Optional and Named Parameter in C# 4.0
Optional parameter allows omitting arguments to function while named parameters allow passing arguments by parameter name.
Anonymous methods:
Anonymous methods are another way to declare delegates with inline code except named methods.

Var vs Dynamic?
Var word was introduced with C#3.5(specifically for LINQ) while dynamic is introduced in C#4.0.
 Variables declared with var keyword will get compiled and you can have all its related methods by intellisense while variables declared with

dynamic keyword will never get compiled. All the exceptions related to dynamic type variables can only be caught at runtime.
Unsafe Keyword:
In C# the value can be directly referenced to a variable, so there is no need of pointer. Use of pointer sometime crashes the application. But C#

supports pointer, that means we can use pointer in C#.The use of pointer in C# is defined as a unsafe code. So if we want to use pointer in C# the

pointer must be present in the body of unsafe declaration. But pointer does not come under garbage collection.
Delegate Keyword derived from which namespace?
C# delegate keyword is derived form System.MulticastDelegate.
Difference Preprocessor directives:
#region , #endregion :- Used to mark sections of code that can be collapsed.
#define , #undef :-Used to define and undefine conditional compilation symbols.
#if , #elif , #else , #endif :- These are used to conditionally skip sections of source code.
Stackalloc Keyword:
In an unsafe context it is used to allocate C# array directly on the stack.
Whick keyword is used for Temporarily fixa variable ?
fixed Keyword.

what is use of ??
This operator allows you to assign a value to a nullable type if the retrieved value is in fact null.
Define Property
Property  acts as a cross link between the field and the method . Actually it behaves as a field. We can retrieve and store data from the field using property.
Define Param Keyword?
In C# param parameter allows us to create a method that may be sent to a set of identically typed arguments as a single logical parameter.
Syntax for Nullable Variable?
Nullable myval=null;
How can we check a nullable variable is assigned?
using hasvalue method.
Virtual Method?
 used to declare a method inside the base class that can be overridden.
1. Virtual method can not be declared as Private
2. Virtual method can not be declared as Static
3. Virtual method may or may not be overridden.
4. In order to override the virtual method of the base class, Override keyword is used provided the method signature of the derived class is same as

base class, even the access modifier should be same.
5. A Virtual method must contain the method body otherwise compiler shall throw error.
6. Virtual keyword is only used in base and derived class scenario where you want your method over-ridable in the derived class.

Ref vs Out Parameters?
ref parameter:
Ref is keyword.
it must be used along with actual and formal arguments.
ref variables must be initialized before passing to a function
out parameter:
It is very similar to call by Reference.
Out is a Keyword.
Which must be used along with actual and formal arguments.
Out variables are not require to initialize, the initialized value will not be passed, only reference will be passed.
Define Generics
Generics means parametrized types. A class, structure, interface, delegates that operates on a parametrized type is called generics.
Types of windows services?
There are two types of windows services. Those are Win32OwnProcess , Win32ShareProcess .
a. Win32OwnProcess: It is a Win32 process that can be started by the Service Controller. This type of Win32 service runs in a process by itself.+
b. Win32ShareProcess: It is a Win32 service that allows sharing of processes with other Win32 services.
When Garbage Collector run?
 Garbage Collector runs :
1. When the system has low physical memory
2. Acceptable memory heap is increased.
3. GC.Collect method is called.
where Shared Assemblies stored?
The shared assemblies are stored in Global assembly cache.
Debug Writer vs Trace.Writer
Debug.Write will work while the application is in both Debug Mode and Release Mode. This is normally used while you are going to debug a  project. This will not be work when you will define some debug points to your project.Trace.write will work while the application is only in Release Mode. This is used in released version of an application. This will compiled when you will define debug points in your project.
Virtual,sealed,override,abstract keyword?
The use of virtual keyword is to enable or to allow a class to be overridden in the derived class.
The use of sealed keyword is to prevent the class from overridden i.e. you can’t inherit sealed classes.
The use of override keyword is to override the virtual method in the derived class.
The use of abstract keyword is to modify the class, method, and property declaration. You cannot directly make calls to an abstract method and

you cannot instantiate an abstract class.
Define Structure
• A struct is a value type.
• The structs doesn’t support inheritance other than implicitly deriving from object.
• A struct can have the members like parameterless constructor, a finalizer, virtual members etc.
Define enum?
A enum is nothing but a special value type which specifies a group of named numeric constants.

Static vs Constant
Static Variable:
1.Variable set at run time
2.Can be assigned for reference types.
3.Initialized on constructors
Constant:
1.Variable set at compile time itself.
2.Assigned for value types only
3.must be initialized at declaration time
4.only primitive data types.

WindowsDefaultLocation vs WindowsDefaultBounds
WindowsDefaultLocation makes the form to start up at a location selected by the operating system, but with internally specified size.
WindowsDefaultBounds delegates both size and starting position choices to the operating system.
String vs string
String:
1.String is an class(System.String)
2.String is an Reference type(class)

string:
1.string is an alias name of String class that is created by microsoft
2.string is an value type(data type)
3.string is a C# keyword
4.string is a compiler shortcut for System.String class