ASP.Net/ASP.Net Mcq Question Set 5 Sample Test,Sample questions

Question:
  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.1, 2

2.1, 2, 3

3. 2, 3

4. 1, 4


Question:
  Which SqlCommand execution returns the value of the first column of the first row from a table?

1.ExecuteNonQuery

2.ExecuteReader

3.ExecuteXmlReader

4.ExecuteScalar


Question:
 If you are using user control in ASP.NET page which directory will be used?

1.Register

2. Assembly

3.Implements

4.Aspx


Question:
 If you must use a user name and password to connect to a database, where should you store the sensitive information?

1.Compiled in the application

2. In an encrypted application configuration file

3. In a resource file deployed with the application

4.In the registry


Question:
 In which Event you can set the value of a Theme?

1.Page_Load

2.Page_Render

3.Page_PreRender

4.Page_PreInit


Question:
 What is Caspol?

1.Command line tool

2.Code access security policy tool

3.Case Tool

4. Command line tool & Code access security policy tool


Question:
 What is the file extension of web service in ASP.NET?

1..ascx

2. .asmx

3..aspx

4..docx


Question:
 What is the last event of web page life cycle?

1.Page_Load

2.Page_LoadComplete

3. Page_Finish

4. Page_Unload


Question:
 Which CommandType value is incorrect?

1.StoredProcedure

2. TableDirect

3.TableSchema

4.textContent


Question:
 Which control is required for every page that have AJAX Extensions for ASP.NET?

1.UpdatePanel

2. ScriptManager

3.ContentPanel

4.none of the above


Question:
 Which method is used to dynamically register client script from code?

1.Page.ClientScript.RegisterClientScriptBlock

2. RegisterScript

3.Page.ClientScript

4.none of the above


Question:
 Which of the following are reference types?

1.String

2.Exception

3.Class

4.All of the above


Question:
 Which of the following works on client side?

1.ViewState

2.HiddenField

3.ControlState

4.All of the above


Question:
 You have to log the data into database if your session times out. Which event you will use?

1.Session_End

2. Application_End

3. Application_Start

4. Application_SessionTimeout


Question:
A web application can contain ____

1.Only One Web.Config File

2.Only Two Web.Config File

3.more than one Web.config file

4. No file.


Question:
AnUpdatePanel control defined on a page. Button control is placed outside of the UpdatePanel. How to cause the UpdatePanel to execute an update.

1.Set the Trigger attribute of the UpdatePanel to the ID of the Button control.

2.Set the AsyncPostBackTrigger attribute of the Button control to the ID of theUpdatePanel.

3. Place the button control on the update panel without script manager.

4.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.


Question:
Application_Start event is available in which file?

1.Global.asax

2. Local.asax

3.Web.config

4.none of the above


Question:
ByDefault ASP.Net SessionID is stored in _____

1.Application

2. Session

3.Cookies

4.ViewState


Question:
How do I explicitly turn on connection pooling for an OLE DB data source?

1.By setting the OLE DB Services connection string keyword to 0

2.By setting the OLE DB Services connection string keyword to -4

3.By setting the OLE DB Services connection string keyword to -1

4.By setting the OLE DB Services connection string keyword to -7


Question:
How do you determine the actual SQL data type of a SqlParameter (the type expected by the SQL Server)?

1.It is the .NET Framework data type in your application that the parameter represents.

2. It is the type of column or data in SQL Server that the command expects.

3.It is the type of column in a DataTablethat it represents.

4. It is any type defined in the SqlDbDataTypeenumeration.


Question:
If you are using the DataSet and you have to display the data in sorted order what will you do?

1.Use Sort method of DataTable

2.Use Sort method of DataSet

3.Use DataViev object with each sort

4.Use datapaging and sort the data.


Question:
If you are using Webparts in your web page then which control is necessary?

1.WebpartController

2.WebPartmanager

3.WebpartZone

4. None of the above


Question:
If you want to access a web service method, which attribute it must have?

1. [WebMethod]

2. [PageMetod]

3.[Web.Service]

4. [WebSupport]


Question:
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.1, 2

2. 2, 3

3.1, 3

4.4


Question:
Range Validator control in ASP.NET supports which type?

1.Integer

2.String

3.Currency

4.All of the above


Question:
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.1, 2

2.1, 2, 3

3.2, 4

4.1, 4


Question:
What are the element of code access security?

1.Evidence,Permission

2.SQLSecurity

3.UserInterface

4.SQL Injection


Question:
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.1, 2

2. 1, 2, 3

3.2, 3

4. 1, 4


