没有合适的资源?快使用搜索试试~ 我知道了~
微软认证 答案 及 解析
需积分: 0 2 下载量 195 浏览量
2010-05-05
22:04:58
上传
评论
收藏 190KB DOC 举报
温馨提示
试读
52页
本资源是微软认证试题,并有详细版答案讲解。
资源详情
资源评论
资源推荐
QUESTION 1
You want to create a transaction, but you do not want anyone to modify the rows in aDataSet
object until the transaction is finished.
What isolation level should you use? (Select the best choice.)
A.
ReadCommitted
B.
ReadUncommitted
C.
RepeatableRead
D.
Serializable
Answer: D
Section: (none)
Explanation/Reference:
Section: 3. Consuming and Manipulating Data
Choice d is correct. The Serializable value of the TransactionIsolationLevel enumeration specifies
that no users should be able to add rows or modify data in a data set while a transaction is open.
The ReadCommitted value specifies that locks are placed on the data while it is being read, but
data can still be altered before the transaction is complete. No locks are held in
aReadUncommitted transaction. With RepeatableRead, a transaction will prevent others from
modifying data while a transaction is open, but phantom rows can still be created.
Reference:
MSDN, Search, "TransactionIsolationLevel Enumeration," ".NET Framework Class Library."
QUESTION 2
Your company has installed an application to a network share that will be used by several
employees. The application will be executed on individual client computers. Each computer will
use a different database when executing the application. Each computer needs to retain the name
of the database it will use in its Machine.config file.
Which of the following XML segments under the <appSettings> element in theMachine.config
file will properly store a database name of Finance? (Select the best choice.)
A.
<key="DBName" value="Finance">
B.
<MyApp key="DBName" value="Finance">
C.
<add key="DBName" value="Finance">
D.
a<clear key="DBName" value="Finance">
Answer: C
Section: (none)
Explanation/Reference:
Choice c is correct. The Machine.config file is one of the configuration files used by the .NET
runtime to establish application settings. The settings in the Machine.config file apply to the entire
computer. Settings located under the <appSettings> element apply to individual applications on
the computer. In a scenario where an application is stored on a server, no specific application
configuration file resides on each workstation. To add settings specific to an application in
aMachine.config file, the application name must first be added with the <add> element.
Reference:
MSDN, Search, "Machine Configuration Files," ".NET Framework Developer's Guide."
QUESTION 3
An application is reporting syntax errors when the project is compiled.
Which of the following windows should you use to view the errors? (Select the best choice.)
A.
Output
B.
Locals
C.
Disassembly
D.
Call Stack
Answer: A
Section: (none)
Explanation/Reference:
Choice a is correct. The Output window displays syntax errors that occur when building an
application. It also provides Debug and Trace output. By right-clicking the error and selectingGo
To Error/Tag, you can navigate to the lines of code that are responsible for the errors. The Locals
window displays the names and values of variables that are currently in scope. The Disassembly
window displays assembly code from the compiler. The Call Stack window shows the current call
stack while in debug mode.
Reference:
MSDN, Search, "Output Window," "Visual Studio."
QUESTION 4
You have inherited an application from a former colleague. The application contains aMainMenu
component named myMainMenu. Your company wants you to give the application the ability to
display part of the main menu, MenuEditItem, in a popup menu when the user right-clicks a
particular text box. You have added a ContextMenu component, PopupMenu, to the main form.
You want to write the fewest lines of code to create the popup menu.
Which of the following lines of code should you use in your solution? (Select the best choice.)
A.
PopupMenu.MenuItems.Add(MenuEditItem.CloneMenu());
B.
PopupMenu = MenuEditItem;
C.
PopupMenu.MenuItems = MenuEditItem.MenuItems;
D.
PopupMenu = MenuEditItem.CloneMenu();
Answer: A
Section: (none)
Explanation/Reference:
Choice a is correct. You should use the
PopupMenu.MenuItems.Add(MenuEditItem.CloneMenu());statement to create the popup menu.
The CloneMenu method provides a simple way of creating a popup menu based on an
existingMainMenu object. Assigning the popup menu to the ContextMenu property of a control
will cause the popup menu to appear when the user right-clicks the control. Popup menus cannot
be created by simply setting the ContextMenu object equal to a MainMenu object.
Reference:
MSDN, Search, "MainMenu.CloneMenu Method," ".NET Framework Class Library."
QUESTION 5
You are writing a grade book application that will be used at small junior colleges. The institutions
in your target market do not have a large budget for computer hardware, so most of their
computers are older systems with limited resources.
Which of the following steps should you take to minimize resource requirements for the
application? (Select the best choice.)
A.
Override the Finalize method. Within the overridden method, destroy and release all critical
resources. Call the Finalize method just before setting the last of the object's reference variables to
null.
B.
When you are finished with an object reference, explicitly destroy the reference by setting it
tonull.
C.
Implement the IDisposable interface. In the IDisposable.Dispose method implementation, destroy
and release all critical resources. Call this method just before setting the last of the object's
reference variables to null.
D.
Create a timer class. Set the timer to call the System.GC.Collect method once every minute to
force the Garbage Collection process to run.
Answer: C
Section: (none)
Explanation/Reference:
Choice c is correct. To minimize resource requirements for the grade book application, you should
implement the IDisposable interface and, in the IDisposable.Dispose method implementation,
destroy and release all critical resources. You should also call this method just before setting the
last of the object's reference variables to null. The IDisposable interface provides a mechanism
through which scarce resources can be released without waiting for the Garbage Collection
process. The programmer must ensure that the Dispose method is called only when the last
reference to an object is being destroyed.
The Finalize method is declared as protected and cannot be called from any code that is not a part
of a child of the object. Setting the reference to null simply flags the object so that the Garbage
Collector will destroy it and free its resources on its next pass. Forcing Garbage Collection to
occur more frequently often results in a degradation of application performance.
Reference:
MSDN, Contents, ".NET Development," ".NET Framework SDK," "Product Documentation,"
"Reference," "Class Library," "System," "IDisposable Interface," "Methods,"
"IDisposable.Dispose Method."
QUESTION 6
Examine the following code sample:
int I1 = 0;
double D1;
DateTime dte = new DateTime(2002, 4, 1, 0, 0, 0, 0);
try
{
I1 = dte.AddSeconds(-0.75).Day;
D1 = I1 / (I1 - 1);
}
catch
{
I1 = 1000;
}
finally
{
Debug.WriteLine("I1 = " + I1.ToString());
}
What is the output from this code sample? (Select the best choice.)
剩余51页未读,继续阅读
godfreyHe
- 粉丝: 2
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0