Your ASP.NET application enables users to input the URL of a Web page, and
then it applies an XSLT file to show how that Web page looks on a mobile device. Which
type of cotrol should you use to validate the TextBox control where the user inputs the
URL?
A -
RegularExpressionValidator RangeValidator
B -
CompareValidator RequiredFieldValidator
C -
RangeValidator RequiredFieldValidator
D -
RegularExpressionValidator RequiredFieldValidator
2-
Your Web application includes a Label control with an IS of lblCaption and a
TextBox control with an ID of txtData. The Text property of the Label control is set to Enter Data. Which two properties of the TextBox control should you set to ensure that it
can be accessed by the expected keyboard actions?
A -
TextMode, AccessKey
B -
TabIndex, AccessKey
C -
CssClass, AccessKey
D -
TabIndex, CssClass
3-
Your company has recently decided to upgrate its supplier evaluation system
from ASP to ASP.NET. You want to convert old ASP pages to Web forms as quickly as
possible. You have noticed that you can keep the existing user interface but want to move
the bussiness logic to code-behind files. Which of the following approaches provides the
smoothest migration path?
A -
Apply the runat="server" attribute to all HTML controls. In the code-behind files, rewrite all business logic using C#.
B -
Continue to use HTML controls on ASP.NET Web forms. In the code-behind files, rewrite all business logic using C#.
C -
Continue to use HTML controls for labels and text boxes but convert all Button controls to Web server controls. In the code-behind files, rewrite all bussiness logic using C#.
D -
Use ASP.NET Web server controls instead of HTML controls. In the code-behind files, rewrite all business logic using C#
4-
Your application includes a SqlDataAdapter object named sqlDataAdapter1 that
was created by dragging and dropping the Physicians table from a database to your from.
Your application also includes a DataSet object named dsPhysicians1 that is based on this
SqlDataAdapter object. Which line of code should you use to load the data from the
database into the DataSet object?
Your ASP.NET Web appliation includes a SqlDataAdapter object named
sqlDataAdapter1 that was created by dragging and dropping the Customers table from a
database to your form. Your application also includes a DataSet named dsCustomers1,
based on this SqlDataAdapter. Which line of code should you use to load the data from
the database into the DataSet?
A -
sqlDataAdapter1.Fill("dsCustomers1","Customers"):
B -
sqlDataAdapter1.Fill(dsCustomers1):
C -
dsCustomers1=sqlDataAdapter1.Fill("Customers"):
D -
sqlDataAdapter1.Fill("dsCustomers1,"Customers"):
6-
Your application uses a SqlDataReader object to retrieve information form a
medical records database. When you find a patient who is currently hospitalized, you
want to read the names of the patients carefivers from the same database. You have
created a second SqlDataReader object, based on a second SqlCommand object, to
retrieve the caregiver information. When you call the ExecuteReader() method of the
SqlCommand object, you get an error. What is the most likely cause of this error?
A -
You are using the same SqlConnection object for both the SqlDataReader objects, and the first SqlDataReader is still open when you try to execute the SqlCommand.
B -
You are using the ExecuteReader() method of the SqlCommand object and should be using the ExecuteScalar() mehtod instead.
C -
You must use the OleDbDataReader orbject to retrieve information instead of the SqlDataReader object.
D -
You must use SqlDataAdapter object to retrieve the caregiver information.
7-
Your application allows the user to edit product data on a DatGrid control,
which is bound to a DataSet object. The DataSet object is filled through a
SqlDataAdapter object. The InsertCommand, UpdateCommand, and DeleteCommand
properties of the SqlDataAdapter object are set to SqlCommand objects, and you have
tested the SQL in those SqlCommand objects.
When users submit the page, none of their changes are saved to the database, and they do
not receive any errors. What could be the problem?
A -
The DatSet object is a read-only object.
B -
The users do not have permission to write to the database.
C -
You have neglected to fill the DataSet object from the DatGrid control after the users finish editing the data.
D -
You have neglected to call the SqlDataAdapter.Update() mehtod in your code.
8-
Your application includes a DataSet object that contains a DataTable object
named Suppliers. This DatTable object contains all the rows from the Suppliers table in
your database. You want to bind an object to a DataGrid control on a form such that the
DataGrid control displays only the suppliers from Pennsylvania. What should you do?
A -
Use a foreach loop to move through the entire suppliers Data Table object. Each time you find a DataRow object representing a supplier from Pennsylvania, bind that DataRow object to the DatGrid control.
B -
Create a filterd DataView object from the suppliers DataTable object and bind the DataView object to the DataGrid control.
C -
Created a filtered array by calling the Data Table.Select() method on the suppliers Data Table object and bind the array to the DataGrid control.
D -
Create a new SqlCommand object to retrieve only suppliers from Pennsylvania. Use a new SqlDataAdapter object to fill a new DataSet object with these with these suppliers. Then bind the new DataSet object to the DataGrid control.
9-
Your application invokes a Web service named Northwind that includes a Web
method named GetOrders(). GetOrders() returns a DataSet object containing order
information. What must you do to use this DataSet object in your client application?
A -
Created a new DataSet object and use the ReadXml() method of DataSet to initialize it from returning SOAP message.
B -
Assign the return value from the GetOrders() method to an array of DataRow variables. Then loop through the array to build the DataSet object.
C -
Obtain an XSD file that specifies the schema of the DatSet object. Then use this XSD file to instantiate a DataSet object from the returned data from the GetOrders() method.
D -
Assign the return value from the GetOrders() method to a DataSet Variable.
10-
Your application uses a SqlDataReader object to retrieve information about
customer balances. When you find a past-due balance, you want to write a new entry to a
billing table by executing a stored procedure. Calling the ExecuteNonQuery( ) mehtod of
the SqlCommand object is causing an error.
What is the most likely cause of this error?
A -
You must use an ad hoc SQL statement rather than a stored procesure to insert new rows in a database.
B -
You are using the ExecuteNonQuery() method of the SqlCommand object, and you should be using the ExecuteScalar() method instead.
C -
You must use a SqlDataAdapter object to execute the stored procedure.
D -
You are using the same SqlConnection object for both the SqlDataReader object and the SqlCommand object, and the SqlDataReader object is still open when you try to execute the SqlCommand object.