This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Showing posts with label Interview Quetions. Show all posts
Showing posts with label Interview Quetions. Show all posts

Using SQL Server to maintain session state


Maintaining data between server calls is a common dilemma in Web development. You may need to maintain information for the application or for particular user sessions. Storing such data is called state management, and ASP.NET provides the means to accomplish the task via various avenues. This includes storing the data in memory, on a state server, or via Microsoft SQL Server. This article focuses on session state management (user session data) using SQL Server.

Why is state management necessary?
Before we dive into SQL Server setup and usage, you may wonder why it's necessary. One of the more distressing aspects of Web development is the fact that HTTP is a stateless protocol. It works in a disconnected fashion with each Web request serviced as it's received. After the request is processed, all of the data utilised is discarded. The server doesn't remember anything between calls. That is, it doesn't remember unless it has explicit instructions to do so.

Session variables
Session variables are utilised with the following format:

C#: Session["variable_name"] = value;
VB.NET: Session("variable_name") = value

Once this value is stored, it's available throughout the user's session. The variable is discarded when the session ends. You may circumvent the discarding of the value by utilising persistent state management (which is a topic for another day).

ASP.NET state management
ASP.NET allows you to store session data in memory, via a state server, or in SQL Server. The determination of the storage location is the application's Web.config file. The sessionState element within the system.web element is where the state management option is configured. The following example shows SQL Server utilised:

<sessionState
mode="SQLServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=username;password=password"
cookieless="false"
timeout="20" />

Remember that the element names and attributes are case-sensitive. The following are possible values for the mode attribute:

  • InProc--store in memory. This is the fastest for performance, but all data is lost when the ASP.NET process recycles.
  • SQLServer--store data on SQL Server. This is the most reliable since it's disconnected from the Web server. This option uses the sqlConnectionString option. The connection string follows the normal syntax for connecting to a SQL Server database.
  • StateServer--store data on a separate Web server (IIS). This option uses the stateConnectionString attribute.

All options use the remaining. The cookieless attributes signal whether cookies are stored in memory (false) or maintained in the QueryString/URL (true). The timeout attribute signals the length of time (without activity) that session variables are stored. Now let's turn our attention to SQL Server setup.

SQL Server setup
SQL Server requires a special database to handle state management. Thankfully, the .NET Framework installation includes the necessary files to get this up and running in no time. The following scripts are installed:

  • InstallPersistSqlState.sql--contains scripts to set up database for persistent state management
  • InstallSqlState.sql--Contains scripts to set up database for state management
  • UninstallPersistSqlState.sql--Contains scripts for uninstalling persistent state management
  • UninstallSqlState.sql--Contains scripts for uninstalling state management

These scripts may be run from Query Analyzer or via the isql.exe command-line utility. To set up state management, we run InstallSqlState.sql. The result of the script is the creation of a database named ASPState. This handles the storage and maintaining of session variables. You can easily test the functionality with a simple example.

The following C# sample includes one Web form that populates session variables and redirects to another Web form that displays the values:

<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML><HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
</HEAD>
<body MS_POSITIONING="GridLayout">
<script language="C#" runat="server">
private void Page_Load(object sender, System.EventArgs e) {
Session["FirstName"] = "Tony";
Session["LastName"] = "Patton";
Session["Site"] = "Builder.com";
Response.Redirect("WebForm2.aspx", true);
}
</script></body></HTML>

Here's the second Web form:

<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML><HEAD><title>WebForm2</title></HEAD>
<body>
<script language="C#" runat="server">
private readonly string newLine = "<br>";
private void Page_Load(object sender, System.EventArgs e) {
Response.Write(Session["FirstName"].ToString() + " ");
Response.Write(Session["LastName"].ToString() + newLine);
Response.Write(Session["Site"].ToString() + newLine);
}
</script></body></HTML>

If you're a VB.NET developer, the pages have the following format:

<%@ Page Language="vb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>WebForm1</title></head><body>
<script language="vb" runat="server">
Private Sub Page_Load(sender As Object, e As System.EventArgs)
Session("FirstName") = "Tony"
Session("LastName") = "Patton"
Session("Site") = "Builder.com"
Response.Redirect("WebForm2.aspx", true)
End Sub
</script></body></html>

