What namespaces are necessary to create a localized application?

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 [...]

Difference between value and reference type. what are value types and reference types?

Difference between value and reference type. what are value types and reference types?
Value type – bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort
Value types are stored in the Stack
Reference type – class, delegate, interface, object, string
Reference types are stored in the Heap
What are the two kinds of [...]

ctype(123.34,integer) – should it throw an error? Why or why not?

ctype(123.34,integer) – should it throw an error? Why or why not?
Answer1
It would work fine. As the runtime type of 123.34 would be double, and Double can be converted to Integer.
Answer2
the ctype(123.34,integer) will work fine no errors
directcast(123.34,integer) – should it throw an error? Why or why not?
It would throw an InvalidCast exception as the runtime type [...]

What is the wildcard character in SQL?

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 [...]

Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

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 [...]

Why can’t you specify the accessibility modifier for methods inside the interface?

Why can’t you specify the accessibility modifier for methods inside the interface?
They all must be public, and are therefore public by default.
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 [...]

What class is underneath the SortedList class?

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 [...]

Why does DllImport not work for me?

Why does DllImport not work for me?
All methods marked with the DllImport attribute must be marked as public static extern.
What is a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
What is the difference between an interface and abstract class?
In the interface all methods must be [...]

How do I create a Delegate/MulticastDelegate?

How do I create a Delegate/MulticastDelegate?
C# requires only a single parameter for delegates: the method address. Unlike other languages, where the programmer must specify an object reference and the method to invoke, C# can infer both pieces of information by just specifying the method’s name. For example, let’s use System.Threading.ThreadStart: Foo MyFoo = new Foo(); [...]

How do I convert a string to an int in C#?

How do I convert a string to an int in C#?
Here’s an example: using System;

class StringToInt
{
public static void Main()
{
String s = "105";
int x = Convert.ToInt32(s);
Console.WriteLine(x);
}
}

How do you directly call a native function exported from a DLL?
Here’s a quick example of the DllImport attribute in action: using System.Runtime.InteropServices;

class C
{
[ DllImport("user32.dll")]
public static extern int MessageBoxA(int h, string [...]