R4RIN
Articles
Java 8
MCQS
ASP.Net MCQ Quiz Hub
ASP.Net Mcq Question Set 5
Choose a topic to test your knowledge and improve your ASP.Net skills
1. Which of the following are reference types?
String
Exception
Class
All of the above
2. Why should you write the cleanup code in Finally block?
Compiler throws an error if you close the connection in try block.
Resource cannot be destroyed in catch block.
Finally blocks run whether or not exception occurs.
All of the above
3. When the garbage collector runs.
It runs automatically
EveryDay
Every alternate day
When IIS restart.
4. Which of the following is true ? 1. AJAX is a platform-independent technology 2. AJAX can work with web application 3. AJAX can only work with ASP.NET 4. AJAX is a platform-dependent technology
1, 2
1,2,3
1,3,4
None of the above
5. Which control is required for every page that have AJAX Extensions for ASP.NET?
UpdatePanel
ScriptManager
ContentPanel
none of the above
6. AnUpdatePanel control defined on a page. Button control is placed outside of the UpdatePanel. How to cause the UpdatePanel to execute an update.
Set the Trigger attribute of the UpdatePanel to the ID of the Button control.
Set the AsyncPostBackTrigger attribute of the Button control to the ID of theUpdatePanel.
Place the button control on the update panel without script manager.
Add an AsyncPostBackTrigger control to the Triggers section of the UpdatePanel. Set the ControlID attribute of the AsyncPostBackTrigger control to the ID of the Button control.
7. Which method is used to dynamically register client script from code?
Page.ClientScript.RegisterClientScriptBlock
RegisterScript
Page.ClientScript
none of the above
8. Which interface you will use wrap an AJAX client control into a custom server control?
IScriptManager
IScriptControl
IScriptAJAX
none of the above
9. What is jQuery? 1. jQuery is an open source library 2. It works client side. 3. jQuery is java technology.
1, 2
1, 2, 3
1, 3
None of the above
10. If you must use a user name and password to connect to a database, where should you store the sensitive information?
Compiled in the application
In an encrypted application configuration file
In a resource file deployed with the application
In the registry
11. What is the recommended method for securing sensitive connection string information?
Encrypting the data in the application configuration file
Using a code obfuscator
Using Integrated Security (Windows Authentication)
Querying the user for his or her credentials at run time
12. What are the element of code access security?
Evidence,Permission
SQLSecurity
UserInterface
SQL Injection
13. What is Caspol?
Command line tool
Code access security policy tool
Case Tool
Command line tool & Code access security policy tool
14. Which data provider gives the maximum performance from a connection to SQL Server?
The OLE DB data provider.
The JDBC data provider.
The SqlClient data provider.
The Oracle data provider
15. Which CommandType value is incorrect?
StoredProcedure
TableDirect
TableSchema
textContent
16. Which SqlCommand execution returns the value of the first column of the first row from a table?
ExecuteNonQuery
ExecuteReader
ExecuteXmlReader
ExecuteScalar
17. Which SqlCommand execution returns the number of effected records in the table?
ExecuteNonQuery
ExecuteReader
ExecuteXmlReader
ExecuteScalar
18. OleDbConnectionobject works with? 1. When connecting to an Oracle database 2. When connecting to an Office Access database 3. When connecting to SQL Server 6.x or later 4. When connecting to SQL Server 2000
1, 2
2, 3
1, 3
4
19. What is the minimal information needed by a connection string to open a connection to a SQL Server 2000 or SQL Server 2005 database? 1. A valid data source 2. A valid provider name 3. A valid file path 4. Appropriate credentials or Integrated Security settings
1, 2
1, 2, 3
1, 3
1, 4
20. What happens when you call the Close method of a connection object? 1. The connection is destroyed. 2. The connection is returned to the connection pool. 3. The StateChangeevent is fired. 4. All non - committed pending transactions are rolled back.
1, 2
1,3
2, 3, 4
All of the above
21. What determines the connection pool that a connection should use? 1. A connection string 2. The identity or credentials of the user opening the connection 3. The database being connected to 4. The connection object used to connect to the database
1, 2
1, 2, 3
1, 3
1, 4
22. What are the recommended techniques for enabling connection pooling on for a SQL Server 2000 or SQL Server 2005 database? 1. Setting the OLE DB Services connection string keyword to -4 2. Opening a connection and not explicitly disabling pooling 3. Setting the connection string keyword Pooling = True in the connection string 4. Using the Connection Pooling tab of the ODBC Data Source Administrator dialog Box
1, 2
1, 2, 3
2, 3
1, 4
23. How do I explicitly turn on connection pooling for an OLE DB data source?
By setting the OLE DB Services connection string keyword to 0
By setting the OLE DB Services connection string keyword to -4
By setting the OLE DB Services connection string keyword to -1
By setting the OLE DB Services connection string keyword to -7
24. What property contains the actual error message returned by SQL Server? 1. SqlException.Source 2. SqlException.Message 3. SqlError.Class 4. SqlError.Message
1, 2
1, 2, 3
1, 3
2, 4
25. What is the connection string’s key / value pair for using WindowsAuthentication in SQLServer 2000 and SQL Server 2005?
1, 2
1, 2, 3
2, 3
1, 4
26. What are the Command object property settings to execute a stored procedure? 1. CommandType = Text, CommandText = stored procedure name 2. CommandType= Text, CommandText = SQL syntax to execute the stored procedure 3. CommandType = StoredProcedure, CommandText = SQL syntax to execute the stored procedure 4. CommandType = StoredProcedure, CommandText = stored procedure name
1, 2
1, 2, 3
2, 4
1, 4
27. What should you do to access the returned tabular data after starting execution of a command that runs asynchronously? (Choose all that apply.) 1. Call the EndExecuteNonQuerymethod. 2. Call the EndExecuteReadermethod. 3. Wait for the StatementCompletedevent to fire and iterate through the DataReader. 4. Wait for the StatementCompletedevent to fire, call the EndExecuteReadermethod, and then iterate through the DataReader.
1, 2
1, 2, 3
2, 3
2, 4
28. When would you typically use an Input parameter? 1. When the parameter value is created based on user input 2. When the parameter is used to send data from the application to the database 3. When the command is set to execute a statement with a WHERE clause 4. When the parameter value is passed to an INSERT statement
1, 2
1, 2, 3
2, 3
1, 4
29. What are the three primary kinds of parameters?
. Input, Integer, String
Integer, String, DateTime
int, varchar, nvarchar
Input, Output, InputOutput
30. How do you determine the actual SQL data type of a SqlParameter (the type expected by the SQL Server)?
It is the .NET Framework data type in your application that the parameter represents.
It is the type of column or data in SQL Server that the command expects.
It is the type of column in a DataTablethat it represents.
It is any type defined in the SqlDbDataTypeenumeration.
31. Which of the following is true?
DataTable object contain DataRow and DataColoumn objects
DataSet and DataTable can be binary serialized
DataSet and DataTable can be XML serialized
All of the above
32. If you are using the DataSet and you have to display the data in sorted order what will you do?
Use Sort method of DataTable
Use Sort method of DataSet
Use DataViev object with each sort
Use datapaging and sort the data.
33. In which Event you can set the value of a Theme?
Page_Load
Page_Render
Page_PreRender
Page_PreInit
34. You need to initialize some variable only when the first user accesses the application. What should you do?
Add code to the Application_OnStart event handler in the Global.asax file.
Add code to the Application_BeginRequest event handler in the Global.asax
Add code to the Session_OnStart event handler in the Global.asax file
None of the above
35. Which of the following template supports by Repeater control?
<ItemTemplate>
<AlternatingItemTemplate>
<SeperatorTemplate>
All of the above
36. Which of the following works on client side?
ViewState
HiddenField
ControlState
All of the above
37. Which of the following works on server side?
ViewState
HiddenField
Application and session
All of the above
38. Application_Start event is available in which file?
Global.asax
Local.asax
Web.config
none of the above
39. You have to log the data into database if your session times out. Which event you will use?
Session_End
Application_End
Application_Start
Application_SessionTimeout
40. Which of the following is true when referencing master page from content page?
Content pages can reference private indexer in the master page.
Content pages can reference private Properties in the master page.
Contentpages can reference public Properties in the master page.
Content pages can reference private Methods in the master page.
41. If you are using Webparts in your web page then which control is necessary?
WebpartController
WebPartmanager
WebpartZone
None of the above
42. What component do you need to enable for a user to add new web parts?
WebpartZone
CatalogZone
WebPartManager
WebManager
43. Which of the following are required to enable users to change the title of web part?
CatalogZone
TitleZone
EditorZone, AppearanceEditorPart
WebPart
44. What is the file extension of web service in ASP.NET?
.ascx
.asmx
.aspx
.docx
45. If you want to access a web service method, which attribute it must have?
[WebMethod]
[PageMetod]
[Web.Service]
[WebSupport]
46. Range Validator control in ASP.NET supports which type?
Integer
String
Currency
All of the above
47. If you are using user control in ASP.NET page which directory will be used?
Register
Assembly
Implements
Aspx
48. A web application can contain ____
Only One Web.Config File
Only Two Web.Config File
more than one Web.config file
No file.
49. What is the last event of web page life cycle?
Page_Load
Page_LoadComplete
Page_Finish
Page_Unload
50. ByDefault ASP.Net SessionID is stored in _____
Application
Session
Cookies
ViewState
Submit