Here's the Page_Load event on the second form:

<%@ Page Language="vb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>WebForm2</title></head><body>
<script language="vb" runat="server">
Private ReadOnly newLine As String = "<br>"
Private Sub Page_Load(sender As Object, e As System.EventArgs)
Response.Write(Session("FirstName").ToString() + " ")
Response.Write(Session("LastName").ToString() + newLine)
Response.Write(Session("Site").ToString() + newLine)
End Sub
</script></body></html> 

One note on uninstalling the state management feature: Microsoft recommends stopping the World Wide Web Publishing service before executing the uninstall script. You can accomplish this with the net stop w3svc command from a command line. You can restart it with net start w3svc.

You can easily see the session management feature in action by examining the tempdb database on the SQL Server. It will contain two temporary tables used for session management: ASPStateTempApplications and ASPStateTempSessions.

A viable option
SQL Server provides an alternative if you worry about losing session state data due to Web server downtime. There is a performance hit since database interaction is involved, but it's the most reliable method available.
 
 
--By Tony Patton

difference between const and static readonly

The difference is that the value of a static readonly field is set at run time, and can thus be modified by the containing class, whereas the value of a const field is set to a compile time constant.

In the static readonly case, the containing class is allowed to modify it only

  • in the variable declaration (through a variable initializer)
  • in the static constructor (instance constructors, if it's not static)

static readonly is typically used if the type of the field is not allowed in a const declaration, or when the value is not known at compile time.

Instance readonly fields are also allowed. 

Remember that for reference types, in both cases (static and instance) the readonly modifier only prevents you from assigning a new reference to the field.  It specifically does not make immutable the object pointed to by the reference.

    class Program

    {

        public static readonly Test test = new Test();

 

        static void Main(string[] args)

        {

            test.Name = "Program";

 

            test = new Test();  // Error:      A static readonly field cannot be assigned to (except in a static constructor or a variable initializer) 

 

        }

    }

 

    class Test

    {

        public string Name;

    }

 

On the other hand, if Test were a value type, then assignment to test.Name would be an error.

ASP.Net Interview Questions


1.

Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

2. What's the difference between Response.Write() andResponse.Output.Write()?

 The latter one allows you to write formattedoutput.

3. What methods are fired during the page load?
 
 Init() - when the pageis instantiated, Load() - when the page is loaded into server memory,PreRender() - the brief moment before the page is displayed to the user asHTML, Unload() - when page finishes loading.

4. Where does the Web page belong in the .NET Framework class hierarchy?

System.Web.UI.Page

5. Where do you store the information about the user's locale?

System.Web.UI.Page.Culture

6.
What's the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
 
 CodeBehind is relevant to Visual Studio.NET only.

7. What's a bubbled event?

 When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its onstituents.

8. Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler?
 
It's the Attributesproperty, the Add function inside that property. So btnSubmit.Attributes.Add("onMouseOver","someClientCode();")
 
9.
What data type does the RangeValidator control support?
 
 Integer,String and Date.

10. Explain the differences between Server-side and Client-side code?

Serverside code runs on the server. Client-side code runs in the clients' browser.
 
11. What type of code (server or client) is found in a Code-Behind class?

Server-side code.

12.
Should validation (did the user enter a real date) occur server-side or client-side? Why?
 
Client-side. This reduces an additional request to the server to validate the users input.

13. What does the "EnableViewState" property do? Why would I want it on or off?

It enables the viewstate on the page. It allows the page to save the users input on a form.

14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.

15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

·

A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.

·

A DataSet is designed to work without any continuing connection to the original data source.

·

Data in a DataSet is bulk-loaded, rather than being loaded on demand.
·
There's no concept of cursor types in a DataSet.
 
· DataSets have no current record pointer You can use For Each loops to move through the data.

·

You can store many edits in a DataSet, and write them to the original data source in a single operation.

·

Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
16.
Can you give an example of what might be best suited to place in the Application_Start and Session_Start       subroutines?
 
This is where you can set the specific variables for the Application and Session objects.

17. If I'm developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would bethe best approach to maintain login-in state for the users? Maintain the login

state security through a database.

18. Can you explain what inheritance is and an example of when you might use it?

When you want to inherit (use the functionality of) another class. Base Class Employee. A Manager class could be derived from the Employee base class.

19. Whats an assembly?

Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN
 
20.
Describe the difference between inline and code behind.
 
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

21. Explain what a diffgram is, and a good use for one?

The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service.

22. Whats MSIL, and why should my developers need an appreciation of it if at all?

MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL.

23. Which method do you invoke on the DataAdapter control to load your generated dataset with data?

The .Fill() method

24. Can you edit data in the Repeater control?

No, it just reads the information from its data source

25. Which template must you provide, in order to display data in a Repeater control?

ItemTemplate

26. How can you provide an alternating color scheme in a Repeater control?

Use the AlternatingItemTemplate

27.

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

You must set the DataSource property and call the DataBind method.

28.
What base class do all Web Forms inherit from?
 
The Page class.

29. Name two properties common in every validation control?

ControlToValidate property and Text property.

30.
What tags do you need to add within the asp:datagrid tags to bind columns manually?
 
Set AutoGenerateColumns Property to false on the datagrid tag

31.

What tag do you use to add a hyperlink column to the DataGrid?

<asp:HyperLinkColumn>

32.
What is the transport protocol you use to call a Web service?
 
SOAP is the preferred protocol.

33. True or False: A Web service can only be written in .NET?

False

34. What does WSDL stand for?

(Web Services Description Language)

35. Where on the Internet would you look for Web services?

(

http://www.uddi.org)
36.
Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
 
DataTextField property

37. Which control would you use if you needed to make sure the values in two different controls matched?

CompareValidator Control

38. True or False: To test a Web service you must create a windows application or Web application to consume this service?

False, the webservice comes with a test page and it provides HTTP-GET method to test.
 
39.
How many classes can a single .NET DLL contain?
 
It can contain many classes.

C# interview questions and answers

 

  1. What's the implicit name of the parameter that gets passed into the class' set method? Value, and it's datatype depends on whatever variable we're changing.

  2. How do you inherit from a class in C#? Place a colon and then the name of the base class.
  3. Does C# support multiple inheritance? No, use interfaces instead.
  4. When you inherit a protected class-level variable, who is it available to? Classes in the same namespace.
  5. Are private class-level variables inherited? Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.
  6. Describe the accessibility modifier protected internal. It's available to derived classes and classes within the same Assembly (and naturally from the base class it's declared in).
  7. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there's no implementation in it.
  8. What's the top .NET class that everything is derived from? System.Object.
  9. How's method overriding different from overloading? When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.
  10. What does the keyword virtual mean in the method definition? The method can be over-ridden.
  11. Can you declare the override method static while the original method is non-static? No, you can't, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.
  12. Can you override private virtual methods? No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.
  13. Can you prevent your class from being inherited and becoming a base class for some other classes? Yes, that's what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It's the same concept as final class in Java.
  14. Can you allow class to be inherited, but prevent the method from being over-ridden? Yes, just leave the class public and make the method sealed.
  15. What's an abstract class? A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it's a blueprint for a class without any implementation.
  16. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)? When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden.
  17. What's an interface class? It's an abstract class with public abstract methods all of which must be implemented in the inherited classes.
  18. Why can't you specify the accessibility modifier for methods inside the interface? They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, it's public by default.
  19. Can you inherit multiple interfaces? Yes, why not.
  20. And if they have conflicting method names? It's up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you're okay.
  21. What's the difference between an interface and abstract class? In the interface all methods must be abstract, in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.
  22. How can you overload a method? Different parameter data types, different number of parameters, different order of parameters.
  23. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor? Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.
  24. What's the difference between System.String and System.StringBuilder classes? System.String is immutable, System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
  25. Is it namespace class or class namespace? The .NET class library is organized into namespaces. Each namespace contains a functionally related group of classes so natural namespace comes first.

