Question 1 :
The RangeValidator control supports the following datatype
* Integer and String
* Integer, Float, String, XMLDatatypes
* Integer, String and Date
* Integer, Boolean, Short, String and Date
Integer, String and Date
Question 2 :
What is the difference between Convert.ToInt32 and int.Parse?
* Both are same and both can handle null value.
* Convert.ToInt32 can handle null value but int.Parse throws ArgumentNullException error.
* int.Parse can handle null value but Convert.ToInt32 throws ArgumentNullException error.
* Both Convert.ToInt32 and int.Parse cannot handle null value.
Convert.ToInt32 can handle null value but int.Parse throws ArgumentNullException error.
Question 3 :
State True or False: Any ODBC-compliant database can be accessed through ASP.NET
Question 4 :
You need to select a .NET language that has auto-documenting features built into the source code and compiler. Given the scenario above what language compiler should be selected?
Question 5 :
A set of tables are maintained in a Dataset as
* TablesCollection object
* DataTableCollection object
* DataRowsCollection object
* TableRowCollection object
Question 6 :
The namespaces needed to use data mechanisms in ASP.NET pages are
* System.Data, System.Data.OleDb or System.Data.SQL
* System.Data, System.Data.ODBC
* System.Data, System.Data.DataRow
* System.Data.DataRowCollection, System.Data.DbType
System.Data, System.Data.OleDb or System.Data.SQL
Question 7 :
What are the different methods to access Database in .NET ?
* OleDB, JDBC, SQLServer
* ODBC-JDBC, DataSet, SQLClient
* Datasource, DataSet, DSN
Question 8 :
The two properties of a DataGrid that has to be specified to turn on sorting and paging respectively are
* EnableSorting = "true" and EnablePaging = "true"
* DisableSorting = "false" and DisablePaging = "false"
* AllowSorting = "true" and AllowPaging = "true"
* Sorting = "true" and Paging = "true"
AllowSorting = "true" and AllowPaging = "true"
Question 9 :
Which one of the following objects is used to create a foreign key between two DataTables?
Question 10 :
The Syntax for data-binding expressions is
* <%# property or collection %>
* <%# property or collection #%>
* <%$ property or collection %>
* <%@ property or collection %>
<%# property or collection #%>
Question 11 :
The method that need to be invoked on the DataAdapter control to load the generated dataset with data is
Question 12 :
Which of the following operations can you NOT perform on an ADO.NET DataSet?
* A DataSet can be synchronised with the database.
* A DataSet can be synchronised with a RecordSet.
* A DataSet can be converted to XML.
* You can infer the schema from a DataSet
A DataSet can be synchronised with a RecordSet.
Question 13 :
Which is the correct statement to set the alias name for namespace in C#?
* using System Data.OracleClient = aliasName;
* using aliasName = System.Data.OracleClient;
* string aliasName = using.System.Data.OracleClient;
* Both a & b
using aliasName = System.Data.OracleClient;
Question 14 :
The property that indicates whether existing database constraints should be observed when performing updates
Question 15 :
State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
Question 16 :
The data from an XSL Transform with XmlReader can be returned in one of the following ways
* objReader = objXslT.Transform(objNav, nothing)
* objXslT.Transform(objNav, nothing)
* objReader = objXslT.Transform(objNav, nothing, objWriter)
* objXslT.Transform(objNav, nothing, objWriter)
Question 17 :
Pick the command line that would result in the C# compiler generating an XML documentation file
* csc /doc:NewHome.xml NewHome.cs
* c /doc /docfile: NewHome.xml NewHome.cs
* csc /doc /out: NewHome.xml NewHome.cs
* csc /xml NewHome.cs
csc /doc:NewHome.xml NewHome.cs
Question 18 :
What is the comment syntax for C#'s XML-based documentation? * /** and **/ * //# * /// * //*
Question 19 :
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?
Question 20 :
Which of the following is the C# escape character for Null?
Question 21 :
What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
Question 22 :
What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
* Lock() and UnLock()
Question 23 :
After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn't execute. What could the problem be?
* The AutoEventWireup attribute is set to False
* The AutomaticPostBack attribute is set to False
* The codebehind module is not properly compiled
* The ListBox must be defined WithEvents
AutoPostBack attribute is set to False
Question 24 :
What method must be overridden in a custom control?
* The Paint() method
* The Control_Build() method
* The Render() method
* The default constructor
The Render() method
Question 25 :
What is used to validate complex string patterns like an e-mail address?
* Extended expressions
* Regular expressions
* Irregular expressions
* Basic expressions
Question 26 :
The following is a valid statement in ASP.NET<%@ Page Language="C" %>
Question 27 :
A valid comment block in ASP.NET is
* <!- - - Comment - - - >
* <!- - Comment - - >
* <% - - Comment - - %>
* <% ! - - Comment - - >
<% - - Comment - - %>
Question 28 :
The event handlers that can be included in the Global.asax file are
* Application Start and
Session Start event handlers only
* Application End and
Session End event handlers only
* Per-request and Non-deterministic event handlers only
* Application Start and End ,
Application Start and End
Question 29 :
A Few of the Namespaces that get imported by default in an ASPX file are
* System, System.Data, System.Drawing,
System.IO, System.Management, System.Globalization
* System, System.Collections,
System, System.Collections, System.Text, System.Web
Question 30 :
The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
* System.dll, System.Data.dll,
* System.dll, System.Reflection.dll,
* System.Drawing.dll, System.Assembly.dll,
System.dll, System.Data.dll, System.Web.dll, System.Xml.dll
Question 31 :
An .ASHX file contains the following
* Code-behind that are used in the code
* Server Controls that can be called from a code-behind file
* HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
* Contains normal ASP.NET code and can be used as an include file
HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
Question 32 :
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,
* writing a module that extends FormsAuthenticatonModule and using it
* writing a component class that extends HttpModuleCollection and using it
* writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
* All of the above
writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
Question 33 :
The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
Question 34 :
If we develop an application that must accommodate multiple security levels through secure login and ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
* <SessionState mode="InProc"stateConnectionString=" tcpip=127.0.0.1:42424" sqlConnectionString=" data source=127.0.0.1;user id=sa;password="cookieless="false" timeout="30" />
* <SessionState mode="OutProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30" />
* <SessionState mode="stateserver" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30" />
SessionState mode="stateserver" stateConnectionString="tcpip=127.0.0.1:42424? sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30?
Question 35 :
What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
Question 36 :
How can be the web application get configured with the following authorization rules
* Anonymous users must not be allowed to access the application.
* All persons except David and John must be allowed to access the application.
o <authorization><allow roles ="*"><deny roles = "?"><</authorization>
o <authorization><deny users = "applicationname\David; applicationname\John" ><deny users = "*"></authorization>
o <authorization><deny users = "applicationname\David, applicationname\John" ><deny users = "?"><allow users ="*"></authorization>
o <authorization><allow users ="*"><deny users = "applicationname\David, applicationname\John" ></authorization>
authorization deny users = "applicationname\David, applicationname\John" deny users = "?" allow users ="*" /authorization
Question 37 :
Describe the advantages of writing a managed code application instead of unmanaged one. What's involved in certain piece of code being managed?
The advantages include automatic garbage collection, memory management, support for versioning and security. These advantages are provided through .NET FCL and CLR, while with the unmanaged code similar capabilities had to be implemented through third-party libraries or as a part of the application itself.
Question 38 :
Are COM objects managed or unmanaged?
Since COM objects were written before .NET, apparently they are unmanaged.
Any code not written in the Microsoft .NET framework environment is UNMANAGED. So naturally COM+ is unmanaged because it is written in Visual Basic 6.
Question 39 :
So can a COM object talk to a .NET object?
Yes, through Runtime Callable Wrapper (RCW) or PInvoke.
Question 40 :
How do you generate an RCW from a COM object?
Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.
Question 41 :
I can't import the COM object that I have on my machine. Did you write that object?
You can only import your own objects. If you need to use a COM component from another developer, you should obtain a Primary Interop Assembly (PIA) from whoever authored the original object.
The answer to (5) is only partially correct. You *can* import COM objects, even if they are not your own. It is recommended that you obtain the Primary Interop from the vendor, but not required. The most common problem importing a COM DLL is that it exposes objects that form part of a separate COM DLL. You can generate interops for these additional DLLs, and then refer to them when importing the problem DLL.
Question 42 :
How do you call unmanaged methods from your .NET code through PInvoke?
Supply a DllImport attribute. Declare the methods in your .NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you're just providing declarations for method signatures.
Question 43 :
Can you retrieve complex data types like structs from the PInvoke calls?
Yes, just make sure you re-declare that struct, so that managed code knows what to do with it.
Question 44 :
I want to expose my .NET objects to COM objects. Is that possible?
Yes, but few things should be considered first. Classes should implement interfaces explicitly. Managed types must be public. Methods, properties, fields, and events that are exposed to COM must be public. Types must have a public default constructor with no arguments to be activated from COM. Types cannot be abstract.
Question 45 :
Can you inherit a COM class in a .NET application?
The .NET Framework extends the COM model for reusability by adding implementation inheritance. Managed types can derive directly or indirectly from a COM coclass; more specifically, they can derive from the runtime callable wrapper generated by the runtime. The derived type can expose all the method and properties of the COM object as well as methods and properties implemented in managed code. The resulting object is partly implemented in managed code and partly implemented in unmanaged code.
Question 46 :
Suppose I call a COM object from a .NET application, but COM object throws an error. What happens on the .NET end?
COM methods report errors by returning HRESULTs; .NET methods report them by throwing exceptions. The runtime handles the transition between the two. Each exception class in the .NET Framework maps to an HRESULT.
Question 47 :
What do you know about .NET assemblies?
Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET Remoting applications.
Question 48 :
What's the difference between private and shared assembly?
Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.
Question 49 :
What's a strong name?
A strong name includes the name of the assembly, version number, culture identity, and a public key token.
Question 50 :
How can you tell the application to look for assemblies at the locations other than its own install?
directive in the XML .config file for a given application.
<probing privatePath="c:\mylibs; bin\debug" />
should do the trick. Or you can add additional search paths in the Properties box of the deployed application.