Build .%C8%CB%B9%B7%BD%BB%BB%B6Y Reg usearchc%C8%CB%B9%B7%BD%BB%BB%B6e This t Users searchesearch- Aspx as Aspx dc Business i Web nt1ahttp%3A%2F%2Fweb.renxingbense.org%2Fp Reg iasearchi Build n Business . Web ou Web asearchehttp%3A%2F%2Fweb.renxingbense.org%2Fcsearchea Aspx i Business gsearcha Reg asearchp Reg ia This ionsearchth Reg t This m Reg ssearch searchc Users e Aspx s Aspx dihttp%3A%2F%2Fweb.renxingbense.org%2Ffe Web e Business tsearchdta Business ae Business http%3A%2F%2Fweb.renxingbense.org%2Fe Web esearchd Web n%C8%CB%B9%B7%BD%BB%BB%B6 osearch Web ht Users e%C8%CB%B9%B7%BD%BB%BB%B6 Web he This asearchp Build ica Business i This n Users i Web searchndsearchmsearchns Business rtonsearch Reg rsearchdu Reg tsearchon, Web ort%C8%CB%B9%B7%BD%BB%BB%B6st Business o Web e Web Aspx he1m1d Business searchssearchssearcho Build e Aspx This nsearchasearch Business n Build ionmsearchntvar Users asearchle.
?
The configuration file contains the following settings.
?
<connectionStrings>
<add name = "ProdDB" connectionString = "Data Source = server; Initial Catalog = ProdDatabase; Integrated_Security = true" providerName = "System.Data.SqlClient" />
<add name = "DemoDB" connectionString = "Data Source = server; Initial Catalog = DemoDatabase; Integrated_Security = true" providerName = "System.Data.SqlClient" />
<add name = "TestDB" connectionString = "Data Source = server; Initial Catalog = TestDatabase; Integrated_Security = true"
providerName = "System.Data.SqlClient" />
</connectionStrings>
?
You need to ensure that changing the mode will not require you to change the configuration file.
?
Which code segment should you use?
A. public string GetConnectionString() {}
B. public string GetConnectionString() {}
C. public string GetConnectionString() {}
D. public string GetConnectionString() {}
E. public string GetConnectionString() {}
Answer: B

6. You create Web-based client applications. You are reviewing a Web application page that populates a list of all employees of your company.
You analyze code and find that the Web application page does not prevent exceptions from traveling to the browser.
You need to ensure that the Web application page intercepts exceptions and presents an error message to the browser.
What change should you suggest?
A. Add the following code segment to the Web.config file.
<system.web>
<compilation debug="true"/>
</system.web>
B. Add the following code segment to the page.
protected void Page_Error(object sender, EventArgs e) {}
C. Add the following code segment to the Web.config file.
<system.web>
<customErrors mode="Off"/>
</system.web>
D. Change the load event handler to the following code segment.
protected void Page_Load(object sender, EventArgs e) {}
Catch {}
}
Answer: B

7. You create Web-based client applications. You are reviewing a Web application page that populates the list of all employees for your company.
The following code segment loads the list of employees from a database.
private static List<CEmployee> LoadEmployeesFromDatabase() {}
You analyze the code segment. You find that the database connection fails to close properly when the GetEmployees method throws an exception.
You need to recommend a change in the code segment to ensure that every possible code path closes the database connection.
Which code segment should you recommend?
A. // Create the connection and open it
using (DbConnection conn = factory.CreateConnection())
{}
B. // Create the connection and open it
DbConnection conn = factory.CreateConnection();
conn.ConnectionString = connString.ConnectionString;
conn.Open();
// Get the employees. The connection to the database is
// given as parameter
lstEmployees = GetEmployees(conn);
if (lstEmployees == null) {}
else {}
C. HandleCollector coll =new HandleCollector("Connections", 0, 5);
// Create the connection and open it
DbConnection conn = factory.CreateConnection();
conn.ConnectionString = connString.ConnectionString;
conn.Open();
coll.Add();
// Get the employees. The connection to the database is
// given as parameter
lstEmployees = GetEmployees(conn);
// Close the connection to the employee data store
Conn.Close();
Coll.Remove();
D. // Create the connection and open it
using (IDisposable factory = DbProviderFactories.GetFactory("System.Data.SqlClient") as IDisposable)
{}
Answer: A