Dot Net Basic Interview Quetions

Does C# support multiple-inheritance?
No.

Who is a protected class-level variable available to?
It is available to any sub-class (a class inheriting this class).

Are private class-level variables inherited?
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.

Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the specified base class.

What’s the top .NET class that everything is derived from?
System.Object.

What does the term immutable mean?
The data value may not be changed.
Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

What’s the difference between System.String and System.Text.StringBuilder classes?
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.

Can you store multiple data types in System.Array?
No.

What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.

How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

What’s the .NET collection class that allows an element to be accessed using a unique key?
HashTable.

What class is underneath the SortedList class?
A sorted HashTable.

Will the finally block get executed if an exception has not occurred?
­Yes.

What’s the C# syntax to catch any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

Can multiple catch blocks be executed for a single try statement?
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).

Explain the three services model commonly know as a three-tier application.
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources)
Class Questions:

What is the syntax to inherit from a class in C#?
Place a colon and then the name of the base class.
Example: class MyNewClass : MyBaseClass

Can you prevent your class from being inherited by another class?
Yes. The keyword “sealed” will prevent the class from being inherited.

Can you allow a class to be inherited, but prevent the method from being over-ridden?
Yes. Just leave the class public and make the method sealed.

What’s an abstract class?
A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.

When do you absolutely have to declare a class as abstract?
1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
2. When at least one of the methods in the class is abstract.

