ADO.Net/ADO.Net Multiple Choice Questions Sample Test,Sample questions

Question:
 How can you load an XML file directly into a DataSet

1.By setting the XML property of the DataSet class

2.By using the GetXML(. method of the DataSet class

3.By using the ReadXml(. method of the DataSet class

4.You cannot load an XML file directly into a DataSet


Question:
 If the XML data instance conforms to the DTD, the document is said to be:

1.type-invalid.

2.type-valid.

3.not-type-valid.

4.an HTML document.


Question:
 Is there a way to prevent configuration settings in a Web. Config file from being overridden by aWeb.Config file located below it

1. Yes, you can use the allowOverride attribute in the tag to prevent configuration settings in a Web. Config file from being overridden by a Web.Config file located below it

2.Yes, you can use the tag to prevent configuration settings in aWeb.Config file from being overridden by a Web.Config file located below it

3.If a Web. Config file exist at a particular level then all settings in the Web. Config file located above it are always ignored

4.You cannot have more than one Web. Config file in an ASP.NET application


Question:
 The DTD begins with the word:

1.#PCDATA.

2.XML.

3.DOCTYPE.

4.HTTPS


Question:
 What method of the Command object would you use if you need to retrieve a single value (for example an aggregate value. from a database

1.ExecuteScalar(.

2.ExecuteReader(.

3.ExecuteSingle(.

4.ExecuteNonQuery(.


Question:
 Which of the following statements is not true about XML Schemas:

1.They are used to define the content and structure of data.

2.They define a set of symbols and the relationships of those symbols.

3.They are themselves XML documents.

4.They have their own syntax.


Question:
 You require to create an ASP.NET page with the functionality to allow a user to upload a file to the server

1.You need to use the System.Web.Upload namespace

2. You need to use a COM component to save the file on the server

3.You need to use the SaveAs method of the HttpPostedFile class

4.The ASP.Net application automatically loops through all the and saves the uploaded files to a virtual folder called “uploads”


Question:
 Your site has been restructured and the paths of few pages have changed. Which method would you use to redirect users requesting for a pages using the old URL

1.Create an ISAPI filter to do the above task

2.Create an entry in the section of the Web. Config file

3.Use the Application. Config file

4.Handle the Application_BeginRequest event and use the RewritePath(. method


Question:
ADO.NET provides the ability to create and process in-memory databases called:

1.views

2.relations

3.tables

4.datasets


Question:
An XML component that defines the structure of a document is known as a(n.:

1. DOCTYPE.

2.DTD.

3.#PCDATA

4.HTML Stylesheet.


Question:
Can you use a DataView to filter rows in a DataTable

1.Yes, by setting the Filter property of the DataView

2.Yes, by setting the RowFilter property of the DataView

3.Yes, by using the SetFilter(. method of the DataView

4. No, a DataView cannot be used to filter rows in a DataTable


Question:
How do view states work

1.Using Cookies

2.Using a hidden form field

3.Using Session variables

4.Using Application variables


Question:
How is a ASP.NET presentation page associated with its code-behind

1.The presentation page includes the code-behind file using #include

2.The presentation page includes the code-behind file using

3.The presentation page inherits from the code-behind

4.The ASP.NET presentation page and the code-behind page have the same name and hence are automatically associated with each other


Question:
HTML is an application of a more robust document markup language called:

1.XHTML.

2.XML.

3.SGML.

4.None of the above is correct.


Question:
If a form is posted to a different page, the you can retrieve the values of the form elements by

1.Using the properties of the ASP.Net controls

2.Using the GetElementByID(. method

3.Using Request.Params

4.The values cannot be retrieved


Question:
If an XML document does not have a DTD, then by definition it is:

1.not-type-valid.

2.type-valid.

3.an HTML document.

4.None of the above is correct.


Question:
If you have an ASP.NET application with cookieless sessions enabled, which statement among the

1.You cannot use relative URL’s with cookieless sessions

2.You cannot use absolute URL’s with cookieless sessions

3.Cookieless sessions have no relation with the URL’s D. You cannot have cookieless sessions with an ASP.NET application

4.You cannot have cookieless sessions with an ASP.NET application


Question:
In an ASP.NET page, which is the best way to find if the contents of a TextBox has changed after the form containing the TextBox has been posted back to the server

1.By comparing the old value with the new value

2.By checking the NewValue property of the TextBox control

3.By handling the TextBox control’s TextChanged event

4.By checking the HasChanged property of the TextBox


Question:
The document that is used by XSLT to indicate how to transform the elements of the XML document to another format is a(n.:

1.HTML page.

2.DOCTYPE procedure.

3.stylesheet

4.stored procedure.


Question:
The expression FOR XML RAW tells SQL Server to:

1.place the values of the columns as attributes in the resulting XML document.

2.place the values of the columns into elements rather than attributes.

3.place some columns into elements and others into attributes.

4.None of the above is correct.


Question:
The most popular way to materialize XML documents is to use:

1.DTD

2.XSLT

3.HTML

4.SOAP


Question:
The Products table has a column named ProductName and a primary key column namedProductID. When a user selects an item in the DataList, you want to retrieve the value of theProductID column associated with it.

1.In the DataList control set PrimaryKeyField=” ProductID”

2. In the DataList control set DataKeyField=” ProductID”

3. In the DataList control set KeyField=” ProductID”

4.In the DataList control set id=” ProductID”


Question:
The settings in the Web. Config file can be configured to apply to

1.An application

2.An application or a particular directory

3.An application or a particular directory or even an individual file

4.The Web. Config file always applies to all pages in the current directory and its subdirectories


Question:
The XSLT processor copies the elements of the stylesheet until it finds a command in the format:

1.SELECT … FROM … WHERE.

2. {item, action}

3. {for-each select}.

4.none.


Question:
To eliminate definition duplication, XML Schemas define:

1.an intersection table.

2.global elements

3.a normalized definition table

4.None of the above is correct.


Question:
Using Which Datasource Control Can Access Oracle DataBase ?

1.xmlDatasource

2.sqlDataSource

3.ObjectDatasource

4.All of the above


Question:
What is not true about SOAP?

1.SOAP originally meant a Simple Object Access Protocol.

2.SOAP was defined as an XML-based standard for providing remote procedure calls over the Internet.

3.SOAP now is just a name, not an acronym

4.SOAP was an early form of XML.


Question:
What is not true about XML?

1.Web page display is the most important application of XML.

2.With XML, there is a clear separation between document structure, content and materialization.

3.XML is more powerful than HTML.

4.XML documents have two sections.


Question:
What is the default value for the Method attribute in an ASP.NET server-side Form control

1.GET

2.POST

3.SOAP

4.SMTP


Question:
What standard, protocol or language was generalized to become a standard protocol for sending messages of any type, using any protocol?

1.SOAP

2.SGML

3.SQL

4.ADO


Question:
What will be the values assigned to the two Label controls lblMessage1 & lblMessage2 respectively

1.2 & 3

2.3 & 3

3. 3 & 4

4.4 & 4


Question:
Which are the two things you need to take care of in your ASP.Net application to take advantage of connection pooling 

1.You need to set the Pooling property of the Connection object to True

2.You need to use the same exact connection string whenever you open a database connection

3.You need to call the ReleaseToPool(. method after the connection is closed

4.none


Question:
Which namespace would you use if you need to create an ASP.NET application with Microsoft SQL Server 2000 as the database.

1.System.Data.SQLServer

2.System.Data.SQLClient

3.System.Data.OleDb

4.System.Data.Microsoft


Question:
Which namespace would you use if you need to create an ASP.NET application with Oracle as the database.

1.System.Data.SQLServer

2.System.Data.SQLClient

3.System.Data.OleDb

4.System.Data.NonMS


Question:
Which property allows ASP.NET controls to maintain their values when a page is posted to itself.

1.EnableViewState

2.maintain value

3.SaveValue

4.AutoPostBack


Question:
Which statement about the Web. Config file is the most accurate

1.The Web. Config file can be only placed in the root of a Web Site to override settings in theMachine.Config file for all applications in a particular Web Site

2.The Web. Config file can only be placed in the root of a particular virtual directory

3.The Web. Config file can be placed in the root of the Web Site and the root of a virtual directory. The settings from the file in the virtual directory overrides the settings from the file in the Web

4.The Web. Config file can be placed in the root of the Web Site and the root of a virtual directory and in any subdirectory of an application. The settings from a file at a particular level override th


Question:
Which statement among the following is correct while opening a connection using theSQLConnection class

1.You cannot specify a connection string

2.You need to specify a Provider parameter for the connection string

3.You need to use a System DSN

4.You cannot use a DSN


Question:
Which statement among the ones below is correct

1.The Params and Forms collection of the HTTPRequest class are exactly the same and the theForms collection has been provided only for backward compatibility

2.The HTTPRequest class does include the Params collection

3.The HTTPRequest class does include the Forms collection

4.The difference between the Params and Forms collection of the HTTPRequest class is that the Params collection also represents QueryStrings, ServerVariables, and cookies


Question:
Which statement among the ones below is correct

1. If you use the server-side version of the tag, you cannot post the form to a different page.

2.You can modify the Action attribute of the server-side version of the tag to post the form to a different page

3.You have to set the Method and Action attributes of the server-side version of the tag to post the form to a different paged

4.You can use the SetAction(. method of the server-side version of the tag to post the form to a different page


Question:
Which statement is an accurate description of the code below (dtsDataset is a DataSet.
Cache(“myCachedDataSet”. = dstDataset

1.Adds a DataSet to the application’s cache in the server’s memory, automatically preserving it between page requests.

2. Adds a DataSet to the cache in the client’s memory, automatically preserving it between page requests.

3.The Cache object cannot be used to cache a DataSet, it can only cache a DataTable

4. The code block is syntactically incorrect and should actually be Set Cache(“myCachedDataSet”. = dstDataset


Question:
With XML:

1.views are not limited to one multi-valued path only.

2.documents can automatically be generated from database data only.

3. database data can automatically be extracted from XML documents only.

4.With XML, all of the above are true.


Question:
XML Schemas consist of:

1.properties and methods.

2.elements and attributes.

3.structure and data.

4.tables and relationships.


Question:
XSLT processors evaluate each statement in the context of the match that has been made. That is, XSLT processors are:

1.context oriented.

2.procedural oriented.

3.object oriented.

4. relational oriented.


Question:
You are part of a team that is using Visual Studio .NET to develop a Web application. You have placed a number of configuration settings for the application in the server’s Machine.config file. You learn in a meeting that one of your co-workers has created a Web.config file to store these settings, though in comparing notes you realize that you and your co-worker have used different settings.
Which of the following describes what will happen when you execute the application

1.The application will run correctly and will use the settings in the Web.config file, ignoring theMachine.config settings

2.The application will run correctly and will use the settings in the Machine.config file, ignoring the Web.config settings

3.The application will not run correctly until you either remove the Web.config file or delete the settings from the Machine.config file

4.The application will run correctly, using only the settings that are identical in the Web. configand Machine.config files


Question:
You are performing Form validations with Validation controls. You need to group all the errors at the top of the page and also show error messages besides each element. The messages besides each element need to be detailed and hence different from the messages at top of the page

1.You can use the ValidationSummary Control to summarize the messages set in theErrorMessage property of the Validation controls. The messages set in the Text property of the Validation controls can be displayed besides each element.

2.The error messages set in the SummaryText property of each Validation control havingisSummary=true will be automatically grouped at the top of the page and the messages set in the Text property can be

3. The error messages in the Validation control can only be displayed in a popup

4.The Validation controls cannot be used in the given scenario


Question:
You are preparing to deploy an ASP.NET Web application. You are currently creating the deployment project. You have started the Web setup project, which is namedAccountManagerDeploy, and added the application output to the project, and now you need to set the directory on the Web server to which the application will be installed. Which of the following procedures should you use to do so (Choose two. Each correct answer presents part of the solution..

1.Set the VirtualDirectory property in the Properties window.

2.Select the Web Application Folder in the File System Editor.

3.Select the AccountManagerDeploy project in the Solution Explorer.

4.Both (A) and (B)


Question:
You are using Visual Studio .NET to develop a Web application. You are beginning to debug your application, and you would like to store debug messages in the Windows event log as you proceed with testing. Which of the following will allow you to do so

1.TextWriterTraceListener

2.DefaultTraceListener

3.EventLogTraceListener

4.TraceSwitch


Question:
You have a DataList control containing a LinkButton. What would you do to raise a theDeleteCommand event in the DataList by clicking on the LinkButton.

1.Set CommandName=” delete” in the LinkButton

2.Set the OnDelete property of the DataList to the ID of the LinkButton

3. A DataList control cannot raise an event in response to events raised by its child controls

4.A DataList control cannot contain child controls


Question:
You have created a ASP.Net page Transaction by using

1. If a transaction already exists, the page will execute within the context of the transaction. However, it will not create a new transaction

2.If a transaction already exists, the page will execute within the context of the transaction. If a transaction does not exist, it will create a new one

3.Creates a new transaction for each request

4.You cannot created a ASP.Net page Transaction by using


Question:
You need to customize the display format of the DataList control

1.Set the DisplayFormat property of the DataList control to Custom

2.Set the CustomFormat property of the DataList control to True

3.Item Template will allow you to format the appearance of each DataList item

4. The display format of the DataList control is predefined and cannot be customized


Question:
You need to develop a business component myComp.dll in .Net and use it in your ASP.NET page

1.You require to register the component using regsvr32.exe

2.You require to register the component using TlbExp.exe

3.You require to copy the component to the /bin directory in your applications root directory

4.You require to copy the component to the /bin directory in your applications root directory and register the component using regsvr32.exe


Question:
You need to dynamically add a TextBox control to a page and display it at specific location

1.Place a Label control at the required location in the page and add the control by manipulating the Text property of the Label control

2.Place a PlaceHolder control at the required location in the page. Use the Add method of theControls collection of the PlaceHolder control to dynamically add the required control

3. Build the HTML for the entire page in a String and insert the HTML code for required control in the required place

4.You cannot add a control to a page dynamically


Question:
You need to enable paging for a DataGrid control

1.You can use a DataReader

2.You can use a DataTable

3.You can use either the DataReader or DataTable

4.A DataGrid does not support paging


Question:
You need to programmatically add a user control without using the Register directive in your code

1.Use AddUserControl

2.Use cannot programmatically add a user control

3.Use UserControl.Add

4.Use LoadControl


Question:
You need to retrieve only schema information about the columns contained in a database table without retrieving data. Which of the following is the best way to retrieve it

1.Use the GetSchemaTable(. method of the DataReader in conjunction withCommandBehaviour.SchemaOnly

2.Use the SchemaOnly property of the Command class

3.Use the GetSchemaOnly(. method of the DataReader

4. You cannot retrieve only schema information without retrieving data


More MCQS

  1. ADO.Net Mcq Question Set 1
  2. ADO.Net Multiple Choice Questions
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!