一些70-315的试题

denal 2003-04-05 08:15:03
1. 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.

Answer(s) Rank (%) Rank (# votes) Answer Rationale
C 73% 8/11 Rationales
D 27% 3/11 Rationales
----------------------------------------------------

2. 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 Answer: 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.

Answer(s) Rank (%) Rank (# votes) Answer Rationale
A,F 100% 5/5 Rationales
----------------------------------------------------

3. 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 Answer: 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.

Answer(s) Rank (%) Rank (# votes) Answer Rationale
A,D 92% 11/12 Rationales
D,E 8% 1/12 Rationales
----------------------------------------------------
...全文
51 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
kamphkb 2003-04-06
  • 打赏
  • 举报
回复
多谢多谢 ;)
denal 2003-04-05
  • 打赏
  • 举报
回复


8. 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 Answer: 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 page
F. Set the TraceMode attribute of the Page directive to SortByTime for the main page.

Answer(s) Rank (%) Rank (# votes) Answer Rationale
A,B,E 88% 21/24 Rationales
A,D 4% 1/24 Rationales
A,B,D 8% 2/24 Rationales
----------------------------------------------------

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

Answer(s) Rank (%) Rank (# votes) Answer Rationale
C 100% 6/6 Rationales
----------------------------------------------------


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.

Answer(s) Rank (%) Rank (# votes) Answer Rationale
B 79% 11/14 Rationales
A 21% 3/14 Rationales
----------------------------------------------------

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.

Answer(s) Rank (%) Rank (# votes) Answer Rationale
C 100% 7/7 Rationales
----------------------------------------------------

12. 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_

Answer(s) Rank (%) Rank (# votes) Answer Rationale
C 100% 8/8 Rationales
----------------------------------------------------
denal 2003-04-05
  • 打赏
  • 举报
回复

5. 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();

Answer(s) Rank (%) Rank (# votes) Answer Rationale
B 100% 11/11 Rationales
----------------------------------------------------

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

Answer(s) Rank (%) Rank (# votes) Answer Rationale
D 89% 8/9 Rationales
A 11% 1/9 Rationales
----------------------------------------------------

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

Answer(s) Rank (%) Rank (# votes) Answer Rationale
A 90% 9/10 Rationales
B 10% 1/10 Rationales
----------------------------------------------------

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