Question:
What are the three primary kinds of parameters?

1.. Input, Integer, String

2. Integer, String, DateTime

3. int, varchar, nvarchar

4.Input, Output, InputOutput


Question:
What component do you need to enable for a user to add new web parts?

1.WebpartZone

2.CatalogZone

3.WebPartManager

4. WebManager


Question:
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.1, 2

2.1, 2, 3

3. 1, 3

4.1, 4


Question:
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. 1, 2

2.1,3

3.2, 3, 4

4. All of the above


Question:
What is jQuery?

1. jQuery is an open source library
2. It works client side.
3. jQuery is java technology.

1.1, 2

2.1, 2, 3

3.1, 3

4. None of the above


Question:
What is the connection string’s key / value pair for using WindowsAuthentication in SQLServer 2000 and SQL Server 2005?

1. 1, 2

2. 1, 2, 3

3. 2, 3

4.1, 4


Question:
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. 1, 2

2.1, 2, 3

3. 1, 3

4.1, 4


Question:
What is the recommended method for securing sensitive connection string information?

1. Encrypting the data in the application configuration file

2.Using a code obfuscator

3. Using Integrated Security (Windows Authentication)

4. Querying the user for his or her credentials at run time


Question:
What property contains the actual error message returned by SQL Server?

1. SqlException.Source
2. SqlException.Message
3. SqlError.Class
4. SqlError.Message

1.1, 2

2.1, 2, 3

3.1, 3

4.2, 4


Question:
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. 1, 2

2. 1, 2, 3

3. 2, 3

4.2, 4


Question:
When the garbage collector runs.

1.It runs automatically

2.EveryDay

3.Every alternate day

4. When IIS restart.


Question:
Which data provider gives the maximum performance from a connection to SQL Server?

1.The OLE DB data provider.

2. The JDBC data provider.

3. The SqlClient data provider.

4. The Oracle data provider


Question:
Which interface you will use wrap an AJAX client control into a custom server control?

1. IScriptManager

2.IScriptControl

3.IScriptAJAX

4.none of the above


Question:
Which of the following are required to enable users to change the title of web part?

1. CatalogZone

2.TitleZone

3.EditorZone, AppearanceEditorPart

4.WebPart


Question:
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. 1, 2

2.1,2,3

3.1,3,4

4. None of the above


Question:
Which of the following is true when referencing master page from content page?

1.Content pages can reference private indexer in the master page.

2.Content pages can reference private Properties in the master page.

3.Contentpages can reference public Properties in the master page.

4. Content pages can reference private Methods in the master page.


Question:
Which of the following is true?

1. DataTable object contain DataRow and DataColoumn objects

2.DataSet and DataTable can be binary serialized

3.DataSet and DataTable can be XML serialized

4.All of the above


Question:
Which of the following template supports by Repeater control?

1.<ItemTemplate>

2.<AlternatingItemTemplate>

3. <SeperatorTemplate>

4.All of the above


Question:
Which of the following works on server side?

1.ViewState

2.HiddenField

3.Application and session

4. All of the above


Question:
Which SqlCommand execution returns the number of effected records in the table?

1. ExecuteNonQuery

2. ExecuteReader

3.ExecuteXmlReader

4.ExecuteScalar


Question:
Why should you write the cleanup code in Finally block?

1.Compiler throws an error if you close the connection in try block.

2. Resource cannot be destroyed in catch block.

3. Finally blocks run whether or not exception occurs.

4.All of the above


Question:
You need to initialize some variable only when the first user accesses the application. What should you do?

1.Add code to the Application_OnStart event handler in the Global.asax file.

2.Add code to the Application_BeginRequest event handler in the Global.asax

3.Add code to the Session_OnStart event handler in the Global.asax file

4.None of the above


More MCQS

  1. ASP.Net Mcq Question Set 1
  2. ASP.Net Mcq Question Set 2
  3. ASP.Net Mcq Question Set 3
  4. ASP.Net Mcq Question Set 4
  5. ASP.Net Mcq Question Set 5
  6. ASP.Net Mcq Question Set 6
  7. ASP.Net Mcq Question Set 7
  8. ASP.Net Mcq Question Set 8
  9. ASP.Net Mcq Question Set 9
  10. ASP.Net Mcq Question Set 10
  11. ASP.Net Mcq Question Set 11
  12. ASP.Net Mcq Question Set 12
  13. ASP.Net Mcq Question Set 13
  14. ASP.Net Mcq Question Set 14
  15. Silverlight mcq questios and answer
  16. Microsoft Silverlight MCQ Questions & Answers
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!