Explore topic-wise MCQs in Computer Science.

This section includes 220 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science knowledge and support exam preparation. Choose a topic below to get started.

151.

MARS feature is disabled by default. What action you will perform in connection string to enable this feature?

A. Set MultipleActiveResultSets=True"
B. Set MultipleResultSets=true"
C. Set ResultSets=True"
D. None of the above.
Answer» B. Set MultipleResultSets=true"
152.

LINQ query can work with?

A. DataSet
B. List
C. Array
D. All of the above
Answer» E.
153.

______________is the first method that is fired during the page load.

A. PreRender()
B. Load()
C. Unload()
D. Init()
Answer» E.
154.

______________ is the DataType return in IsPostback property.

A. bit
B. boolean
C. int
D. object
E. string
Answer» C. int
155.

_____________is a property common in every validation control.

A. ValidationExpression
B. InitialValue
C. ValueToCompare
D. ControlToCompare
E. ControlToValidate
Answer» F.
156.

In which file you should write the connection string, so you can access it in all the web page for same application?

A. In App_Data folder.
B. In Web.config file.
C. In MasterPage file.
D. None of the above.
Answer» C. In MasterPage file.
157.

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

A. Page_Load
B. Page_Render
C. Page_PreRender
D. Page_PreInit
Answer» E.
158.

In order to prevent a browser from caching a page which of these xstatements should be written?

A. Response.Cache.SetNoStore();
B. Response.Cache.SetNoServerCaching();
C. Response.Cache.SetNoCaching();
D. None of these
Answer» B. Response.Cache.SetNoServerCaching();
159.

In ASP.NET what are the different types of session mode available?

A. InProc
B. StateServer
C. SQLServer
D. All of the above
Answer» E.
160.

In ASP.NET application DLL files are stored in which folder?

A. App_Code
B. App_Data
C. Bin
D. App_LocalResources
Answer» D. App_LocalResources
161.

In a SQL Statement while working with SqlCommand it returns a single value, at that time which method of Command Object will be used?

A. ExecuteNonQuery
B. ExecuteReader
C. ExecuteScalar
D. All of the above
Answer» D. All of the above
162.

If you want to cache the page according to the browser, then what will you do?

A. Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=”none” VaryByCustom=”browser” %>
B. Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=”none” VaryByHeader=”browser” %>
C. Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=” browser” VaryByCustom=”none” %>
D. None of the above.
Answer» B. Write the given below code in aspx page. <%@ OutputCache Duration=”500” VaryByParam=”none” VaryByHeader=”browser” %>
163.

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

A. [WebMethod]
B. [PageMetod]
C. [Web.Service]
D. [WebSupport]
Answer» B. [PageMetod]
164.

If you want to validate the email addresses, Social Security numbers, phone numbers, and dates types of data, which validation control will be used?

A. RegularExpressionValidator
B. CompareValidator
C. RequiredFieldValidator
D. None of the above
Answer» B. CompareValidator
165.

If you want that command object should returns XML data then which method of Command Object will be used?

A. getXMLData
B. getXML
C. ExecuteXMLReader
D. None of the above.
Answer» D. None of the above.
166.

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

A. Compiled in the application
B. In an encrypted application configuration file
C. In a resource file deployed with the application
D. In the registry
Answer» C. In a resource file deployed with the application
167.

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

A. WebpartController
B. WebPartmanager
C. WebpartZone
D. None of the above
Answer» C. WebpartZone
168.

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

A. Use Sort method of DataTable
B. Use Sort method of DataSet
C. Use DataViev object with each sort
D. Use datapaging and sort the data.
Answer» D. Use datapaging and sort the data.
169.

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

A. Register
B. Assembly
C. Implements
D. Aspx
Answer» B. Assembly
170.

If we want to add graphics using asp.net which of the following web control will you use?

A. Link Button
B. AdRotator
C. Grid View
D. Layout
Answer» C. Grid View
171.

If any user has disabled cookies in their browsers, what can you do to enable them to use forms authentication?

A. Set BoweserCookieEnabled=true;
B. Set cookieless=true;
C. Use the AutoDetect setting of the cookieless attribute.
D. None of the above.
Answer» D. None of the above.
172.

If a user wants to create controls at runtime which event should be used to write code?

A. PreLoad
B. Load
C. Init
D. PreInit
Answer» E.
173.

HTTP messages are typically sent between the Web server and Web browser using which Port number?

A. 70
B. 80
C. 400
D. 410
Answer» C. 400
174.

How you can merge the results from two separate LINQ queries into a single result set.

A. Use the ToList method.
B. Use the DataContractJsonSerializer class.
C. Use the XElement class.
D. Use the Concat method.
Answer» E.
175.

How will you specifying the Cache Location?

A. You can use browser settings to specify where a page is cached.
B. You can use the Location attribute of the <%@ OutputCache %> directive to specify where a page is cached.
C. You can use the Location attribute in QueryString to specify where a page is cached.
D. None of the above.
Answer» C. You can use the Location attribute in QueryString to specify where a page is cached.
176.

How will you add a TextBox control at runtime on the form? Choose the correct one.

A. TextBox obj = new TextBox(); obj.ID = "txtUserName"; form1.Controls.Add(obj);
B. form1.Controls.Add(TextBox);
C. this.FindControl.add(TextBox);
D. None of the above.
Answer» B. form1.Controls.Add(TextBox);
177.