What is an interface class?
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.

Why can’t you specify the accessibility modifier for methods inside the interface?
They all must be public, and are therefore public by default.

Can you inherit multiple interfaces?
Yes. .NET does support multiple interfaces.

What happens if you inherit multiple interfaces and they have conflicting method names?
It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay. To Do: Investigate

What’s the difference between an interface and abstract class?
In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.

What is the difference between a Struct and a Class?
Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.

Method and Property Questions

What’s the implicit name of the parameter that gets passed into the set method/property of a class?
Value. The data type of the value parameter is defined by whatever data type the property is declared as.

What does the keyword “virtual” declare for a method or property?
The method or property can be overridden.

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.

Can you declare an override method to be static if the original method is not static?
No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override)

What are the different ways a method can be overloaded?
Different parameter data types, different number of parameters, different order of parameters.
If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors;

can you enforce a call from an inherited constructor to a specific base constructor?
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

Events and Delegates

What’s a delegate?
A delegate object encapsulates a reference to a method.

What’s a multicast delegate?
A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called
XML Documentation Questions

Is XML case-sensitive?
Yes.

What’s the difference between // comments, /* */ comments and /// comments?
Single-line comments, multi-line comments, and XML documentation comments.

How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with the /doc switch.

Debugging and Testing Questions

What debugging tools come with the .NET SDK?
1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.
2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR.

What does assert() method do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.

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.

Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be quite verbose. For applications that are constantly running you run the risk of overloading the machine and the hard drive. Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.

Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.

How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.

What are three test cases you should go through in unit testing?
1. Positive test cases (correct data, correct output).
2. Negative test cases (broken or missing data, proper handling).
3. Exception test cases (exceptions are thrown and caught properly).

Can you change the value of a variable while debugging a C# application?
Yes. If you are debugging via Visual Studio.NET, just go to Immediate window.

ADO.NET and Database Questions

What is the role of the DataReader class in ADO.NET connections?
It returns a read-only, forward-only rowset from the data source. A DataReader provides fast access when a forward-only sequential read is needed.

What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.

What is the wildcard character in SQL?
Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.

Explain ACID rule of thumb for transactions.
A transaction must be:
1. Atomic - it is one unit of work and does not dependent on previous and following transactions.
2. Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t.
3. Isolated - no transaction sees the intermediate results of the current transaction).
4. Durable - the values persist if the data had been committed even if the system crashes right after.

What connections does Microsoft SQL Server support?
Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).

Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?
Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.

What does the Initial Catalog parameter define in the connection string?
The database name to connect to.

What does the Dispose method do with the connection object?
Deletes it from the memory.To Do: answer better. The current answer is not entirely correct.

What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings. The connection string must be identical.

Assembly Questions

How is the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.

What is a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

What namespaces are necessary to create a localized application?
System.Globalization and System.Resources.

What is the smallest unit of execution in .NET?
an Assembly.

When should you call the garbage collector in .NET?
As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.

How do you convert a value-type to a reference-type?
Use Boxing.

What happens in memory when you Box and Unbox a value-type?
Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites