Microsoft.NET 2.0 Interview Preparation Guide
Strengthen your Microsoft.NET 2.0 interview skills with our collection of 19 important questions. Our questions cover a wide range of topics in Microsoft.NET 2.0 to ensure youre well-prepared. Whether youre new to the field or have years of experience, these questions are designed to help you succeed. Get the free PDF download to access all 19 questions and excel in your Microsoft.NET 2.0 interview. This comprehensive guide is essential for effective study and confidence building.19 Microsoft.NET 2.0 Questions and Answers:
1 :: In .NET Compact Framework, can we free memory explicitly without waiting for garbage collector to free the memory?
NET Compact Framework come with CLR which perform automatic garbage collector to free the memory without using destector(perform garbage collector when is declear)
2 :: What are the main components in .Net?
In-Process Components
In .NET, components built as DLLs run within the process space of the host application and share memory and processor time with their host applications. At run time, the component (which is part of the host application's assembly and is referenced by its manifest) is loaded from disk and added to the host application's process space. Because no remote procedure calls are generated to mediate communication between the component and its host, setting and reading property values, invoking methods, and responding to events raised by the component occurs very quickly.
Out-of-Process Components
An alternate architecture involves server applications that run as independent processes outside of the client application process space. These server applications usually (but not always) have an EXE file name extension. When Windows loads an out-of-process component, a separate process space is created for the component, and Windows manages the out-of-process component's resource requirements independently of the client application. Windows mediates the dialog between the server application (that is, the component) and the client (the consumer) by passing messages between them.
In .NET, components built as DLLs run within the process space of the host application and share memory and processor time with their host applications. At run time, the component (which is part of the host application's assembly and is referenced by its manifest) is loaded from disk and added to the host application's process space. Because no remote procedure calls are generated to mediate communication between the component and its host, setting and reading property values, invoking methods, and responding to events raised by the component occurs very quickly.
Out-of-Process Components
An alternate architecture involves server applications that run as independent processes outside of the client application process space. These server applications usually (but not always) have an EXE file name extension. When Windows loads an out-of-process component, a separate process space is created for the component, and Windows manages the out-of-process component's resource requirements independently of the client application. Windows mediates the dialog between the server application (that is, the component) and the client (the consumer) by passing messages between them.
3 :: Explain the procedure to add assemly to GAC to make it shared one?
Strong name the assembly using snk and copy the assembly into the windows/assembly folder
Private assemblies are very useful, but sometimes we will want to put a DLL in a central place so that a single copy can be shared by the other assemblies on the system. .NET has such a repository, called the Global Assembly Cache(GAC). An assembly placed into the GAC is called a Shared Assembly.
Private assemblies are very useful, but sometimes we will want to put a DLL in a central place so that a single copy can be shared by the other assemblies on the system. .NET has such a repository, called the Global Assembly Cache(GAC). An assembly placed into the GAC is called a Shared Assembly.
4 :: How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?
It works for me with this code:ParameterFields paramFields = new ParameterFields(); //setdata ParameterField param_date = new ParameterField(); param_date.ParameterFieldName = "date"; ParameterDiscreteValue d = new ParameterDiscreteValue(); d.Value = this.date+" - "+this.datesf; param_date.CurrentValues.Add(d); paramFields.Add(param_date); //set number ParameterField param_no = new ParameterField(); param_no.ParameterFieldName = "number"; ParameterDiscreteValue number = new ParameterDiscreteValue(); if (this.no==0) number .Value = ""; else number.Value = this.no.ToString(); param_no.CurrentValues.Add(number); paramFields.Add(param_no); //and so on repview_total.ParameterFieldInfo = paramFields;
5 :: Consider a datagrid in windows application. Here item, rate, qty, amount field are there. When user enters rate and qty, amount should be automatically calculated. When enter key is pressed, the cursor should go from item to rate and then qty and then amount. But amount should be automatically calculated. In Grid when button is clicked, then and then only new row should be created and another button is clicked, row should be removed.Thus give me the solution?
A custumised datagridview class has to be written this .class has to inherit the datagridview class.ProcessDialogKey & ProcessDataGridViewKey functions of datagridview class has to be overidden to change the behaviour of tab and enter key.this class is avaible at msdn web site.To make changes to amount column automatically CellValueChanged of datagridview can be called.To make insert and delete operations button type columns can be added and grid.rows.add , grid.rows.remove methods can be called o insert and delete row.
6 :: How to create multiple inheritance inc#, with example?
A class can implement multiple interfaces.
public class A : Ix, Iy,Iz
This way you can achieve multiple inheritence
In C#, a class cannot have multiple inheritance with classes. But class can have multiple inheritance with one class and more than one interface.
Eg:
namespace TestClass
{
public class A
{
public void testA()
{
Console.WriteLine("In Class A");
}
}
interface IB
{
void testIB();
}
interface IC
{
void testIC();
}
public class Test : A, IB, IC
{
public void testIB()
{
Console.WriteLine("In Interface IB");
}
public void testIC()
{
Console.WriteLine("In Interface IC");
}
}
class Program
{
static void Main(string[] args)
{
Test tt = new Test();
tt.testA();
tt.testIB();
tt.testIC();
Console.ReadLine();
}
}
}
public class A : Ix, Iy,Iz
This way you can achieve multiple inheritence
In C#, a class cannot have multiple inheritance with classes. But class can have multiple inheritance with one class and more than one interface.
Eg:
namespace TestClass
{
public class A
{
public void testA()
{
Console.WriteLine("In Class A");
}
}
interface IB
{
void testIB();
}
interface IC
{
void testIC();
}
public class Test : A, IB, IC
{
public void testIB()
{
Console.WriteLine("In Interface IB");
}
public void testIC()
{
Console.WriteLine("In Interface IC");
}
}
class Program
{
static void Main(string[] args)
{
Test tt = new Test();
tt.testA();
tt.testIB();
tt.testIC();
Console.ReadLine();
}
}
}
7 :: Explain Can 2 different applications use the same dll in GAC at the same time?
Yes
8 :: What is IL in VB.Net?
The code which we write in .net are basically source code.When we compile it the .net CLR 1st convert it from source code to machine understandable language. and that language is called as IL or MSIL
9 :: Explain What is the difference between response.redirect & server.transfer?
The difference between Server.Transfer and Response.Redirect are as follow
1>Response.redirect sends message to the browser saying it to move to some different page while Server.transfer does not send any message to the browser but rather redirects the uyser directly from the server itself.So in Server.transfer their is no round trip while Response.redirect has a round trip hence puts a load on the server.
2>Using Sever.transfer you cannot redirect to a different server itself while using Response.redirect you can redirect to a different server also.
3>With Server.transfer you can preserve your information.It has a parameter called as "preserve form",so the existing query string etc will be avilable in the calling page.This is not possible in Response.redirect.
1>Response.redirect sends message to the browser saying it to move to some different page while Server.transfer does not send any message to the browser but rather redirects the uyser directly from the server itself.So in Server.transfer their is no round trip while Response.redirect has a round trip hence puts a load on the server.
2>Using Sever.transfer you cannot redirect to a different server itself while using Response.redirect you can redirect to a different server also.
3>With Server.transfer you can preserve your information.It has a parameter called as "preserve form",so the existing query string etc will be avilable in the calling page.This is not possible in Response.redirect.
10 :: What is interface and abstract class in .Net?
when a class is not provided with full functionalitythen it is declared as abstract.it doesn't support instance creation as well as it cannot be overridable to child class.interface is a colection of methods only without functionality.interface is 90% same as abstract class.
An interface class is a class contains all functions that are are abstract.
An abstract class is a class that may or may not contain an abstract function.
Abstract function : functions with only declaration , no definition is present. the user implimenting, inheriting the function has to override the function , mandatorily.
Instances of abstract class and interface class are made at runtime.so objects cannot be created ,due to lack of informations of the class.
An interface class is a class contains all functions that are are abstract.
An abstract class is a class that may or may not contain an abstract function.
Abstract function : functions with only declaration , no definition is present. the user implimenting, inheriting the function has to override the function , mandatorily.
Instances of abstract class and interface class are made at runtime.so objects cannot be created ,due to lack of informations of the class.