How to implement authentication via web.config?

A. Include the authentication element.
B. Include the authorization element.
C. Include the identity element.
D. Include the deny element.
Answer» C. Include the identity element.
178.

How many types of parameter supported by OutputCache?

A. VaryByParam
B. VaryByControl
C. VaryByHeader
D. VaryByCustom
E. All of the above
Answer» F.
179.

How many types of caching ASP.NET supports?

A. Page Output Caching
B. Partial Page Caching
C. Data Caching
D. DataSource Caching
E. All of the above.
Answer» F.
180.

How many types of Cache Dependencies are available in ASP.NET?

A. File based dependencies
B. Key-based dependencies
C. Time-based dependencies
D. All of the above
Answer» E.
181.

How many types of authentication ASP.NET supports?

A. Windows Authentication.
B. .NET Passport Authentication.
C. Forms Authentication.
D. All of the above.
Answer» E.
182.

How many 'ScriptManager' control can be added on a ASP.NET web page?

A. Only One
B. More than One
C. Only Two
D. None of the above.
Answer» B. More than One
183.

How many readers can simultaneously read data with ReaderWriterLock if there is no writer locks apply?

A. 9
B. 11
C. 13
D. No Limit
Answer» E.
184.

How do you execute multiple SQL statements using a DataReader?

A. Call the ExecuteReader method of a single Command object twice.
B. Set the Command.CommandText property to multiple SQL statements delimited by a semicolon.
C. Set the Command.CommandType property to multiple result sets.
D. None of the above.
Answer» C. Set the Command.CommandType property to multiple result sets.
185.

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

A. It is the .NET Framework data type in your application that the parameter represents.
B. It is the type of column or data in SQL Server that the command expects.
C. It is the type of column in a DataTablethat it represents.
D. It is any type defined in the SqlDbDataTypeenumeration.
Answer» C. It is the type of column in a DataTablethat it represents.
186.

How do you create a TextBox for retrieving a password from a user?

A. Set TextMode property of the TextBox control to Secret.
B. Set Mode property of the TextBox control to Password.
C. Set Text property of the TextBox control to Password.
D. Set TextMode property of the TextBox control to Password.
Answer» E.
187.

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

A. By setting the OLE DB Services connection string keyword to 0
B. By setting the OLE DB Services connection string keyword to -4
C. By setting the OLE DB Services connection string keyword to -1
D. By setting the OLE DB Services connection string keyword to -7
Answer» D. By setting the OLE DB Services connection string keyword to -7
188.

From the following which is not a valid state management object?

A. Querystate
B. Cookies
C. Application state
D. Hidden form fields
Answer» B. Cookies
189.

For locking the data with synchronization which class will be used?

A. Lock
B. Moniter
C. SyncLock
D. Deadlock
Answer» C. SyncLock
190.

For building new types at runtime which class can be used?

A. System
B. System.Object
C. System.NewClass
D. System.Reflection.Emit.
Answer» E.
191.

__________________ file apply settings to all ASP.NET applications

A. web.config
B. machine.config
C. global.asax file
D. application object
Answer» C. global.asax file
192.

Debug class is available in which namespace?

A. System.Debug
B. System.Data
C. System.Diagnostics
D. None of the above
Answer» D. None of the above
193.

CompareValidator control can be used for performing which task?

A. To perform a data type check.
B. To compare the value entered into a form field against a fixed value.
C. To compare the value of one form field against another.
D. All of the above.
Answer» E.
194.

Client-side validation is turned on by default. If you want that particular validation control should not validate at client side, what will you do?

A. Set the EnableClientScript property to false
B. Set the validate property to false
C. Set the EnableClientScript property to true
D. Set the Page.Isvalid property to false
Answer» B. Set the validate property to false
195.

Clicking a CheckBox does not cause an automatic PostBack. How do you make the CheckBox cause an automatic PostBack?

A. Set the AutoPostBack property to true.
B. Add JavaScript code to call the ForcePostBack method.
C. Set the PostBackAll property of the Web Page to true.
D. None of the above
Answer» B. Add JavaScript code to call the ForcePostBack method.
196.

Choose the correct option about Master Page and Theme.

A. A Master Page enables you to share content across multiple pages in a website and A Theme enables you to control the appearance of the content.
B. Theme enables you to share content across multiple pages in a website and A Master Page enables you to control the appearance of the content.
C. App_Themes folder contains skin files.
D. Option A and C are correct.
Answer» E.
197.

Choose the correct option about the Integrated Security property of connection object.

A. If Integrated Security=false then User ID, and Password must be specified in the connection string.
B. If Integrated Security=true then current Windows account credentials are used for authentication.
C. Both A and B option are correct.
D. None of the above.
Answer» D. None of the above.
198.

Choose the correct option about DataSet object.

A. Provides Disconnected mode
B. Can store multiple table simultaneously
C. Consumer Object
D. All of the above.
Answer» E.
199.

Choose the correct option about DataReader object.

A. DataReader object is a forward-only object.
B. It provides connection oriented environment.
C. DataReader is read only object.
D. All of the above
Answer» E.
200.

Choose the correct one

A. Variables introduced within a lambda expression are not visible in the outer method.
B. Variables introduced within a lambda expression are visible in the outer method.
C. The lambda should not contain the same number of parameters as the delegate type.
D. None of the above
Answer» B. Variables introduced within a lambda expression are visible in the outer method.