Set - 5

Question 6 :

What namespaces are necessary to create a localized application?

Answer :

System.Globalization, System.Resources.

 


Question 7 :

Does Console.WriteLine() stop printing when it reaches a NULL character within a string?

Answer :

Strings are not null terminated in the runtime, so embedded nulls are allowed. Console.WriteLine() and all similar methods continue until the end of the string.


Question 8 :

What is the advantage of using System.Text.StringBuilder over System.String?

Answer :

StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it is being operated on, a new instance is created.


Question 9 :

What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?

Answer :

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, but it is a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.


Question 10 :

Why do I get a security exception when I try to run my C# app?

Answer :

Some security exceptions are thrown if you are working on a network share. There are some parts of the frameworks that will not run if being run off a share (roaming profile, mapped drives, etc.). To see if this is what's happening, just move the executable over to your local drive and see if it runs without the exceptions. One of the common exceptions thrown under these conditions is

System.Security.SecurityException.

To get around this, you can change your security policy for the intranet zone, code group 1.2, (the zone that running off shared folders falls into) by using the caspol.exe tool.