Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

70-305 Dumps (Web Application)

Total Hit ( 2567)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


This is the gateway to 70-305 exam. 

B_F


1.

Do not memorize this Dump, Learn it and you will pass easy. Powered by Big_Foot!

Good Luck for the preparations.




1. You are a Web developer for your company. You create an ASP.NET application that accesses sales and marketing data. The data is stored in a Microsoft SQL Server 2000 database on a server named Prod01.

The company purchases a factory automation software application. The application is installed on Prod01, where it creates a second instance of SQL Server 2000 named Factory and a database named FactoryDB. You connect to FactoryDB by using Windows Integrated authentication.

You want to add a page to your ASP.NET application to display inventory data from FactoryDB. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on Prod01.

Which string should you use?


a. _Server=Prod01;Data Source=Factory;

Initial Catalog=FactoryDB;Integrated Security=SSPI_

b. _Server= Prod01;Data Source=Factory;

Database=FactoryDB;Integrated Security=SSP1_

c. _Data Source= Prod01\Factory;Initial Category=Factory;

Integrated Security=SSP1_

d. _Data Source= Prod01\Factory;Database=FactoryDB;

Integrated Security=SSP1_



Ans: D







2. You are creating an ASP.NET application that performs updates to a database. The application performs the updates by running a series of SQL statements. You write a procedure to run the SQL statements. The procedure accepts a connection string and an array of SQL statements as parameters.

You use structured exception handling in your procedure to handle any errors that occur while the statements are running. You want the procedure to terminate after handling an exception and to return to the SQL statement that caused the exception. You also want to ensure that the database connection is closed before the procedure terminates, whether or not an error occurs.

You begin writing the procedure by using the following code:


