Tuesday, May 27, 2008

.NET

1.Differences between DLL and EXE?



2.Can an assembly have EXE?



3.Can a DLL be changed to an EXE?



4.Compare & contrast rich client (smart clients or Windows-based) & browser-based Web application



5.Compare Client server application with n-Tier application


6.Can a try block have more than one catch block?


7.Can a try block have nested try blocks?


8.How do you load an assembly at runtime?


9.If I am writing in a language like VB or C++, what are the procedures to be followed to support .NET?


10.How do you view the methods and members of a DLL?


11.What is shadowing?


12.What are the collections you’ve used?


13.State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
a)True
b)False



14.The data from an XSL Transform with XmlReader can be returned in one of the following ways
a)objReader = objXslT.Transform(objNav, nothing)
b)objXslT.Transform(objNav, nothing)
c)objReader = objXslT.Transform(objNav, nothing, objWriter)
d)objXslT.Transform(objNav, nothing, objWriter)




15.Pick the command line that would result in the C# compiler generating an XML documentation file
a)csc /doc:NewHome.xml NewHome.cs

b)c /doc /docfile: NewHome.xml NewHome.cs
c)csc /doc /out: NewHome.xml NewHome.cs

d)csc /xml NewHome.cs




16.What is the comment syntax for C#’s XML-based documentation?
a)/** and **/
b)//#
c)///
d)//*



16.When creating a C# Class Library project, what is the name of the supplementary file that Visual Studio.NET creates that contains General Information about the assembly?
a)AssemblyInfo.xml

b)AssemblyInfo.cs
c)AssemblyInformation.cs

d)AssemblyAttributes.cs



17.Which of the following is the C# escape character for Null?
a)\n
b)\0
c)\f
d)\v



18.What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
a)MissingMethodException
b)TypeLoadException
c)MethodLoadException
d)MethodAccessException



19.What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
a)Synchronize()
b)Lock() and UnLock()
c)Lock()
d)Asynchroize()


20.After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be?
a)The AutoEventWireup attribute is set to False
b)The AutomaticPostBack attribute is set to False
c)The codebehind module is not properly compiled
d)The ListBox must be defined WithEvents


21.What method must be overridden in a custom control?
a)The Paint() method
b)The Control_Build() method

c)The Render() method
d)The default constructor



22.What is used to validate complex string patterns like an e-mail address?
a)Extended expressions
b)Regular expressions
c)Irregular expressions
d)Basic expressions



23.The following is a valid statement in ASP.NET<%@ Page Language="C" %>
a)True
b)False



24.A valid comment block in ASP.NET is
a)
b)
c)<% - - Comment - - %>
d)<% ! - - Comment - - >



25.The event handlers that can be included in the Global.asax file are
Application Start and
a)Session Start event handlers only
b)Application End and
c)Session End event handlers only
d)Per-request and Non-deterministic event handlers only
e)Application Start and End ,
f)Session Start and End, Per-request and Non-deterministic event handlers



26.A Few of the Namespaces that get imported by default in an ASPX file are
a)System, System.Data, System.Drawing,
b)System.Globalization

c)System,
System.IO, System.Management, System.Globalization
d)System, System.Collections,
e)System.Text, System.Web
f)System,
System.NET,
System.Reflection, System.Web


27.The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
a)System.dll, System.Data.dll,
b)System.Web.dll, System.Xml.dll,

c)System.dll,
d)System.Collections.dll, System.IO.dll
e)System.dll, System.Reflection.dll,
f)System.Globalization.dll,

g)System.Drawing.dll, System.Assembly.dll,
h)System.Text.dll



28.An .ASHX file contains the following
a)Code-behind that are used in the code
b)Server Controls that can be called from a code-behind file
c)HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
d)Contains normal ASP.NET code and can be used as an include file



29.What is the output for the following code snippet:

public class testClass
{
public static void Main(string[] args)
{
System.Console.WriteLine(args[1]);
}//end Main
}//end class testClassCompiler Error
a)Runtime Error
b)Hello C# world
c)None of the above



30.One of the possible way of writing an ASP.NET handler that works like an ISAPI filter- that is, that sees requests and responses and modifies them also, is by,
a)writing a module that extends FormsAuthenticatonModule and using it
b)writing a component class that extends HttpModuleCollection and using it
c)writing an HTTP module-a Class that implements IhttpModule and registering it in d)d)Web.Config
e)All of the above



31.The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
a)@OutputCache
b)@CacheOutput
c)@PageCache
d)@CacheAll





32.How can be the web application get configured with the following authorization rules
a)Anonymous users must not be allowed to access the application.
b)All persons except David and John must be allowed to access the application.
c)
d)
e)
f)



33.What will be the output of the following code snippet?

using System;
class MainClass
{
static void Main( )
{
new MainClass().Display( 3.56 );
}

private void Display( float anArg )
{
Console.Write( “{0} {1}”, anArg.GetType(), anArg );
}

double Display( double anArg )
{
Console.Write( “{0} {1}”, anArg.GetType(), anArg );
return anArg;
}

public decimal Display( decimal anArg )
{
Console.Write( “{0} {1}”, anArg.GetType(), anArg ); return anArg;
}
}
a)System.Single 3.56

b)System.Float 3.56

c)System.Double 3.56

d)System.Decimal 3.56