Product Description
Exam Number/Code: 70-549CSharp
Exam name: PRO:Design & Develop Enterprise Appl by Using MS.NET Frmwk
70-549CSharp test is the important of Microsoft certification. Only you pass the 70-549CSharp exam you could have the chance to get Microsoft certification. To help examinee, Exambible publish the Questions and Answers about 70-549CSharp exam. And the 139 simulation exam are all designed by expert from Exambible. Examinees could have an enough prepare by these simulation exercises and pass the 70-549CSharp test successfully.
Exambible also provide free 70-549CSharp Demo, examinees can download and use before buying 70-549CSharp Q&As, then decide if they need to purchase.
More Microsoft MCPD Resources
Recommended Microsoft exams
- Microsoft MB6-202 exam: Axapta 3.0 Programming
- Microsoft 70-306 exam: MCAD .NET Developing and Implementing Windows-based Applications with Microsoft Visual Basic .NET
- Microsoft 70-565 exam: Pro: Designing and Developing Enterprise Applications Using the Microsoft .NET Framework 3.5
- Microsoft MB6-291 exam: Axapta 3.0 Shop Floor Control
- Microsoft 70-272 exam: MCDST Supporting Users and Troubleshooting Desktop Applications
- Microsoft 70-089 exam: Planning, Deploying, and Managing Microsoft Systems Management Server 2003
- Microsoft MB4-219 exam: Solomon 6.0 Inventory & Order processing
- Microsoft 74-924 exam: MS Office Communication Server 2007-U.C Voice Specialization
- Microsoft 70-630GB2312 exam: TS:Configuring Microsoft Office SharePoint Server 2007
- Microsoft 70-214 exam: MCSA Implementing and Administering Security in a Microsoft Windows 2000 Network
- Microsoft 70-541(VB) exam: TS:MS Windows SharePoint Srvcs 3.0 Application Development
- Microsoft 70-565C++ exam: Pro: Designing and Developing Enterprise Applications Using the Microsoft .NET Framework 3.5
Microsoft MCPD 70-549CSharp Web Demo
This webdemo is just a demo data, only for reference and learning, there is no other purposes.
1. You are an enterprise application developer. You are manipulating a collection of customer, product, and supplier objects.
The collection objects must fulfill the following requirements:
·The objects must use custom sort methods on different properties of the respective classes.
·The objects must be strongly typed.
A developer from your team decides to use the following collection classes.
abstract class MyCollectionBase : System.Collections.CollectionBase {
abstract public void Sort();
}
public class CustomerCollection : MyCollectionBase {
//Code overriding CollectionBase methods
public override void Sort(){
//Customer sorting code }}
public class SupplierCollection : MyCollectionBase {
//Code overriding CollectionBase methods
public override void Sort(){
//Supplier sorting code}}
public class ProductCollection : MyCollectionBase {
//Code overriding CollectionBase methods
public override void Sort(){
//Product sorting code}}
You need to review the code and recommend improvements to simplify maintenance, if necessary.
What should you conclude and recommend?
A. The code does not need to be modified.
B. The code needs to be modified. The MyCollectionBase class must
implement the ICollection interface instead of inheriting from the
CollectionBase class.
C. The code needs to be modified. Use List<T> class instead of creating custom collections.
D. The code needs to be modified. The child collection classes must
inherit from the CollectionBase class instead of the MyCollectionBase
class.
Answer: C
2.You are an enterprise application developer.
The data access layer of an application contains the following code segment. (Line numbers are included for reference only.)
01 static public List<Employee> GetEmployees(){
02 List<Employee> employees = new List<Employee>();
03 using (SqlConnection cnn = new SqlConnection(_cnnStr)){
04 SqlCommand cmd = new SqlCommand("GetEmployees", cnn);
05 cnn.Open();
06 DataSet ds = new DataSet();
07 SqlDataAdapter da = new SqlDataAdapter(cmd);
08 da.Fill(ds);
09 foreach (DataRow row in ds.Tables[0].Rows){
10 Employee emp = new Employee();
11 emp.ID = Convert.ToInt32(row["Id"]);
12 emp.Name = Convert.ToString(row["Name"]);
//
13 employees.Add(emp);
14 }
15 }
16 return employees;
17 }
You review the code segment and discover that it takes a long time to execute.
You need to modify the code segment to improve the performance.
What should you do?
A. ·Create a SqlDataReader object.
·Iterate through a DataReader object to populate the employees list.
B. ·Fill a DataTable object by using a DataTable.Load method.
·Iterate through the DataTable to populate the employees list.
C. ·Fill a DataTable object by using a SqlDataAdapter object.
·Iterate through the DataTable to populate the employees list.
D. ·Fill a DataTable object by using a DataTable.Load method.
·Create a DataTableReader object from the DataTable.
·Iterate through the DataTableReader to populate the employees list.
Answer: A
3. You are an enterprise application developer. You are creating a
component that will be deployed as part of a class library. The
component must meet the following specifications:
·The interface of the component must be accessible to components outside the hosting assembly.
·The interface of the component must be interoperable with components written in any other .NET Framework languages.
·The implementation of the component cannot be expanded upon by a derived class.
You need to design the interface of the component.
Which three tasks should you perform? (Each correct answer presents part of the solution. Choose three.)
A. Apply the CLSCompliant(true) attribute to the assembly and component definition.
B. Apply the abstract keyword to the component definition.
C. Apply the ComVisible(true) attribute to the assembly and component definition.
D. Create a primary interop assembly for the assembly that hosts your component.
E. Apply the sealed keyword to the component definition.
F. Apply the public keyword to the component definition.
Answer: AEF
4. You are an enterprise application developer. You create a data access layer for an order processing application.
The data access layer meets the following criteria:
·The data access layer contains a GetConnectionString method to retrieve and return the connection string for the database.
·The data access layer contains a stored procedure named GetTotalOrderAmount.
·The stored procedure runs a select query to return only the sum of the
OrderAmount column for the active orders. At times, there might be no
active orders.
You create the following method to execute the stored procedure and return the total.
public double GetTotalOrderAmount() {
SqlConnection con = new SqlConnection(GetConnectionString());
string sql = "GetTotalOrderAmount";
SqlCommand cmd = new SqlCommand(sql,con);
IDataReader rd;
con.Open();
rd = cmd.ExecuteReader();
double amt = 0.0;
if (rd.Read()) {
amt = rd.GetDouble(0);
}
rd.Close();
con.Close();
return amt;
}
You need to review the code and recommend modifications to simplify the code and improve performance, if necessary.
What should you conclude and recommend?
A. The code does not need to be modified.
B. The code needs to be modified. You must remove the condition that verifies whether the DataReader object returned any rows.
C. The code needs to be modified. You must use a DataSet object instead of a DataReader object.
D. The code needs to be modified. You must use the ExecuteScalar method instead of the ExecuteReader method.
Answer: D
5. You are an enterprise application developer.
You are reviewing the following code segment. (Line numbers are included for reference only.)
01 public class MyResource: IDisposable {
02
03 private bool disposed = false;
04
05 public void Dispose() {
06 Dispose(true);
07 }
08
09 private void Dispose(bool disposing) {
10 if(!this.disposed) {
11 if(disposing) {
12 ReleaseManagedResources();
13 }
14 ReleaseUnmanagedResources();
15 disposed = true;
16 }
17 }
18
19 ~MyResource() {
20 ReleaseManagedResources();
21 ReleaseUnmanagedResources();
22 }
23 }
You discover that the Dispose pattern is implemented incorrectly.
You need to modify the code segment to ensure that the dispose pattern is implemented correctly.
What should you do?
A. ·Insert the following line of code after line 06.
GC.SuppressFinalize(this);
·Replace lines 20 and 21 with the following line of code.
Dispose(true);
B. ·Insert the following line of code after line 06.
GC.SuppressFinalize(this);
·Replace lines 20 and 21 with the following line of code.
Dispose(false);
C. ·Insert the following line of code after line 19.
GC.SuppressFinalize(this);
·Replace lines 20 and 21 with the following line of code.
Dispose(false);
D. ·Insert the following line of code after line 19.
GC.SuppressFinalize(this);
·Replace lines 20 and 21 with the following line of code.
Dispose(true);
Answer: B
6. You are an enterprise application developer. You are performing a
peer code review for an entry-level developer. The developer is
implementing server-side business objects.
The business objects must be accessed and activated by using .NET
Framework remoting. In addition, the business objects must meet the
following requirements:
·Implement an interface for client-side access.
·Inherit from a base business object class.
The developer writes the following code segment.
Public Class UserObject
Inherits BaseBizObject, MarshalByRefObject
Implements IUserObject
End Class
When the developer attempts to compile the code, an error message is received.
You need to review the code and recommend a solution. What should you recommend?
A. The class must derive from the MarshalByRefObject class. The
UserObject class can access methods in the BaseBizObject class by
creating an instance of the BaseBizObject class.
B. The class must derive from the BaseBizObject class. The BaseBizObject class must derive from the MarshalByRefObject class.
C. Change the approach so that the client computer accesses a wrapper class that derives from the MarshalByRefObject class.
D. The class must derive from the MarshalByValue class instead of the MarshalByRefObject class.
Answer: B
7. You are an enterprise application developer. You are performing a
peer code review for an entry-level developer. The developer is
implementing server-side business objects.
The business objects must be accessed and activated by using .NET
Framework remoting. In addition, the business objects must meet the
following requirements:
·Implement an interface for client-side access.
·Inherit from a base business object class.
The developer writes the following code segment.
public class UserObject : BaseBizObject, MarshalByRefObject, IUserObject {}
When the developer attempts to compile the code, an error message is received.
You need to review the code and recommend a solution.
What should you recommend?
A. The class must derive from the MarshalByRefObject class. The
UserObject class can access methods in the BaseBizObject class by
creating an instance of the BaseBizObject class.
B. The class must derive from the BaseBizObject class. The BaseBizObject class must derive from the MarshalByRefObject class.
C. Change the approach so that the client computer accesses a wrapper class that derives from the MarshalByRefObject class.
D. The class must derive from the MarshalByValue class instead of the MarshalByRefObject class.
Answer: B
8. You are an enterprise application developer. You create an
application to provide an enterprise-wide barcode printing solution.
You are developing a component that contains a method named
InitializePrinter. The method will call a private function named
IsPrinterLicensed to verify the license of the printer for the
application. You need to ensure that the exceptions raised by the
IsPrinterLicensed function bubble up to the application that calls the
InitializePrinter method. You also need to ensure that the exceptions
contain contextual information. Which code segment should you use?
A. nResult = IsPrinterLicensed(printerName);
InitPrinter(printerName);
B. try {
nResult = IsPrinterLicensed(printerName);
InitPrinter(printerName) ;}
catch (Exception ex){
throw ex; }
C. try {
nResult = IsPrinterLicensed(printerName);
InitPrinter(printerName) ;}
catch (Exception ex){
throw new Exception("Exception thrown from InitializePrinter");}
D. try {
nResult = IsPrinterLicensed(printerName);
InitPrinter(printerName) ;}
catch (Exception ex){
throw new Exception("Exception thrown from InitializePrinter", ex);}
Answer: D