-
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 is the wildcard character in SQL?
Let us 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 the three services model (three-tier application).
Presentation (UI), business (logic and underlying code) and data (from storage or other sources).
-
What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).
-
How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
-
Why would you use untrusted verificaion?
Web Services might use it, as well as non-Windows applications.
-
What is the first step to do anything with assembly
A) Load corresponding assembly to running processB) Query the assemblyC) None
-
Can multiple catch blocks be executed?
No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.
-
Which of the following explicit type conversion is achieved with out loosing the original data value
A) Byte to LongB) Long to ByteC) Float to intExplanation: Byte stores up to 255 which can easily be stored in a long variable
-
How do you make CLR enforce overflow checking
A) Using Checked KeywordB) Using Unchecked KeywordC) With Try Catch
-
How do I create a multilanguage, multifile assembly?
Unfortunately, this is currently not supported in the IDE. To do this from the command line, you must compile your projects into netmodules (/target:module on the C# compiler), and then use the command line tool al.exe (alink) to link these netmodules together.
-
How can I get the ASCII code for a character in C#?
Casting the char to an int will give you the ASCII value: char c = 'f';System.Console.WriteLine((int)c);or for a character in a string: System.Console.WriteLine((int)s[3]);The base class libraries also offer ways to do this with the Convert class or Encoding classes if you need a particular encoding.
-
How can I access the registry from C# code?
By using the Registry and RegistryKey classes in Microsoft.Win32, you can easily access the registry. The following is a sample that reads a key and displays its value: using System;using Microsoft.Win32;class regTest{public static void Main(String[] args){RegistryKey regKey;Object value;regKey = Registry.LocalMachine;regKey = regKey.OpenSubKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0");value...
-
What is the use of fixed statement
A) To stop the garbagecollector to move the objects in useB) To dispose the object at the end of the defined scopeC) To tell the garbage collector to move the object is useD) To fix the size of an object.
-
How do you import Activex component in to .NET
A) With AXImp.exeB) With Pinvoke.exeC) With Tlbimp.exe
-
Which class use to Read/Write data to memory
A) FileStreamB) NetworkStreamC) MemoryStream
-
What does the parameter Initial Catalog define inside Connection String?
The database name to connect to.
-
What is a multicast delegate?
It is a delegate that points to and eventually fires off several methods.
-
What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.
-
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 m, string c, int type);public static int Main() {return MessageBoxA(0, "Hello World!", "Caption", 0);}}This example shows the minimum requirements for declaring a C# method that is implemented in a native DLL. The method...
C# Interview Questions
Ans