5 Written Questions
5 Matching Questions
- Where is the output of TextWriterTraceListener redirected?
- What is the implicit name of the parameter that gets passed into the set method/property of a class?
- What does the Dispose() method do with the connection object?
- What is the top .NET class that everything is derived from?
- Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
- a The data type of the "value" parameter is defined by whatever data type the property is declared as.
- b Closes the connection and deletes the object from memory.
- c To the Console or a text file depending on the parameter passed to the constructor.
- d 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 tracing activities.
- e System.Object
5 Multiple Choice Questions
- 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.
- 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.
- 1) CorDBG - command-line debugger. You must compile the original C# file using the /debug switch to use CorDBG. 2) DbgCLR - graphic debugger. Visual Studio .NET uses the DbgCLR.
- 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 its not as fast and efficient as SQLServer.Net.
- 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.
5 True/False Questions
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 sets of objects) to force the garbage collector to dispose of those very large objects from memory. This is usually not good practice.
What are the different ways a method can be overloaded? → Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Also structs cannot inherit.
What is the difference between the Debug class and Trace class? → Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Also structs cannot inherit.
How can you sort the elements of an array in descending order? → No.
How do you convert a value-type to a reference-type? → Attach the aspnet_wp.exe process to the DbgCLR debugger.