Vous êtes sur la page 1sur 3

1. Whats the advantage of using System.Text.StringBuilder over System.String?

StringBuilder is more efficient in cases where a large amount of manipulation is


done in the text. Strings are immutable, so it is increasingly being operated,
a new instance is created.
2. Can you store multiple data types in System.Array?
No.
3. Whats the difference between the System.Array.CopyTo() and System.Array.Clone(
)?
The first three performs a deep copy of the array, the second three is shallow.
4. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
5. Whats the C# equivalent of C++ catch (), which was a catch-all statement for an
y possible exception?
A catch block that catches the exception of type Process.Exception. You can also
omit the parameter information type in this case and write catch {}.
6. Why is it a bad idea to throw your own exceptions?
Well, if that point is known that an error has occurred, why not write the code
of law to resolve this error, instead of passing a new Exception object to the c
atch block? Start your own exclusions means that some design flaws in the projec
t.
7. Whats a delegate?
A delegate object encapsulates a reference to a system. In C++ they were referre
d to as function pointers.
8. Hows the DLL Hell problem solved in .NET?
Assembly versions allows the application to specify not only the library it need
s to function (which was available under Win32), but also the version of the Ass
embly.
9. What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.
10. Whats a satellite assembly?
When writing a multilingual application in multi-cultural. NET, and need to deli
ver the core application separately from the localized modules, the localized as
semblies that change the core application are called satellite assemblies.
11. Whats the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
12. How do you generate documentation from the C# file commented properly with a
command-line compiler?
Compile it with a /doc switch.
13. Whats the difference between <c> and <code> XML documentation tag?
Single line code example and multiple-line code example.
14. What debugging tools come with the .NET SDK?
Cordbg - command-line debugger, and DbgCLR - graphic debugger. Visual Studio. NE
T uses the DbgCLR. Cordbg To use, you must compile the original C # using the /
debug.
15. What does assert() do?
In debug compilation, assert themselves in a Boolean condition as a parameter, a
nd displays the error dialog if the condition is false. The program continues wi
thout interruption if the condition is true.
16. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be detailed for some applications that are constantly walk
ing, you run the risk of overloading the machine and the hard drive there. Six l
evels range from None to detail, which allows you to change search activities.
17. How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
18. What are three test cases you should go through in unit testing?
Positive check cases (correct information, correct output), negative check cases
(broken or missing information, proper handling), exception check cases (except
ions are thrown & caught properly).
19. 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.
20. What are advantages and disadvantages of Microsoft-provided data provider cl
asses in ADO.NET?
SQLServer.NET information provider is high speed and robust, but requires purcha
sing a license for Microsoft SQL Server. OLE-DB.NET is universal for accessing o
ther sources, such as Oracle, DB2, Informix and Microsoft Access, but it is. Net
work layer on top of OLE layer, so do not fastest in the world. ODBC.NET is a de
precated layer provided for backward compatibility with ODBC engines.
21. What is the wildcard character in SQL? Lets say you want to query database wi
th LIKE for all employees whose name starts with La.
The wildcard character is %, the proper query with LIKE would involve La%.
22. Explain ACID rule of thumb for transactions.
Transaction must be atomic (that is four units of work and not depend on previou
s and subsequent transactions), made (the information is confirmed or roll back,
no "between" if something has been updated and something is not any), isolated
(no transaction sees the intermediate results of the current transaction), Durab
le (the values persist if the information had been committed, even if the proces
s is blocked just after).
23. What does the parameter Initial Catalog define inside Connection String?
The database name to connect to.
24. What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where ea
ch parameter is the same, including security settings.
25. Whats the data provider name to connect to Access database?
Microsoft.Access.

Vous aimerez peut-être aussi