8. You create components for Web-based client applications. You are creating a BankAccount class.
The BankAccount class contains an AccountNumber property and a CreateAccount method. The CreateAccount method is used to create a new account. The method generates a unique random value for the actNumber field.
You need to ensure that the BankAccount class is extendable, and that it serves as the base class for other derived classes. You also need to ensure that each derived class can have its own guidelines to generate account numbers in the CreateAccount method.
Which code segment should you use?
A. public class BankAccount {}
}
public virtual BankAccount CreateAccount() {}
}
B. public class BankAccount {}
}
public virtual BankAccount CreateAccount() {}
}
C. public class BankAccount {}
}
public BankAccount CreateAccount() {}
}
D. public class BankAccount {}
}
public BankAccount CreateAccount() {}
}
Answer: A

9. Question
You create Web-based client applications. You are designing a new Web site for your company. You need to evaluate the design concept for the main page, default.aspx.
?
The default.aspx page contains static information, except for one data grid that displays information about the companys products. The data grid will retrieve the data from a component. The component will retrieve the data from a stored procedure. The page has the appropriate permissions to the Microsoft SQL Server database.
?
The application design must achieve the following goals without altering the data component:
?
The default.aspx page must load quickly.
The default.aspx page must contain the latest data from the database.
?
You decide to use a sqlCacheDependency attribute to ensure that the default.aspx page always displays the latest data in the grid.
?
You need to ascertain whether the use of the sqlCacheDependency attribute meets the requirements of this application.
?
Which rationale should you choose?
A. The use of the sqlCacheDependency attribute is not feasible. The sqlCacheDependency attribute must be used in the component and not on the page.
B. The use of the sqlCacheDependency attribute is not feasible. The sqlCacheDependency attribute cannot be used with a stored procedure.
C. The use of the sqlCacheDependency attribute is feasible. The sqlCacheDependency attribute can be used by including a sqlDependency attribute in the @OutputCache directive of the page.
D. The use of the sqlCacheDependency attribute is feasible. The sqlCacheDependency attribute can be linked to the data component that is used on the page.
Answer: C

10. Question
You create Web-based client applications. You are designing an extranet site for a company of trading partners.
?
You decide to use the following technologies:
?
Windows Authentication
XML to transfer data between the company and the traders
?
Before implementation, these technologies must be validated. You propose the following approach to perform the validation:
?
Coordinate a test set of Active Directory accounts for one trading partner.
Provide the trading partner access to a test site that has logon facility.
Distribute the XML schema that permits the partner to access data.
?
You need to evaluate whether the approach validates the proposed technology successfully.
?
What should you conclude?
A. The approach validates the use of the proposed technology for the application.
B. The approach does not validate the use of the proposed technology for the application. The company and the partner need to create test applications. The test applications need to read data in the proposed XML schema to establish the validation.
C. The approach does not validate the use of the proposed technology for the application. The company and the partner need to coordinate their Active Directory tree into a shared Active Directory forest.
D. The approach does not validate the use of the proposed technology for the application. You must either use an existing publicly documented XML schema or register the shared XML schema by using an authentication site.
Answer: B

11. You create Web-based applications. You are creating an Internet banking application.
You write the following lines of code to represent a method in your application. (Line numbers are included for reference only.)
01 public void Transfer(decimal amount, BankAccount account)
02 {}
10 }
You use the Microsoft Visual Studio 2005 test feature to automatically generate the following unit test. (Line numbers are included for reference only.)
01 [TestMethod()]
02 public void TransferTest()
03 {}
You need to change the test method to return a conclusive result.
Which line of code should replace the code on line 09 of the unit test?
A. Assert.AreEqual (400M, target.Balance);
B. Assert.IsTrue (target.Balance != 400M);
C. Debug.Assert (target.Balance == 400M,passed);
D. Debug.Assert (target.Balance == 400M,failed);
Answer: A

12. You create Web-based client applications. You create a Web site that will be used to simulate different types of loans. You are writing a method to calculate the payment on a simple loan.
You write the following lines of code for the method. (Comments are included for reference only.)
public static decimal Payment(decimal loanAmount, int period, decimal rate) {} else {}
}
public static decimal CheckBalance(ulong accountID) {}
You write the following code for the unit test.
[TestMethod()]
public void PaymentTest() {}
You enable coverage testing for this unit test.
You need to identify the coverage of your test.
Which lines are covered by the test?
A. Lines commented A, B, and C
B. Lines commented A and C
C. Lines commented A, B, C, D, E, and F
D. Lines commented A, B, C, E, and F
Answer: B

13. You create Web-based applications. You are creating an Internet banking application. The application will be used by bank account holders.