public static void ExecuteStatements(

string connectionString, string[. sql)

{

OleDbConnection cnn =

new OleDbConnection(connectionString);

OleDbCommand cmd = new OleDbCommand();


int i;

cmd.Connection = cnn;

cnn.Open();

try

{

for (i=0; i<= sql.Length - 1;i++)

{

cmd.CommandText = sql[i.;

cmd.ExecuteNonQuery();

}

}

Which code segment should you use to complete the procedure?

a. catch(OleDbException ex)

{

throw(ex);

}

finally

{

cnn.Close();

}

}

b. catch(OleDbException ex)

{

throw(new Exception(sql[i., ex));

}

finally

{

cnn.Close();

}

}

c. catch(OleDbException ex)

{

throw(ex);

}

}

cnn.Close();

d. catch(OleDbException ex)

{

throw(new Exception(sql[i., ex));

}

}

cnn.Close();


Ans: B







3. You ASP.NET application manages order entry data by using a DataSet object named orderEntry. The orderEntry object includes twp DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects.

You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated.

What is the most likely cause of the problem?

a. The current value of OrderDetails.KeyDeleteRule is Rule.Cacade.

b. The current value of OrderDetails.KeyDeleteRule is Rule.SetNull.

c. The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault.

d. The current value of OrderDetails.KeyDeleteRule is Rule.None.



Ans: D







4. You are creating an ASP.NET application to track sales orders. The application users an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders, and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order.

What should you do?

a. Add a DataRelation object to the Relations collection of the DataSet object.

b. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other.

c. Add a ForeignKeyConstraint to the OrderDetails table.

d. Add a keyref constraint to the OrderDetails table.



Ans: A



5. You create an ASP.NET application to display a sorted list of products in a DataGrid control. The product data is stored in a Microsoft SQL Server database. Each product is identified by a numerical value named ProductID, and each product has an alphabetic named ProductName. You write ADO.NET code that uses a SqlDataAdapter object and a SqlCommand object to retrieve the product data from the database by calling a stored procedure.

You set the CommandType property of the SqlCommand object to CommandType.StoredProcedure. You set the CommandText property of the object to procProductList. Your code successfully files a DataTable object with a list of products that is sorted by ProductID in descending order.

You want to data to be displayed in reverse alphabetic order by ProductName.


What should you do?

a. Change the CommandType property setting of the SqlCommand object to CommandType.Text.

Change the CommandText property setting of the SqlCommand object to the following:

SELECT * FROM procProductList ORDER BY ProductName DESC;

Bind the DataGrid control to the DataTable object.

b. Create a new DataView object based on the DataTable object.

Set the Sort Property of the DataView object to _ProductName DESC_.

Bind the DataGrid control to the DataView object.

c. Set the AllowSorting property of the DataGrid control to True.

Set the SortExpression property of the DataGridColumn that displays ProductName to

_ProductName DESC_.

Bind the DataGrid control to the DataTable object.

d. Set the DisplayExpression property of the DataTable object to _ORDER BY ProductName
DESC_.

Bind the DataGrid control to the DataTable object.



Ans: B


6. You create an ASP.NET application and deploy it on a test server. The application consists of a main page that links to 30 other pages containing ASP.NET code.

You want to accomplish the following goals:
" Enable tracing on all the pages in the application except the main page.
" Display trace output for up to 40 requests.
" Ensure that trace output is appended to the bottom of each of the pages that will contain trace output.

" Ensure that any configuration changes affect only this application.

You need to accomplish these goals with the minimum amount of development effort. Which three actions should you take? (Each Ans: presents part of the solution. Choose three)

a. Add the following element to the Web.config file:

<trace enabled=_true_ pageOutput=_True_/>

b. Add the following attribute to the Trace element of the application's Weconfig file:

requestLimit=40

c. Add the following attribute to the Trace element of the application's Machine.config file:

RequestLimit=40

d. Set the Trace attribute of the Page directive to true for each page except the main page.

e. Set the Trace attribute of the Page directive to false for the main pag

f. Set the TraceMode attribute of the Page directive to SortByTime for the main page.


Ans: A-B-E







7. You create an ASP.NET page to display a sorted list of products in a DataGrid control. The product data is stored in a Microsoft SQL Server database. Each product is identified by a numerical value named ProductID, and each product has an alphabetic named ProductName. You write ADO.NET code that uses a SqlDataAdapter object and a SqlCommand object to retrieve the product data from the database by calling a stored procedure.

You set the CommandType property of the SqlCommand object to CommandType.StoredProcedure. You set the CommandText property of the object to procProductList. Your code successfully fills a DataTable object with a list of products that is sorted by ProductID in descending order.

You want the data to be displayed in reverse alphabetic order by ProductName.

What should you do?

a. Change the CommandType property setting of the SqlCommand object to CommandType.Text.

Change the CommandText property setting of the SqlCommand object to the following:

SELECT * FROM procProductList ORDER BY ProductName DESC;

Bind the DataGrid control to the DataTable object.

b. Create a new DataView object based on the DataTable object.

Set the Sort Property of the DataView object to _ProductName DESC_.

Bind the DataGrid control of the DataView object.

c. Set the AllowSorting property of the DataGrid control to True.

Set the SortExpression property of the DataGridColumn that displays ProductName to

_ProductName DESC_.

Bind the DataGrid control to the DataTable object.

d. Set the DisplayExpression property of the DataTable object to _ORDER BY ProductName

DESC_.

Bind the DataGrid control to the DataTable object.


Ans: B




8.You are creating an ASP.NET application that uses the Microsoft SQL Server .NET Data Provider to connect to your company's database. Your database administrator reports that, due to heavy usage of the application, data requests are being blocked while users wait for new connections to be created.

You want to improve throughput by setting a minimum connection pool size of 10.


What should you do?

a. Add a connection element under an appSettings element in the Web.config file for your application,

and specify a minimum size of 10 for the connection pool.

b. Add a connection element under an appSettings element in the Machine.config file on your Web server,

and specify a minimum size of 10 for the connection pool.

c. Add a Min Pool Size property to the connection string you use when opening a connection, and specify
a minimum size of 10 for the connection pool.

d. Add a Min Pool Size property to your ADO.NET connection objects, and assign a value of 10 to the property.


Ans: C





9. You are creating an ASP.NET Web Form that displays employee data from a DataSet object. You want to fill the DataSet object and then you want to retrieve a reference to the employee whose primary key has the value of 1.

You write the following code. (Line numbers are included for reference only)



01 SqlConnection(ConnectionString);

02 conn.Open();

03 SqlCommand cmd = new SqlCommand (_SELECT * FROM Employees_, conn);

04 SqlDataAdapter da = new SqlDataAdapter(cmd);

05 DataSet ds = new DataSet();

06

07 da.Fill(ds, _Employees_);

08

09 DataRow dr;

10 dr = ds.Tables[_Employees_..Rows.Find(1);

11 nameLabel.Text = dr[_Name_..ToString();


When you run the code, you receive the following error message at line 10: _Table doesn't have a primary key._

You ensure that a primary key is defined on the Employees table in the database. You want to alleviate

the error to allow the code to run correctly. You also want to catch the exception that would occur if the

employee whose primary key has the value if 1 is deleted from the database.

Which two actions should you take? (Each Ans: presents part of the solution. Choose
two)

a. Add the following code at line 06:

dMissingSchemaAction = MissingSchemaAction.AddWithKey;

b. Add the following code at line 06:

da.MissingSchemaAction = MissingSchemaAction.Add;

c. Add the following code at line 06:

da.MissingSchemaAction = MissingSchemaAction.Ignore;

d. Add the following code at line 06:

da.MissingSchemaAction = MissingSchemaAction.Error;

e. Place line 07 in a structured exception handling block.

f. Place lines 10 and 11 in a structured exception handling block.



Ans: A-F




10. You are creating an ASP.NET application for your company. The company data is stored in a Microsoft SQL Server 6.5 database. Your application generates accounting summary reports based on transaction tables that contain million of rows.

You want your application to return each summary report as quickly as possible. You need to configure your application to connect to the database and retrieve the data in a away that achieves this goal.

What should you do?

a. Use a SqlConnection object to connect to the database, and use a SqlCommand object to run a stored

procedure that returns the dat

b. Use an OleDbConnection object to connect to the database, and use an OleDbCommand
object to run a stored procedure that returns the data.

c. Configure SQL Server to support HTTP access, and create an XML template to run
a stored procedure that returns the data in XML format.

d. Use COM interop to create an ADODB.Connection object, and use an ADODB.Command object
to run a SQL statement that returns the data.



Ans: B




11. You are creating an ASP.NET page to retrieve sales data from a Microsoft SQL Server database. You are writing a method named GetYTDSales to run a stored procedure in the SQL Server database. The stored procedure has one input parameter that is used to specify a product. The stored procedure returns to the year-to-date sales for that products.

You declare a numeric variable in the GetYTDSales method. You want to assign the return value of the stored procedure to the variable.

What should you do?

a. Create a SqlDataAdapter object and call its Fill method to run the stored procedure and assign the year-to-date sales value to your numeric variable.

b. Create a SqlDataAdapter object and call its Update method to run the stored procedure and assign the year-to-date sales value to your numeric variable.

c. Create a SqlCommand object and call its ExecuteScalar method to run the stored procedure and assigns the year-to-date sales value to your numeric variable.

d. Create a SqlCommand object and call its ExecuteReader method to run the stored procedure and assign the year-to-date sales value to your numeric variable.

Ans: C




12. You are developing an ASP.NET application for your company's intranet. Employees will use the application to administer their employee benefits. The benefits information is stored in a Microsoft SQL Server database named Benefits.

An employee can select benefits options from 10 different drop-down list boxes. The values for each list are stored in separate tables in the Benefits database. The values that are available for employees to choose can change once each year during the benefits enrollment period.

You want to minimize the number of times your application must access the Benefits database to obtain the values for the drop-down list box.

Which two courses of action should you take? (Each Ans: presents part of the solution. Choose two)

a. Create one stored procedure that returns the result for all 10 drop-down list boxes.

Create one DataTable object for each of the 10 drop-down list boxes.

Use a SqlDataReader object to populate 10 DataTable objects by calling the NextResult()

method.
Bind the drop-down list boxes to the DataTable objects.

b. Create a stored procedure that returns the result set for all 10 drop-down list boxes.

Bind the drop-down list boxes to the DataReader object.

c. Create one DataTable object for each of the 10 drop-down list boxes.

Create a stored procedure for each of the 10 tables.

Use a SqlDataReader object to populate the 10 DataTable objects.

Bind the drop-down list boxes to the DataTable objects.

d. Store the result sets for the 10 drop-down list boxes in a DataSet object.

Add the DataSet objects to the Cache object for the application.

e. Store the result sets for the 10 drop-down list bikes in a file on the user's computer by using the DataSet.WriteXml() method.



Ans: A-D




13. You are creating an ASP.NET page that displays a list of products. The product information is stored in a Microsoft SQL Server database. You use SqlConnection object to connect to the database.

Your SQL Server computer is named ServerA The database that contains the product information is named SalesDB. The table that contains the product information is named Products. To connect to SalesDB, you use a SQL Server user account named WebApp that has the password s1p2t9.

You need to set the ConnectionString property of the SqlConnection object.

Which string should you use?

a. _Provider=SQLOLEDB.1;File Name =_Data\MyFile.udl

b. _Provider=MSDASQL;Data Source=ServerA;

Initial Catalog=SalesDB;

User ID=WebApp;Password=s1p2t9_

c. _Data Source= ServerA;Initial Catalog=SalesDB;

User ID=WebApp;Password=s1p2t9_

d. _Data Source= ServerA;Database=SalesDB;

Initial File Name=Products;User ID=WebApp;Pwd=s1p2t9_

Ans: C




14. You are using ASP.NET and ADO.NET to create an accounting application for your company. You are writing code to run a set of stored procedures that perform posting operations in a database at the end of each month.

You use an OleDbConnection object to connect to the database. You use an OleDbCommand object to run the stored procedures.

If an error occurs during execution of any of the stored procedures, you want to roll back any data changes that were posted. You want the changes to be committed only of all of the posting operations succeed.

You write code to catch an OleDbException object if an error occurs during the execution of a stored procedure.

What else should you do?

a. Call the BeginTransaction method of the OleDbConnection object before running the stored procedure.
If an error occurs, use the OleDbConnection object to roll back the changes.

b. Call the BeginTransaction method of the OleDbConnection object before running the stored procedures.
If an error occurs, use the OleDbException object to roll back the changes.

c. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.
Assign the OleDbTransaction object to the Transaction property of your OleDbCommand object. If an error occurs, use the OleDbTransaction object to roll back the changes.

d. Use the BeginTransaction method of the OleDbConnection object to create an OleDbTransaction object.
Pass a reference to the OleDbTransaction object to each stored procedure. Use error handling inside the stored procedures to roll back the changes.



Ans: C




15. You are creating an ASP.NET application that uses role-based security to allow users to access only those pages that they are authorized to access. You use a Microsoft SQL Server database to manage the list of users and roles for the ASP.NET application. A table named Roles contains a column named RoleID and a column named RoleName. A table named Users contains a column named UserID, a column named UserName, and a column named Password.

A table named UserRoles contains a column named UserID and a column named RoleID. You need to create a stored procedure that returns all users who belong to a specific role. You write the following Transact-SQL code to define the stored procedure:

CREATE PROCEDURE GetRoleMembers

@RoleID int

AS

Which code segment should you use to complete the stored procedure?

a. SELECT UserRoles.UserID, Users.UserName

FROM Users

INNER JOIN

Roles UserRoles On UserRoles.RoleID = Users.UserID

WHERE UserRoles.RoleID = @RoleID

b. SELECT UserRoles.UserID, Users.UserName

FROM UserRoles

INNER JOIN

Roles On UserRoles.RoleID = Roles.RoleID, Users

WHERE UserRoles.RoleID = @RoleID

c. SELECT UserRoles.UserID, Users.UserName

FROM UserRoles

INNER JOIN

Users On Users.UserID = UserRoles.UserID

WHERE UserRoles.RoleID = @RoleID

d. SELECT Users.UserI Users.UserName

FROM Users, UserRoles

INNER JOIN

Roles On UserRoles.RoleID = Roles.RoleID

WHERE UserRoles.RoleID = @RoleID


Ans: C


16. You are a Web developer for your company. You create an ASP.NET application that accesses sales and marketing data. The data is stored in a Microsoft SQL Server 2000 database on a server named Server01.

The company purchases a factory automation software application. The application is installed on Server01, where it creates a second instance of SQL Server 2000 named Factory and a database named Factory DB. You connect to FactoryDB by using Windows Integrated authentication.

You want to add a page to your ASP.NET application to display inventory data from FactoryDB. You use a SqlConnection object to connect to the database. You need to create a connection string to connect to FactoryDB in the instance of SQL Served named Factory on Server01.

Which string should you use?

a. _Server= Server01;Data Source=Factory;

Initial Catalog=FactoryDB;Integrated Security=SSPI_

b. _Server= Server01;Data Source=Factory;

Database=FactoryDB;Integrated Security=SSPI_

c. _Data Source= Server01\Factory;Initial Catalog=Factory;

Integrated Security=SSPI_

d. _Data Source= Server01\Factory;Databse=FactoryDB;

Integrated Security=SSPI_



Ans: D




17. You are creating an ASP.NET page for the sales department at your company. The page enables users to access data for individual customers by selecting a customer's name. After a customer's name is selected, the page displays a list of that customer's unshipped orders and the total year-to-date (YTD) sales to that customer.

Your company's sales data is stored in a Microsoft SQL Server database. You write a stored procedure to return the data that you need to display on the ASP.NET page. The stored procedure returns a result set containing the list of unshipped orders, and it returns the YTD sales in a parameter named @YTD.

You write code that uses a SqlCommand object named cmd and a SqlDataReader object named reader to run the stored procedure and return the data. You bind reader to a DataGrid control on your page to display the list of unshipped orders.

You want to display the YTD sales in a Label control named ytdLabel.
Which code segment should you use?

a. reader.NextResult()

ytdLabel.Text = cmd.Parameters(_@YTD_).Value.ToString()

reader.Close()

b. reader.Close()

ytdLabel.Text = reader.NextResult().ToString()

c. reader.Close()

ytdLabel.Text = cmd.Parameters(_@YTD_).Value.ToString()

d. ytdLabel.Text =

cmParameters(_@RETURN_VALUE_).Value.ToString()

reader.Close()


Ans: C




18. You are creating an ASP.NET page that displays inventory figures for selected items. Your code creates ad hoc SQL queries and retrieves data from a Microsoft SQL Server database.

The identification number of an item is stored in a string variable named ItemID, and the SQL statement for your query is stored in a variable named SQL.

You use the following line of code to construct the SQL query:

SQL = _SELECT UnitsOnHand, UnitsOnOrder FROM Inventory_
+ _ WHERE ProductID = _ + ItemID;

The ProductID, UnitsOnHand, and UnitsOnOrder columns in the database are all of type int.

You use a SqlDataReader object named reader to retrieve the data.



You want to assign the UnitsOnHand quantity to a variable named OnHand,

Which line of code should you use?

a. OnHand = reader.GetInt16(0);

b. OnHand = reader.GetInt16(1);

c. OnHand = reader.GetInt32(0);

d. OnHand = reader.GetInt32(1);


Ans: C





19. You create an ASP.NET application that is deployed on your company's intranet. Sales representatives use this application to connect to a database while they are speaking to customers on the telephone. Your code is running under the security context of the user who requested the page.

The application requires each sales representative to supply a unique user name and password to access the application. These individual user names and passwords are included in the ConnectionString property settings that your code uses to connect to the database. All users have the same access rights to the database.

Sales representatives report that it takes a long time to access the database. You test the application and discover that a new connection is created each time a sales representative connects to the database.

You want to reuse connections in order to reduce the time it takes to access the database.

What should you do?

a. Modify the connection string to specify Windows Integrated authentication.

b. Modify the connection string to increase the connection timeout setting.

c. Modify the connection string so that is uses a single application user name and password for every connection to the database.

d. Modify the connection string so that is uses a login user named that is a member of the sysadmin fixed server role.



Ans: C





20. You are creating an ASP.NET page that contains a Label control named specialsLabel. A text file named Specials.txt contains a list of products. Specials.txt is located in the application directory. Each product name listed in Specials.txt is followed by a carriage return.

You need to display a list if featured products in specialsLabel. You need to retrieve the list of products from Specials.txt.

Which code segment should you use?

a. Dim reader As System.IO.StremReader =_

System.IO.File.OpenText(_

Server.MapPath(_Specials.txt_))

Dim input As String

input = reader.BaseStream.ToString()

While Not input Is Nothing

specialsLabel.Text =_

String.Format(_{0}
{1} _,_

specialsLabel.Text, input)

input = reader.BaseStream.ToString()

End While

reader.Close()
b. Dim reader As System.IO.StreamReader =_

System.IO.File.OpenText(_

Server.MapPath(_Specials.txt_))

Dim input As String

input = reader.ReadLine()

While Not input Is Nothing

specialsLabel.Text =_

String.Format(_{0}
{1} _,_

specialsLabel.Text, input)

input = reader.ReadLine()

End While

reader.Close()

c. Dim strm As System.IO.Stream =_

System.IO.File.OpenRead(_

Server.MapPath(_Specials.txt_))

Dim b As Byte()

Dim input As String

input = strm.Read(b, 0, s.Length).ToString()

specialsLabel.Text = input

strm.Close()

d. Dim strm As System.IO.FileStream =_

System.IO.File.OpenRead(_

Server.MapPath(_Specials.txt_))

Dim input As String

input = strm.ToString()

specialsLabel.Text = input

strm.Close()


Ans: B




21. You are creating an ASP.NET application for Margie's Travel. Margie's Travel uses a Microsoft SQL Server 2000 database to store information about vacation packages. Your application will allow a user to request information about vacation packages for a specific destination.

You want to display this data to the user in a DataGrid. You want the data to be displayed in read-only form. The user's travel destination is contained in a form level string variable named destinationCode. In your Page.Load event handler, you create a SqlConnection object named sqlConnection1, initialize it, and call its Open() method. When your code runs the query, you want the data to be returned as quickly as possible.

You define the following local variable to hold the destination code:
string dest = destinationCode;

What should you do?

a. Create a stored procedure named GetDestinations and then use the following code to retrieve data:

SqlCommand cmd =

new SqlCommand(_GetDestinations_, sqlConnection1);

cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parm =

new SqlParameter(_@DestinationCode_, dest);

cmd.Parameters.Add(parm);

SqlDataReader sqlDataReader1 = cmd.ExecuteReader();

b. Create a stored procedure named GetDestinations and then use the following code to retrieve the data:

string qry =

_EXEC GetDestinations WHERE DestID = _+ dest + __;

SqlDataAdapter da =

new SqlDataAdapter(qry, sqlConnection1);

DataSet ds = new DataSet();

da.Fill(ds);

c. Use the following code to retrieve the data:

string qry =

_SELECT * FROM Destinations WHERE DestID =

__ + dest + __;

SqlCommand cmd = new SqlCommand(qry,

sqlConnection1);

cmd.CommandType = CommandType.Text;

SqlDataReader sqlDataReader1 = cmd.ExecuteReader();

d. Use the following code to retrieve the data:

string qry =

_SELECT * FROM Products WHERE DestID = @DestID_; SqlCommand cmd = new SqlCommand(qry, SqlConnection1);

cmCommandType = CommandType.Text;

SqlParameter = new SqlParameter(_@DestID_, dest);

cmParameters.Add(parm);

SqlDataReader sqlDataReader1 = cmExecuteReader();


Ans: A




22. You create an ASP.NET application for your company. This application will display information about products that the company sells. The application uses a Microsoft SQL Server database.

You add two DropDownList controls to your .aspx page. One drop-down list box will display product information. The control for this drop-down list box is named Products. The other drop-down list box will display category information. The control for this drop-down list box is named Category. You have an open SqlConnection object named con.

The Page.Load event handler uses the following code segment to populate the drop-down list by binding the SqlDataReader.

(Line numbers included for reference only.)

01 Dim cmd1 as New SqlCommand(_SELECT * FROM __

& _Products_,con

02 Dim dr1 as SqlDataReader

03 dr1 = cmd1.ExecuteReader()

04 Products.DataTextField = _ProductName_

05 Products.DataValueField = _ProductID_

06 Products.DataSource = dr1

07 Products.DataBind()

08 Dim dr2 as SqlDataReader

09 cmd1.CommandText = _SELECT * FROM Category_

10 dr2 = cmd1.ExecuteReader()

11 Category.DataTextField = _CategoryName_

12 Category.DataValueField = _Category ID_

13 Category.DataSource = dr2

14 Category.DataBind()

During testing, the page raises an invalid operation exception. You need to ensure that the page displays correctly without raising an exception.

What should you do?

a. Replace the code for line 03 of the code segment with the following code:

dr1.ExecuteReader(CommandBehavior.CloseConnection)

b. Add the following code between line 07 and line 08 of the code segment:

drl.Close()

c. Replace the code for line 09 and line 10 of the code segment with the following code:

Dim cmd2 as New SqlCommand_SELECT * FROM Category_,con)
dr2 = cmd2.ExecuteReader()

d. Remove the code for line 07 of the code segment.

Replace the code for line 14 of the code segment with the following code:
Page.DataBind()



Ans: B





23. You are creating an ASP.NET page that presents data to users in an updatable DataGrid control. Users update data in the grid. Your code uses the System.Data namespace and the System.Data.OleDb namespace.

Data changes are saved in an ADO.NET DataTable object. You want a user's changes to be saved to a database when the user finishes making changes. You write the following procedure to accomplish this task:

public static void UpdateData)

string sql, string connectionString, DataTable dataTable)

{

OleDbDataAdapter da = new OleDbDataAdapter();

OleDbConnection cnn =

new OleDbConnection(connectionString);

dataTable.AcceptChanges();

da.UpdateCommand.CommandText = sql;

da.UpdateCommand.Connection = cnn;

da.Update(dataTable);

da.Dispose();

}


This code runs to completion, but no data changes appear in the database. You test the update query and the connection string that you are passing to the procedure, and they both work correctly.

You need to alter the code to ensure that data changes appear in the database.

What should you do?

a. Add the following two lines of code before calling the Update method:

OleDbCommandBuilder cb = new OleDbCommandBuilder(da);

cb.GetUpdateCommand();

b. Add the following line of code before calling the Update method:

da.UpdateCommand.Connection.Open();

c. Delete this line of code:

dataTable.AcceptChanges();

d. Delete this line of code:

da.Dispose();



Ans: C





24. You are creating an ASP.NET application for an online payment service. The service allows users to pay their bills electronically by using a credit card.

The application includes a payment page named Payment.aspx. This page contains a form for entering payee, payment amount, and credit card information. When a user needs to submit a new billing address to a payee, the page form allows the user to provide the new address information.

If the user indicates a change of address, the application needs to provide the information to the ProcessAddressChange.aspx page for processing as soon as the user submits the payment page information. The ProcessAddressChange.aspx page processes the request for a change of address but does not provide any display information for the user.

When the requested processing is complete. Payment.aspx displays status results to the user. You need to add a line of code to Payment.aspx to perform the functionality in ProcessAddressChange.aspx.

Which line of code should you use?


a. Response.Redirect(_ProcessAddressChange.aspx_)

b. Response.WriteFile(_ProcessAddressChange.aspx_)

c. Server.Transfer(_ProcessAddressChange.aspx_,True)

d. Server.Execute(_ProcessAddressChange.aspx_)

 

Ans: D





25. You are creating an ASP.NET application for your company. Your code uses the System.Data namespace. The marketing managers at Your company use a page on your Web site to edit the prices of the company's products.

You retrieve product part numbers, named, and prices from a database. You store this information in a DataSet object named productInfo, and you display the data on the Web page. The marketing managers use your page to edit one or more prices, and you record these change in productInfo. The marketing managers click a Save button to save their changes.

You write code in the Click event handler for the Save button to save the edited prices to the database. You want to extract the edited rows in productInfo before performing the update.

You create a second DataSet object named productChanges to hold only edited product data.

Which line of code should you use to copy the edited rows from productInfo into productChanges?

a. productChanges =

productInfo.GetChanges(DataRowState.Detached);

b. productChanges =

productInfo.GetChanges();

c. productChanges.Merge(

productInfo, true);

d. productChanges.Merge(

productInfo, false);

Ans: B





26. You are creating an ASP.NET application to keep track of your company's employees. Employees will use the application to indicate whether they are currently in the office or out of the office.

The main page of the application is named ShowBoard.aspx. This page contains a Repeater control named employeeStatus that is bound to the results of a stored procedure in the backend database. The stored procedure provided all employee identification numbers (IDs), all employee names, and each employee's current status of either In if the employee is in the office or Out if the employee is out of the office.

The HTML code for employeeStatus is as follows:



<%# Container.DataItem(_EmployeeName_)%>
(<%# Container.DataItem(_Status_)%>)




The code-behind file for ShowBoard.aspx contains a private procedure named ChangeInOutStatus that toggles the status for an employee by using the employee's ID.

You need to add a button for each employee listed by employeeStatus. When an employee clicks the button, you want the button to call ChangeInOutStatus and pass the employee ID to toggle the status of the employee.

What are two possible ways to achieve this goal? (Each Ans: presents a complete solution. Choose two)

a. Add the following HTML code to the ItemTemplate element of employeeStatus:

<input type=_button_ id=_changeStatusButton_

alt=<%# Container.DataItem(_EmployeeID_)%>

OnClick=_changeStatusButton_ Runat=_server_

Value=_Change Status_/>

Add the following subroutine to the code-behind file for ShowBoard.aspx:

Public Sun changeStatusButton(_

ByVal sender As System.Object,_

ByVal e As System.EventArgs)

ChangeInOutStatus(CInt(sender.Attributes(_alt_)))

End Sub

b. Add the following HTML code to the ItemTemplate element of employeeStatus:

<input type=_button_ id=_changeStatusButton_

alt=<%# Container.DataItem(_EmployeeID_)%>

OnServerClick=_changeStatusButton_ Runat=_server_

Value=_Change Status_/>

Add the following subroutine to the code-behind file for ShowBoard.aspx:

Public Sub changeStatusButton(_

ByVal sender As System.Object,_

ByVal e As System.EventArgs)

ChangeInOutStatus(CInt(sender.Attributes(_alt_)))

End Sub

c. Add the following HTML code to the ItemTemplate element of employeeStatus:


Text=_Change Status_

CommandArgument=<%# Container.DataItem(_EmployeeID_)%>

/>

Add the following code to the ItemCommand event of employeeStatus:

If source.id = _changeStatusButton_ Then

ChangeInOutStatus(CInt(e.CommandSource.CommandArgument)))

End If

d. Add the following HTML code to the ItemTemplate element of employeeStatus:


Text=_Change Status_

CommandArgument=<%#Container.DataItem(_EmployeeID_)%>

/>

Add the following code to the ItemCommand event of employeeStatus:

If e.CommandSource.id = _changeStatusButton_ Then

ChangeInOutStatus(CInt(e.CommandArgument))

End If



Ans: B-D





27. You are creating an ASP.NET application for your company. Users will use the application to produce reports. The data for the application is stored in a Microsoft SQL Server 2000database.

You expect many users to use the application simultaneously. You want to optimize the response time when the users are retrieving data for the reports.

You create a procedure to retrieve the data from the database. You store a valid connection string in a variable named connString in the procedure.

You need to add code to the procedure to connect to the database.
Which code segment should you use?

a. Dim cnn As New OleDb.OleDbConnection(connString)

b. Dim cnn As New SqlClient.SqlConnection(connString)

c. Dim cnn As New ADODB.Connection()

d. Dim cnn As New SQLDMO.Database()



Ans: B




28. You are creating a Web site for Your company. You receive product lists in the form of XML documents. You are creating a procedure to extract information from these XML documents according to criteria that your users will select.

When a user makes a request, you want the results of these requests to be returned as quickly as possible.
What should you do?

a. Create an XmlDataDocument object and load it with the XML dat
Use the DataSet property of the object to create a DataSet object.
Use a SQL SELECT statement to extract the requested dat

b. Create an XmlDataDocument object and load it with the XML data.
Use the SelectNodes method of the object to extract the requested data.

c. Create an XPathDocument object and load it with the XML data.
Call the CreateNavigator method to create an XPathNavigator object.
Call the Select method of the XPathNavigator object to run an XPath query that extracts the requested data.

d. Create an XmlReader object. Use the Read method of the object to stream through the XML data and to apply an XPath expression to extract the requested data.


Ans: C





29. You are creating a DataGrid control named myGrid for a travel service. Each row in myGrid contains a travel reservation and an Edit command button. In each row, the fields that contain travel reservation information are read-only labels. You want all the fields to change to text boxes when a user clicks the Edit command button in the row.

You are writing the following event handler for the EditCommand event. (Line numbers are included for reference only.)
~1 Sub DoItemEdit(sender As Object, e As DataGridCommandEventArgs)_
Handles MyGrid.EditCommand
~2
~3 End Sub

Which code should you add at line 2 of the event handler?

a. myGrid.EditItemIndex = e.Item.ItemIndex

b. myGrid.DataKeyField = e.Item.AccessKey

c. myGrid.SelectedIndex = e.Item.ItemIndex

d. myGriCurrentPageIndex = e.Item.ItemIndex



Ans: A





30. You are creating an ASP.NET application for your company. An earlier version of the application uses ActiveX components that are written in Visual Basic 6.0. The new ASP.NET application will continue to use the ActiveX components.

You want the marshaling of data between your ASP.NET application and the ActiveX components to occur as quickly as possible.

Which two actions should you take? (Each Ans: presents part of the solution. Choose two)

a. Use ODBC binding.

b. Use late binding.

c. Set the AspCompat attribute of the Page directive to true.

d. Set the AspCompat attribute of the Page directive to false.



Ans: B-D




31. You are creating an e-commerce site for your company. Your site is distributed across multiple servers in a Web farm.

Users will be able to navigate through the pages of the site and select products for purchase. You want to use a DataSet object to save their selections. Users will be able to view their selections at any time by clicking a Shopping Cart link.

You want to ensure that each user's shopping cart DataSet object is saved between requests when the user is making purchases on the site.

What should you do?

a. Create a StateBag object. Use the StateBag object to store the DataSet object in the page's ViewState property.

b. Use the HttpSessionState object returned by the Session property of the page to store the DataSet object. Use the Weconfig file to configure an out-of-process session route.

c. Use the Cache object returned by the page's Cache property to store a DataSet object for each user. Use an HttpCachePolicy object to set a timeout period for the cached data.

d. Use the Session_Start event to create an Application variable of type DataSet for each session. Store the DataSet object in the Application variable.



Ans: B




32. You create an ASP.NET server control to display date and time information. You want to enable other programmers who use your control to customize the style properties of a Label control named timeLabel. The timeLabel control displays the date and time.

You create two custom property procedures to accomplish this goal. One procedure modifies the BackCoior property of the constituent controls. The other procedure modifies the ForeColor property of the constituent controls.

In addition to these two custom property procedures, you want to allow users to apply one of two predefined styles. The predefined styles are created in the following function:

Function GetStyle(styleType As Integer) As Style

Dim myStyle As Style = New Style()



Select Case styleType

Case 1

myStyle.ForeColor = System.Drawing.Color.White

myStyle.BackColor = System.Drawing.Color.Black



Case 2

myStyle.ForeColor = System.Drawing.Color.Black

myStyle.BackCoior = System.Drawing.Color.White

End Select

Return myStyle

End Function



You want to write a public method that will apply these styles. You do not want to overwrite the ForeColor property

and BackColor property of the Label control if these properties are already set by using the custom property procedures.

Which code should you use for this method?

a. Public Sub PickStyle(styleType As Integer)

Dim myStyle As Stile = GetStyle(styleType)

timeLabel.ApplyStyle(myStyle)

End Sub

b. Public Sub PickStyle(styleType As Integer)

Dim myStyle As Style = GetStyle(styleType)

timeLabel.MergeStyle(myStyle)

End Sub

c. Public Sub PickStyle(styleType As Integer)

Dim myStyle As Style = GetStyle(styleType)

timeLabel.ForceColor = myStyle.ForeColor

timeLabel.BackColor = myStyle.BackColor

End Sub

d. Public Sub PickStyle(styleType As Integer)

Dim myStyle As Style = GetStyle(styleType)

timeLabel.CssClass = myStyle.CssClass

End Sub



Ans: B





33. You create an ASP.NET application that produces sales reports. The sales data is stored in a Microsoft SQL Server database that is used for transaction processing. The application consists of complex Transact-SQL statements.

Many users report that the report generation is taking longer to run each day. You need to improve response times.

What are two possible ways to achieve this goal? (Each Ans: presents a complete solution. Choose two)


a. Use an OleDbDataAdapter indexes exist on the SQL Server tables.

b. Ensure that appropriate indexes exist in the SQL Server tables.

c. Rewrite your SQL statements to use aliases for all table names.

d. Rewrite your direct SQL statements as stored procedures and call the stored procedures from your application.

e. Configure queries to run in the security context of the user who is running the query.


Ans: B-D




34. You are creating an ASP.NET application for Coho Vineyard & Winery. The application will be used to identify potential customers.

Your application will call an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine. You want to merge this DataSet object into a DataSet object containing a list of companies that are potential customers.

You specify wideWorld as the name of the DataSet object form Wide World Importers, and you specify customerProspects as the name of the DataSet object containing potential customers. After the merge, customerProspects will include the company names in wideWorld.

The two DataSet objects contain tables that have the same names and primary keys. The tables in the two DataSet objects contain columns that have the same names and data types. A table in wideWorld also contains additional columns that you do not want to add to customerProspects. If customerProspects included any tables containing rows with pending changes, you want to preserve the current values in those rows when the merge occurs. Which lime of code should you use to merge the wideWorld DataSet object into customerProspects DataSet object?

a. customerProspects.Merge (wideWorld, true, MissingSchemaAction.Ignore);

b. customerProspects.Merge (wideWorld, true, MissingSchemaAction.AddWithKey);

c. wideWorld.Merge (customerProspects, true, MissingSchemaAction.Ignore);

d. wideWorlMerge (customerProspects, true, MissingSchemaAction.Add);


Ans: A





35. You create an ASP.NET application to provide corporate news and information to your company's employees. The application is used by employees in New Zealand.

Default.aspx has a Web Form label control named currentDateLabel. The Page.Load event handler for Default.aspx included the following line of code:

currentDateLabel.Text = DateTime.Now.ToString(_D_)

You need to ensure that the data is displayed correctly for employees in New Zealand. What
should you do?

a. In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ.

b. In the Weconfig file for the application, set the uiCulture attribute of the globalization element to en-NZ.

c. In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8.

d. In Visual Studio .NET, save the Default.aspx page for both versions of the application by selecting Advanced Save Options from the File menu and selecting UTF-8.


Ans: A





36. You create a class named MyFormat that has two public properties. One of the properties is named Size, and the other property is named Color. You want to use the MyFormat class in custom server controls to expose format properties to container pages.

You add the following statements to a server control named MessageRepeater:

Private_formatter As MyFormat = New MyFormat()



Public ReadOnly Property Format As MyFormat

Get

Return_formatter

End Get

End Property



You create a container page named MessageContainer.aspx to test your custom control. You register the control as follows:

<%@ Register Tagprefix=_myctl_ Namespace=_MessageControls_

Assembly=_MessageControls_%>



You want to add an instance of the control to a test page so that the size property is set to 10 and the color property is set to red.

Which code should you use?

a. <myctl:MessageRepeater Format-Color=_red_

Format-Size=_10_/>

b. <myctl:MessageRepater Format-Color=_red_

Format-Size=_10_ runat=_server_/>

c. <myctl:MessageRepeater Color=_red_

Size=_10_ runat=_server_/>

d. <myctl:MessageRepeater Format=_color:red;size:10_/>

 

Ans: B





37. You are creating an ASP.NET application for Coho Vineyard & Winery. Your application will can an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine.

You need to make the XML Web service available to your application.
What should you do?

a. On the .NET tab of the Reference dialog box, select System.Web.Services.dll.

b. In the Web References dialog box, type the address of the XML Web service.

c. Add a using statement to your Global.asax.cs file, and specify the address of the XML Web service.

d. Write an event handler in the Global.asax.cs file to import the .wsdl and .disco files associated with the XML Web service.


Ans: B



38. You create an ASP.NET application to provide online order processing to customers. A page named ShippingInformation.aspx contains a Web Form with controls for collecting shipping location information. The Web Form contains the following elements:

" Four TextBox controls for entry of name, street address, city, and postal code.
" A DropDownList control that consists of the full name of 150 countries.
" A Button control named shipItButton.

The Click event handler for shipItButton is located in the code-behind file for ShippingInformation.aspx. None of the other controls on the Web Form define server-side event handlers.

The Click event handler for ShipItButton redirects the user to a page named ShippingConfirmation.aspx. The ShippingConfirmation.aspx page provides the confirmation status of the shipping request submission to the user.

Users who access the application by using dial-up connections report that ShippingInformation.aspx processes very slow after the user clicks the shipItButton. Users on high-bandwidth network connections do not report the same issue.

You need to decrease the delay experienced by the dial-up users. What should you do?

a. Add the following attribute to the Page directive for ShippingInformation.aspx: EnableViewState=_False_

b. Add the following attribute to the Page directive for ShippingInformation.aspx: SmartNavigation=_True_

c. Add the following attribute to the OutputCache directive for ShippingInformation.aspx: Location=_server_

d. Add the following attribute to the OutputCache directive for ShippingInformation.aspx. Location=_client_



Ans: A





39. You create a Web custom control named Toggle that users can turn on and off. The Toggle control includes a Button control named toggleButton. You write an event handler named toggleButton_Click for the toggleButton.Click event. This event adjusts the BorderStyle property to signify whether the Button is toggled on or off.

You want to add code to the Toggle class so that when toggleButton is clicked, pages that contain instances of Toggle can process custom event handling code. You add the following code to the Toggle class:

Public Event ChangedValue(sender As Object, e As EventArgs)

Protected OnChangedValue(e As EventArgs)

RaiseEvent ChangedValue(Me, e As EventArgs)

End Sub



You need to add code to toggleButton_Click so that pages that contain instances of Toggle can handle the ChangedValue event and process custom event handling code. Which code should you use?

a. AddHandler sender.click, AddressOfChangedValue

a. AddHandler sender.Click, AddressOfOnChangedValue

a. OnChangedValue(EventArgs.Empty)

a. ChangedValue(Me, EventArgs.Empty)



Ans: C





40. You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control

named requestDate. The date must be no earlier than two business days after the order date, and no later

that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties

window, you set the ControlToValidate property to requestDate.

You need to ensure that the date entered in the requestDate TextBox control falls within the acceptable range of values. In addition, you need to minimize the number of round trips to the server.

What should you do?

a. Set the AutoPostBack property of requestDate to False.

Write code in the ServerValidate event handler to validate the date.

b. Set the AutoPostBack property of requestDate to True.

Write code in the ServerValidate event handler to validate the date.

c. Set the AutoPostBack property of requestDate to False.

Set the ClientValidationFunction property to the name of a script function contained in the

HTML page that is sent to the browser.

d. Set the AutoPostBack property of requestDate to True.

Set the ClientValidationFunction property to the name of a script function contained in the

HTML page that is sent to the browser.



Ans: C





41. You are a member of a team of developers creating several ASP.NET applications for your company. You want to create a reusable toolbar that will be used in each of the applications.

The toolbar will be displayed at the top of each page viewed by the user. The contents of the toolbar will vary depending on options each user selects when creating a profile.

You want to be able to add the toolbar to the ASP.NET toolbox for each of the developers on your team.

What should you do?

a. Create a new Web Control Library project.

Create the toolbar within a Web custom control.

b. Add a new Web user control to your ASP.NET project.

Create the toolbar within the Web user control.

c. Add a new Web Form to your ASP.NET project.

Design the toolbar within the Web Form and save the Web Form with an .ascx extension.

d. Add a new component class to your ASP.NET project.

Design the toolbar within the designer of the component class.



Ans: A





42. You are creating an ASP.NET page for selling movie tickets. Users select a region, and then they select from a list of cities in that region. The site displays the names and locations of movie theaters in the city selected by the user.

Your company maintains a list of theaters in a database table that includes the city, name, and street address of each theater. You want to minimize the time required to retrieve and display the list of theater names after a user selects the region and city.

What should you do?

a. Modify the connection string to add the packet size property and set its values to 8192.

b. Add the following directive to the page:

OutputCache VaryByParam=_city_

c. Add the following directive to the page:

OutputCache VaryByControl=_region;city_

d. Modify the connection string to keep your database's connection pool as small as possible.



Ans: B




43. You create an ASP.NET page that uses images to identify areas where a user can click to initiate actions. The users of the application use Internet Explorer.

You want to provide a pop-up window when the user moves the mouse pointer over an image. You want the pop-up window to display text that identifies the action that will be taken if the user clicks the image.

What should you do?

a. For each image, set the AlternateText property to specify the text you want to display, and set the ToolTip property to True.

b. For each image, set the ToolTip property to specify the text you want to display.

c. In the onmouseover event handler for each image, add code that calls the RaiseBubbleEvent() method of the System.Web.UI.WebControls.Image class.

d. In the onmouseover event handler for each image, add code that calls the ToString() method of the System.Web.UI.WebControls.Image class.



Ans: B





44. You create an ASP.NET page named Subscribe.aspx for users to subscribe to e-mail lists. You include an existing user control named ListSubscribe in your page. ListSubscribe has two constituent controls. One control is a TextBox control named listNameText, and the other control is Button control named subscribeButton. ListSubscribe is defined in the ListSubscribe.ascx file.

To add ListSubscribe to Subscribe.aspx, you add the following tag:

<email:ListSubscribe id=_ctlSubscribe_ runat=_server_/>

You add a Label control named ListNameLabel to the container page. When a user subscribes to a list by entering a list name in listNameText and clicking the subscribeButton button, you want the page to display the list name in ListNameLabel.

Which two actions should you take? (Each Ans: presents part of the solution. Choose two)

a. Add the following statement to the declaration section of ListSubscribe.aspx:

Public listNameText As TextBox

B. Add the following statement to the declaration section of Subscribe.aspx:

Public listNameText As TextBox

C. Add the following statement to the Page.Load event handler for Subscribe.aspx:

If Not Page.IsPostBack Then

listNameLabel.Text = ctlSubscribe.listNameText.Text

End If

D. Add the following statement to the Page.Load event handler for Subscribe.aspx:

If Page.IsPostBack Then

listNameLabel.Text = ctlSubscribe.listNameText.Text

End If

E. Add the following statement to the PagLoad event handler for ListSubscribascx:

If Not PagIsPostBack Then

listNameLabel.Text = listNameText.Text

End If

F. Add the following statement to the Page.Load event handler for ListSubscribe.ascx:

If Page.IsPostBack Then

listNameLabel.Text = listNameText.Text

End If



Ans: A-D




45. You are maintaining an ASP.NET application named SalesForecast. The application is written in Visual Basic .NET. The application includes a page named FirstQuarter.aspx that resides within the Sales namespace. The page class is named FirstQuarter. You discover that another developer inadvertently deleted the Page directive for FirstQuarter.aspx. You want to create a new Page directive to allow FirstQuarter.aspx to work properly.

Which directive should you use?

a. <%@ Page Language=_vb_

Codebehind=_FirstQuarter.aspx.vb_

Inherits=_FirstQuarter_%>

b. <%@ Page Language=_vb_

Codebehind=_FirstQuarter.aspx.vb_

ClassName=_Sales.FirstQuarter_%>

c. <%@ Page Language=_vb_

Codebehind=_FirstQuarter.aspx.vb_

Inherits=_Sales.FirstQuarter_%>

d. <%@ Page Language=_vb_

Codebehind=_FirstQuarter.aspx.vb_

ClassName=_Sales.FirstQuarter_

Inherits=_FirstQuarter_%>



Ans: C





46. You create an ASP.NET application named MYProject. You write code to specify the namespace structure of MYProject by including all class declarations within a namespace named MYNamespace.

You want to compile MYProject so that the fully qualifies namespace of each class is MYNamespace. You want to prevent the fully qualifies namespace of each class from being MYProject.MYNamespace.

You need to make changes in the Common Properties folder of the Property Pages dialog box for MyProject.

What should you do?

a. Change the value of the AssemblyName property to MYNamespace.

b. Clear the value of the AssemblyName property and leave it blank.

c. Change the value of the RootNamespace property to MYNamespace.

d. Clear the value of the RootNamespace property and leave it blank.


Ans: D




47. You are creating an ASP.NET page that enables users to select a country and view information on tourist attractions in that country. Users select a country from a list box named countryList.

The list box displays country names. The list box also contains hidden country codes. You code retrieves a cached DataTable object that contains tourist attraction s and numeric country code named CountryID. The DataTable object is named attractionsTable. You want to extract an array of DataRow objects from the DataTable object. You want to include tourist attractions for only the selected country.

Which code segment should you use?

a. DataRow[. result = attractionsTable.Select(

_CountryID = _+ countryList.SelectedItem.Text);

b. DataRow[. result = attractionsTable.Select(

_CountryID = _+ countryList.SelectedItem.Value);

c. DataRow result =

attractionsTable.Rows.Find(

_CountryID = _+ countryList.SelectedItem.Value);

d. DataRow result =

attractionsTable.Rows.Find(

countryList.SelectedItem.Value);



Ans: B




48. You are creating an ASP.NET application that will be used by companies to quickly create information portals customized to their business. Your application stored commonly used text strings in application variables for use by the page in your application.

You need your application to initialize these text strings only when the first user accesses the application. What should you do?


a. Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.

b. Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text strings.

c. Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.

d. Include code in the Page.Load event handler for the default application page that sets the values if the text strings when the IsPostback property of the Page object is False.

e. Include code in the PagLoad event handler for the default application page that sets the values of the text strings when the IsNewSession property of the Session object is set to tru



Ans: A




4. You create a user control named Address that is defined in a file named Address.ascx. Address displays
address fields in an HTML table.

Some container pages might contain more than one instance of the Address user control. For example, a page
might contain a shipping address and a billing address. You add a public property named Caption to the
Address user control. The caption property will be used to distinguish the different instances.

You want the caption to be displayed in the first  element of the table of address fields. You
need to add code to the  element of the table to display the caption.

Which code should you use?


a. <td><%=Caption%>
b. <td>
c. <td>


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.