Which is the correct Property to insert?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. The application uses a Microsoft ADO.NET SQL Server managed provider.
“Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername; Password=secret;”
You need to ensure that the database credentials are secure. Which is the correct Property to insert?
Which approach should you recommend?
You are designing a data access service backed by Microsoft SQL Server.
Other developers will use your service as a third-party service.
You have the following requirements:
– To reduce maintenance cost, you must write the minimal amount of code required for fulfilling the goals.
– The service must function with Microsoft and non-Microsoft technologies.
– The service must implement the WS-Security standards.
You need to design the service to meet the requirements.
Which approach should you recommend?
Which method should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database.
SQLConnection conn = new SQLConnection(connectionString);
conn.Open();
SqlTransaction tran = db.BeginTransaction(IsolationLevel. …);
…
You must retrieve not commited records originate from various transactions. Which method should you use?
Which approach should you recommend?
You are adding functionality to an ASP.NET MVC 2 Web application.
You have the following requirements when passing form data to the server:
– Provide a simple way to map posted form values to a custom class object.
– Control the deserialization of custom class objects that are passed to the server.
You need to design the application to meet the requirements.
Which approach should you recommend?
Which of the following is the correct connection string?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. You must retrieve a connection string.
Which of the following is the correct connection string?
Which approach should you recommend?
You need to design session state management for the rewritten Web application.
Which approach should you recommend?
Which code segment should you insert at line 14?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application uses the ADO.NET Entity Framework to model entities.
The conceptual schema definition language (CSDL) file contains the following XML fragment.
<EntityType Name=”Contact”>
…
<Property Name=”EmailPhoneComplexProperty” Type=”AdventureWorksModel.EmailPhone” Nullable=”false” />
</EntityType>
…
<ComplexType Name=”EmailPhone”>
<Property Type=”String” Name=”EmailAddress” MaxLength=”50″ FixedLength=”false” Unicode=”true” />
<Property Type=”String” Name=”Phone” MaxLength=”25″ FixedLength=”false” Unicode=”true” />
</ComplexType>
You write the following code segment. (Line numbers are included for reference only.)
01 using (EntityConnection conn = new EntityConnection(“name=AdvWksEntities”))
02 {
03 conn.Open();
04 string esqlQuery = @”SELECT VALUE contacts FROM
05 AdvWksEntities.Contacts AS contacts
06 WHERE contacts.ContactID == 3″;
07 using (EntityCommand cmd = conn.CreateCommand())
08 {
09 cmd.CommandText = esqlQuery;
10 using (EntityDataReader rdr = cmd.ExecuteReader())
11 {
12 while (rdr.Read())
13 {
14 …
15 }
16 }
17 }
18 conn.Close();
19 }
You need to ensure that the code returns a reference to a ComplexType entity in the model named EmailPhone.
Which code segment should you insert at line 14?
Which approach should you recommend?
You are designing a deployment process for a new ASP. NET Web application.
The company requires the application to be compiled to a single DLL for deployment.
You need to design a deployment process that meets the requirement.
Which approach should you recommend?
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to two different Microsoft SQL Server 2008 database servers named Server1 and Server2.
A string named sql1 contains a connection string to Server1. A string named sql2 contains a connection string to Server2.
01 using (TransactionScope scope = new
02 …
03 )
04 {
05 using (SqlConnection cn1 = new SqlConnection(sql1))
06 {
07 try{
08 …
09 }
10 catch (Exception ex)
11 {
12 }
13 }
14 scope.Complete();
15 }
You need to ensure that the application meets the following requirements:
* There is a SqlConnection named cn2 that uses sql2.
* The commands that use cn1 are initially enlisted as a lightweight transaction.
The cn2 SqlConnection is enlisted in the same TransactionScope only if commands executed by cn1 do not throw an exception.
What should you do?
Which approach should you recommend?
You are designing the deployment process for a new ASP.NET Web application.
You need to ensure that the application is protected from modification after deployment.
Which approach should you recommend?