Quantcast
Channel: Free Download Updated PassLeader Exam Dumps
Viewing all 1919 articles
Browse latest View live

[Pass Ensure VCE Dumps] Download New Free PassLeader 286q 70-516 Exam Questions Help 100% Passing Exam (81-100)

$
0
0

Where To Get The 100 Percent Valid 70-516 Exam Dumps? PassLeader — one famous IT Certification Exam Study Materials Supplier — is offer the 100 percent valid 286q 70-516 exam dumps, which covers all the new 70-516 exam questions with detailed explanation and it has been helped many people passing 70-516 exam easily! Welcome to choose the best 286q 70-516 practice test from passleader.com, both 70-516 PDF dumps and 70-516 VCE dumps are available now!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 81
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The application contains the following model. Each region contains a single vendor. Customers order parts from the vendor that is located in their region. You need to ensure that each row in the Customer table references the appropriate row from the Vendor table. Which code segment should you use?

A.    SalesDataContext dc = new SalesDataContext(“…”);
var query = from v in dc.Vendors
join c in dc.Customers on v.VendorlD equals c.VendorID
select new { Vendor = v, Customer = c };
foreach (var u in query){
u.Customer.Region = u.Vendor.Region;
}
dc.SubmitChanges();
B.    SalesDataContext dc = new SalesDataContext(“…”);
var query = from c in dc.Customers
join v in dc.Vendors on c.VendorlD equals v.VendorID
select new { Customer = c, Vendor = v };
foreach (var u in query){
u.Vendor.Region = u.Customer.Region;
}
dc.SubmitChanges();
C.    SalesDataContext dc = new SalesDataContext(“…”);
var query = from v in dc.Vendors
join c in dc.Customers on v.Region equals c.Region
select new { Vendor = v, Customer = c };
foreach (var u in query){
u.Customer.VendorlD = u.Vendor.VendorlD;
}
dc.SubmitChanges();
D.    SalesDataContext dc = new SalesDataContext(“…”);
var query = from c in dc.Customers
join v in dc.Vendors on c.Region equals v.Region
select new { Customer = c. Vendor = v };
foreach (var u in query){
u.Vendor.VendorlD = u.Customer.VendorID;
}
dc.SubmitChanges();

Answer: C

QUESTION 82
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 200B database. You populate a SqlDataAdapter by using the following code. (Line numbers are included for reference only.)
01 SqlDataAdapter dataAdapter1 = new SqlDataAdapter(“SELECT * FROM [BlogEntries] ORDER BY CreationDate”, connection);
02 cmdBuilder = new SqlCommandBuilder(dataAdapter1);
03 dataAdapter1.Fill(BlogEntryDataSet, “BlogEntries”);
04 ….
05 connection.Close();
You need to update the blog owner for all BlogEntry records. Which code segment should you insert at line 04?

A.    foreach(DataRow row in BlogEntryDataSet.Tables[“BlogEntries”].Rows)
{
row.Item[“BlogOwner””] = “New Owner”;
}
dataAdapter1.Update(BlogEntryDataSet, “BlogEntries”);
B.    foreach(DataRow row in BlogEntryDataSet.Tables[“BlogEntries”].Rows)
{
row.Item[“BlogOwner””] = “New Owner”;
}
dataAdapter1.Fill(BlogEntryDataSet, “BlogEntries”);
C.    SqlDataAdapter dataAdapter2 = new SqlDataAdapter(
“UPDATE [BlogEntries] SET [BlogOwner] = “New ‘Owner’ 3″,
connection);
dataAdapter2.Update(BlogEntryDataSet, “BlogEntries”);
D.    SqlDataAdapter dataAdapter2 = new SqlDataAdapter
(dataAdapterl.UpdateCommand);
dataAdapter2.Fill(BlogEntryDataSet, “BlogEntries”);

Answer: A
Explanation:
SqlDataAdapter.Update()-Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the System.Data.DataSet with the specified System.Data.DataTable name.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder.aspx

QUESTION 83
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The application contains the following model. You write the following code. (Line numbers are included for reference only.)
01 static void Insert()
02 {
03    NorthwindDataContext dc = new NorthwindDataContext();
04    Customer newCustomer = new Customer();
05    newCustomer.Firstname = “Todd”;
06    newCustomer.Lastname = “Meadows”;
07    newCustomer.Email = “troeadows@contoso.com”;
08    …..
09    dc.SubmitChanges();
10 }
A product named Bike Tire exists in the Products table. The new customer orders the Bike Tire product. You need to ensure that the correct product is added to the order and that the order is associated with the new customer. Which code segment should you insert at line 08?

A.    Order newOrder = new Order();
newOrder.Product = (from p in dc.Products
where p.ProductName == “Bike Tire”
select p) .First();
B.    Product newProduct = new Product();
newProduct.ProductName = “Bike Tire”;
Order newOrder = new Order();
newOrder.Product = newProduct;
C.    Product newProduct = new Product();
newProduct.ProductName = “Bike Tire”;
Order newOrder = new Order ();
newOrder.Product = newProduct;
newCustomer.Orders.Add(newOrder) ;
D.    Order newOrder = new Order();
newOrder.Product = (from p in dc.Products
where p.ProductName == “Bike Tire”
select p).First();
newCustomer.Orders.Add(newOrder) ;

Answer: D

QUESTION 84
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application that connects to a database by using the Entity Framework. You create an Entity Data Model (EDM) by using the Generate from database wizard for the following tables. You need to ensure that the EDM contains an entity type named Employee that contains all of the data from both tables. What should you do?

A.    Delete the EmployeeAccess entity, create a new property named CanAccessBuildings on the Employee entity, and add a mapping for the new property.
B.    Create an inheritance relationship between the Employee and EmployeeAccess entities, and use CanAccessBuildings as an inheritance condition.
C.    Modify the .edmx file to include the following line of code:
<NavigationProperty Name=”Type” FromRole=”EmployeeAccess” ToRole=”Employee” />
D.    Create a one-to-one association named CanAccessBuildingsAssociation between the EmployeeAccess entity and the Employee entity.

Answer: A
Explanation:
<Association Name=”FK_OrderDetails_Orders1″>
<End Role=”Orders” Type=”StoreDB.Store.Orders” Multiplicity=”1″> <OnDelete Action=”Cascade” />
</End>
<End Role=”OrderDetails” Type=”StoreDB.Store.OrderDetails” Multiplicity=”*” /> <ReferentialConstraint>
<Principal Role=”Orders”>
<PropertyRef Name=”ID” />
</Principal>
<Dependent Role=”OrderDetails”>
<PropertyRef Name=”OrderId” />
</Dependent>
</ReferentialConstraint>
</Association>

QUESTION 85
When working with a data set that has data in it, you decide you want to store the schema, but not the data, of the data set to a file so you can share the schema with other users. Which method must you execute to store the schema?

A.    InferXmlSchema
B.    ReadXmlSchema
C.    WriteXmlSchema
D.    WriteXml

Answer: C

QUESTION 86
Before you can execute a command on a connection object, which method must you execute to prepare the connection?

A.    Open
B.    BeginTransaction
C.    GetSchema
D.    Close

Answer: A

QUESTION 87
You want to set up a secure connection between your application and SQL Server. SQL Server has a trusted certificate that is set up properly. What must you do?

A.    Execute BeginTransaction on the command object.
B.    Add Encrypt=true to the connection string.
C.    Encrypt the CommandText property on the command object.
D.    Close the connection before sending the command.

Answer: B

QUESTION 88
You want to secure the connection strings contained within your Web.config file to ensure that no one can open the file easily and see the connection information. Which tool must you use to encrypt the connection strings?

A.    ASPNET_REGSQL.EXE
B.    CASPOL.EXE
C.    INSTALLUTIL.EXE
D.    ASPNET_REGIIS.EXE.

Answer: D

QUESTION 89
You are going to execute a Select command to SQL Server that returns several rows of customer data. You don’t need a data table to hold the data because you will simply loop over the returned results to build a string of information that will be displayed to the user. You create and open a connection and then create the command and set its properties. Which method on the command will you execute to retrieve the results?

A.    ExecuteScalar
B.    Close
C.    ExecuteReader
D.    ExecuteNonQuery

Answer: C

QUESTION 90
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create the following Entity Data Model. You write a method named ValidatePostalCode to validate the postal code for the application. You need to ensure that the ValidatePostalCode method is called before the PostalCode property set method is completed and before the underlying value has changed. Which code segment should you place in the entity’s partial class?

A.    partial void OnPostalCodeChanged(string value)
{
PostalCode = GetValidValue<string>
(value, “ValidatePostalCode”, false, true) ;
}
B.    public string ValidatedPostalCode
{
   set
   {
ValidatePostalCode(value);
      _PostalCode = value;
   }
   get
   {
      return _PostalCode;
   }
}
C.    partial void OnPostalCodeChanging(string value)
{
   ValidatePostalCode(value);
}
D.    public string ValidatedPostalCode
{
   set
   {
      _PostalCode = StructuralObject.SetValidValue
(“ValidatePostalCode”, false);
   }
   get
   {
      return _PostalCode;
   }
}

Answer: C
Explanation:
Another area of extensibility is with the partial methods created on each entity type. There is a pair of partial methods called OnXxxChanging and OnXxxChanged for each property, in which Xxx is the name of the property. The OnXxxChanging method executes before the property has changed, and the OnXxxChanged method executes after the property has changed. To implement any of the partial methods, create a partial class and add the appropriate partial method with implementation code.
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
Partial Classes and Methods(page 390)
How to: Execute Business Logic During Scalar Property Changes
http://msdn.microsoft.com/en-us/library/cc716747.aspx


http://www.passleader.com/70-516.html

QUESTION 91
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the ADO.NET Entity Framework to model entities. You create an entity model as shown in the following diagram. You need to ensure that all Person entities and their associated EmailAddresses are loaded. Which code segment should you use?

A.    var people = context.People.Include
(“EmailAddresses”).ToList();
B.    var people = context.People.Except
(new ObjectQuery<Person>(“Person.EmailAddresses”, context)).ToList();
C.    var people = context.People.Except
(new ObjectQuery<Person>(“EmailAddresses”, context)).ToList();
D.    var people = context.People.Include
(“Person.EmailAddresses”).ToList();

Answer: A
Explanation:
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
Lazy Loading vs. Explicit Loading vs. Eager Loading (page 384)
http://msdn.microsoft.com/en-us/library/bb896272.aspx

QUESTION 92
You use Microsoft .NET Framework 4.0 to develop an application that connects to a local Microsoft SQL Server 2008 database. The application can access a high-resolution timer. You need to display the elapsed time, in sub-milliseconds (<1 millisecond), that a database query takes to execute. Which code segment should you use?

A.    int Start = Environment.TickCount;
command.ExecuteNonQuery();
int Elapsed = (Environment.TickCount) – Start;
Console.WriteLine(“Time Elapsed: {0:N} ms”, Elapsed);
B.    Stopwatch sw = Stopwatch.StartNew();
command.ExecuteNonQuery() ;
sw.Stop() ;
Console.WriteLine(“Time Elapsed: {0:N} ms”,
sw.Elapsed.TotalMilliseconds);
C.    DateTime Start = DateTime.UtcNow;
command.ExecuteNonQuery();
TimeSpan Elapsed = DateTime.UtcNow – Start;
Console.WriteLine(“Time Elapsed: {0:N} ms”, Elapsed.Milliseconds);
D.    Stopwatch sw = new Stopwatch();
sw.Start() ;
command.ExecuteNonQuery();
sw.Stop();
Console.WriteLine(“Time Elapsed: {0:N} ms”, sw.Elapsed.Milliseconds);

Answer: D
Explanation:
Stopwatch Class
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx

QUESTION 93
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. You need to associate a previously deserialized entity named person1 to an object context named model and persist changes to the database. Which code segment should you use?

A.    person1.AcceptChanges();
model.SaveChanges();
B.    model.People.ApplyChanges(person1) ;
model.SaveChanges();
C.    model.AttachTo(“People”, person1);
model.SaveChanges();
D.    model.People.Attach(person1);
model.SaveChanges();

Answer: C
Explanation:
Cosiderations from Attaching and Detaching objects
http://msdn.microsoft.com/en-us/library/bb896271.aspx
The object that is passed to the Attach method must have a valid EntityKey value. If the object does not have a valid EntityKey value, use the AttachTo method to specify the name of the entity set.
Attach Use the Attach method of ObjectContext where the method accepts a single typed entity parameter.
AttachTo The AttachTo method of ObjectContext accepts two parameters. The first parameter is a string containing the name of the entity set.
The second parameter’ type is object and references the entity you want to add.
Attach The Attach method of ObjectSet, which is the entity set’ type, accepts a single typed parameter containing the entity to be added to the ObjectSet.
CHAPTER 6 ADO.NET Entity Framework
Lesson 2: Querying and Updating with the Entity Framework
Attaching Entities to an ObjectContext(page 437)
Attaching and Detaching objects
http://msdn.microsoft.com/en-us/library/bb896271.aspx
http://msdn.microsoft.com/en-us/library/bb896248(v=vs.90).aspx
http://msdn.microsoft.com/en-us/library/bb896248.aspx

QUESTION 94
You use Microsoft .NET Framework 4.0 to develop an application that uses WCF Data Services to persist entities from the following Entity Data Model. You create a new Blog instance named newBlog and a new Post instance named newPost as shown in the following code segment. (Line numbers are included for reference only.)
01 Blog newBlog = new Blog();
02 Post newPost = new Post();
03 ….
04 Uri serviceUri = new Uri(“…”);
05 BlogsEntities context = new BlogsEntities(serviceUri);
06 ….
You need to ensure that newPost is related to newBlog through the Posts collection property and that newPost and newBlog are sent to the service. Which code segment should you insert at line 06?

A.    context.AttachLink(newBlog, “Posts”, newPost);
context.SaveChanges(SaveChangesOptions.Batch) ;
B.    newBlog.Posts.Add(newPost);
context.AddToBlogs(newBlog);
context.AddToPosts(newPost);
context.SaveChanges(SaveChangesOptions.Batch);
C.    newBlog.Posts.Add(newPost);
context.AttachTo(“Blogs”, newBlog);
context.AttachTo(“Posts”, newPost);
context.SaveChanges(SaveChangesOptions.Batch);
D.    newBlog.Posts.Add(newPost);
context.UpdateObject(newBlog);
context.UpdateObject(newPost);
context.SaveChanges(SaveChangesOptions.Batch);

Answer: C
Explanation:
Attaching and Detaching objects
http://msdn.microsoft.com/en-us/library/bb896271.aspx

QUESTION 95
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. The application includes a table adapter named taStore, which has the following DataTable. There is a row in the database that has a ProductID of 680. You need to change the Name column in the row to “New Product Name”. Which code segment should you use?

A.    var dt = new taStore.ProductDataTable();
var ta = new taStoreTableAdapters.ProductTableAdapter();
ta.Fill(dt);
taStore.ProductRow row = (taStore.ProductRow)dt.Rows.Find(680) ;
row.Name = “New Product Name”;
ta.Update(row);
B.    var ta = new taStoreTableAdapters.ProductTableAdapter();
var dt = ta.GetData();
var row = dt.Select(“680”) ;
row[0][“Name”] = “New Product Name”;
ta.Update(row);
C.    var dt = new taStore.ProductDataTable();
var ta = new taStoreTableAdapters.ProductTableAdapter();
ta.Fill(dt);
var dv = new DataView();
dv.RowFilter = “680”;
dv[0][“Name”] = “New Product Name”;
ta.Update(dt);
D.    var dt = new taStore.ProductDataTable();
var row = dt.NewProductRow();
row.ProductID = 680;
row.Name = “New Product Name”;
dt.Rows.Add(row) ;

Answer: A
Explanation:
DataRowCollection.Find() Method To use the Find method, the DataTable object to which the DataRowCollection object belongs to must have at least one column designated as a primary key column. See the PrimaryKey property for details on creating a PrimaryKey column, or an array of DataColumn objects when the table has more than one primary key.
var dt = new CustomersDS.CustomersDataTable();
var ta = new CustomersDSTableAdapters.CustomersTableAdapter();
ta.Fill(dt);
CustomersDS.CustomersRow row = (CustomersDS.CustomersRow)dt.Rows.Find(4); row.Name = “A. Found Customer Id”;
ta.Update(row);
DataTable.Select() Method Gets an array of all DataRow objects that match the filter criteria. To
create the filterExpression argument,
use the same rules that apply to the DataColumn class’s Expression
property value for creating filters.
var ta = new CustomersDSTableAdapters.CustomersTableAdapter();
var dt = ta.GetData();
var row = dt.Select(“CustomerID > 2”);
row[0][“Name”] = “B. Found Customer Id”;
ta.Update(row);
TableAdapter Overview
http://msdn.microsoft.com/en-us/library/bz9tthwx(v=vs.80).aspx

QUESTION 96
You use Microsoft .NET Framework 4.0 to develop an application that exposes a WCF Data Services endpoint. The endpoint uses an authentication scheme that requires an HTTP request that has the following header format:
GET  /OData.svc/Products(1)
Authorization: WRAP access_token “123456789”
You add the following method to your DataService implementation.
01 protected override void OnStartProcessingRequest(ProcessRequestArgs args)
02 {
03      ….
04 }
You need to ensure that the method retrieves the authentication token. Which line of code should you use?

A.    string token = args.OperationContext.RequestHeaders[“Authorization”];
B.    string token = args.OperationContext.RequestHeaders[“WRAP access_token”];
C.    string token = args.OperationContext.ResponseHeaders[“Authorization”];
D.    string token = args.OperationContext.ResponseHeaders[“WRAP access_token”];

Answer: A
Explanation:
OData and Authentication-OAuth WRAP
http://blogs.msdn.com/b/astoriateam/archive/2010/08/19/odata-and-authentication-part-8-oauth-wrap.aspx

QUESTION 97
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You use the ADO.NET Entity Framework Designer to model entities. You add the following stored procedure to the database, and you add a function import to the model.
CREATE PROCEDURE [dbo].[InsertDepartment]
@Name nvarchar(50),
@ID int NULL OUTPUT
AS
INSERT INTO Department (Name) VALUES (@Name)
SELECT @ID = SCOPE_IDENTITY()
You need to insert a new department and display the generated ID. Which code segment should you use?

A.    using (SchoolEntities context = new SchoolEntities())
{
   var  id = new ObjectParameter(“ID”, typeof(int));
   context.InsertDepartment(“Department 1”, id);
   Console.WriteLine(id.Value);
}
B.    using (SchoolEntities context = new SchoolEntities())
{
   var id = context.InsertDepartment(“Department 1”, null);
   Console.WriteLine(id);
}
C.    using (SchoolEntities context = new SchoolEntities())
{
   ObjectParameter id = null;
   context.InsertDepartment(“Department 1”, id);
   Console.WriteLine(id.Value);
}
D.    using (SchoolEntities context = new SchoolEntities())
{
   var id = new ObjectParameter(“ID”, null));
   context.InsertDepartment(“Department 1”, id);
   Console.WriteLine(id.Value);
}

Answer: A
Explanation:
Reference: http://blogs.microsoft.co.il/blogs/gilf/archive/2010/05/09/how-to-retrieve-stored-procedure-output-parametersin-entity-framework.aspx

QUESTION 98
You use Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that connects to a Microsoft SQL Server 2008 database. The application uses Integrated Windows authentication in Internet Information Services (IIS) to authenticate users. A connection string named connString defines a connection to the database by using integrated security. You need to ensure that a SqlCommand executes under the application pool’s identity on the database server. Which code segment should you use?

A.    using (var conn = new SqlConnection())
{
   conn.ConnectionString = connString;
   SqlCommand cmd = null;
   using (HostingEnvironment.Impersonate())
   {
      cmd = new SqlCommand(“SELECT * FROM BLOG”, conn);
   }
   conn.Open();
   var result = cmd.ExecuteScalar();
}
B.    using (var conn = new SqlConnection(connString))
{
   var cmd = new SqlCommand (“SELECT * FROM BLOG, conn);
   conn.Open();
   using(HostingEnvironment.Impersonate())
   {
      var result = cmd.ExecuteScalar();
   }
}
C.    using (var conn = new SqlConneccion())
{
   using (HostingEnvironroent.Impersonate())
   {
      conn.ConnectionString = connString;
   }
   var cmd = new SqlCommand(“SELECT * FROM BLOG, conn);
   conn.Open() ;
   var result = cmd.ExecuteScalar();
}
D.    using (var conn = new SqlConnection())
{
   conn.ConnectionString = connString;
   var cmd = new SqlCommand(“SELECT * FROM BLOG”, conn);
   using (HostingEnvironment.Impersonate())
   {
      conn.Open();
   }
   var result = cmd.ExecuteScalar();
}

Answer: D

QUESTION 99
You use Microsoft .NET Framework 4.0 to develop an ASP.NET 4 Web application. You need to encrypt the connection string information that is stored in the web.config file. The application is deployed to multiple servers. The encryption keys that are used to encrypt the connection string information must be exportable and importable on all the servers. You need to encrypt the connection string section of the web.config file so that the file can be used on all of the servers. Which code segment should you use?

A.    Configuration config = WebConfigurationManager.OpenWebConfiguration(“~”);
ConnectionStringsSection section = (ConnectionStringsSection)config.GetSection(“connectionStrings”);
section.Sectionlnformation.ProtectSection
(“RsaProtectedConfigurationProvider”); config.Save();
B.    Configuration config = WebConfigurationManager.OpenMachineConfiguration(“~”);
ConnectionStringsSection section = (ConnectionStringsSection)config.GetSection(“connectionStrings”);
section.Sectionlnformation.ProtectSection
(“RsaProtectedConfigurationProvider’*); config.Save();
C.    Configuration config = WebConfigurationHanager.OpenWebConfiguration (“~”);
ConnectionStringsSection section = (ConnectionStringsSection)config.GetSection(“connectionStrings”);
section.Sectionlnformation.ProtectSection
(“DpapiProtectedConfigurationProvider”); config.Save ();
D.    Configuration config = WebConfigurationManager.OpenMachineConfiguration (“~”);
ConnectionStringsSection section = (ConnectionStringsSection)config.GetSection(“connectionStrings”);
section.Sectionlnformation.ProtectSection
(“DpapiProtectedConfigurationProvider”); config.Save ();

Answer: A
Explanation:
You encrypt and decrypt the contents of a Web.config file by using System.Configuration . DPAPIProtectedConfigurationProvider from the System.Configuration.dll assembly, which uses the Windows Data Protection API (DPAPI) to encrypt and decrypt data, or by using System.Configuration. RSAProtectedConfigurationProvider, which uses the RSA encryption algorithm to encrypt and decrypt data. When you use the same encrypted configuration file on many computers in a web farm, only System. Configuration.RSAProtectedConfigurationProvider enables you to export the encryption keys that encrypt the data and import them on another server. This is the default setting.
CHAPTER 8 Developing Reliable Applications
Lesson 3: Protecting Your Data
Storing Encrypted Connection Strings in Web Applications (page 555)

QUESTION 100
You use Microsoft .NET Framework 4.0 and the Entity Framework to develop an application. You create an Entity Data Model that has an entity named Customer. You set the optimistic concurrency option for Customer. You load and modify an instance of Customer named loadedCustomer, which is attached to an ObjectContext named context. You need to ensure that if a concurrency conflict occurs during a save, the application will load up-to-date values from the database while preserving local changes. Which code segment should you use?

A.    try
{
   context.SaveChanges();
}
catch(EntitySqlException ex)
{
   context.Refresh(RefreshMode.StoreWins, loadedCustomer);
}
B.    try
{
   context.SaveChanges();
}
catch(OptimisticConcurrencyException ex)
{
   context.Refresh(RefreshMode.ClientWins, loadedCustomer);
}
C.    try
{
   context.SaveChanges();
}
catch(EntitySqlException ex)
{
   context.Refresh(RefreshMode.ClientWins, loadedCustomer);
}
D.    try
{
   context.SaveChanges();
}
catch(OptimisticConcurrencyException ex)
{
   context.Refresh(RefreshMode.StoreWins, loadedCustomer);
}

Answer: B
Explanation:
EntitySqlException Represents errors that occur when parsing Entity SQL command text. This exception is thrown when syntactic or semantic rules are violated.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.EntityException
System.Data.EntitySqlException
OptimisticConcurrencyException
The exception that is thrown when an optimistic concurrency violation occurs.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.UpdateException
System.Data.OptimisticConcurrencyException
Optimistic Concurrency (ADO.NET)
http://msdn.microsoft.com/en-us/library/aa0416cz.aspx
http://msdn.microsoft.com/en-us/library/system.data.objects.refreshmode.aspx
http://msdn.microsoft.com/en-us/library/bb738618.aspx


http://www.passleader.com/70-516.html


[Pass Ensure VCE Dumps] Premium PassLeader 70-516 286q Exam Questions with VCE Test Software For Free Download (101-120)

$
0
0

Where To Get The 100 Percent Valid 70-516 Exam Dumps? PassLeader — one famous IT Certification Exam Study Materials Supplier — is offer the 100 percent valid 286q 70-516 exam dumps, which covers all the new 70-516 exam questions with detailed explanation and it has been helped many people passing 70-516 exam easily! Welcome to choose the best 286q 70-516 practice test from passleader.com, both 70-516 PDF dumps and 70-516 VCE dumps are available now!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 101
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. You need to create a Plain Old CLR Object (POCO) class that can be used with the ObjectContext.CreateObject method to create a proxy. What should you do?

A.    Create a custom data class that has a Protected constructor that does not have parameters.
B.    Create a custom data class in which all properties and methods are virtual.
C.    Create a custom data class that is abstract.
D.    Create a custom data class that is sealed.

Answer: A
Explanation:
Requirements for Creating POCO Proxies
http://msdn.microsoft.com/en-us/library/dd468057.aspx

QUESTION 102
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that uses the Entity Framework. The build configuration is set to Release. The application must be published by using Microsoft Visual Studio 2010, with the following requirements:
– The database schema must be created on the destination database server.
– The Entity Framework connection string must be updated so that it refers to the destination database server.
You need to configure the application to meet the requirements. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Generate the DDL from the Entity Framework Designer and include it in the project. Set the action for the DDL to ApplicationDefinition.
B.    Set Items to deploy in the Package/Publish Web tab to All files in this Project Folder for the release configuration.
C.    Use the web.config transform file to modify the connection string for the release configuration.
D.    Include the source database entry in the Package/Publish SQL tab and update the connection string for the destination database.

Answer: CD

QUESTION 103
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. You need to retrieve an entity, and you must ensure that the entity is loaded in a detached state. Which MergeOption enumeration value should you use to retrieve the entity?

A.    PreserveChanges
B.    OverwriteChanges
C.    AppendOnly
D.    NoTracking

Answer: D
Explanation:
MergeOption Enumeration
http://msdn.microsoft.com/en-us/library/system.data.objects.mergeoption.aspx

QUESTION 104
How do you define a WCF Data Service query to grab the first 10 records. Options are something like:

A.    DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption(“$top”, “10”);
B.    DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption(“$filter”, “10”);
C.    DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption(“$select”, “10”);
D.    DataServiceQuery<Order> selectedOrders = context.Orders.AddQueryOption(“$expand”, “10”);

Answer: A
Explanation:
Accessing Data Service Resources (WCF Data Services)
http://msdn.microsoft.com/en-us/library/dd728283.aspx
DataServiceQuery<TElement>.AddQueryOption Method
http://msdn.microsoft.com/en-us/library/cc646860.aspx

QUESTION 105
There are Entities-States Class, Cities class. Deleting of state id raises exception. Which of the following?

A.    EntityException
B.    ConstraintException
C.    UpdateException
D.    EntityUpdateException

Answer: B
Explanation:
ConstraintException Represents the exception that is thrown when attempting an action that violates a constraint.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.ConstraintException
EntityException Represents Entity Framework-related errors that occur in the EntityClient namespace.
The EntityException is the base class for all Entity Framework exceptions thrown by the EntityClient.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.EntityException
System.Data.EntityCommandCompilationException
System.Data.EntityCommandExecutionException
System.Data.EntitySqlException
System.Data.MappingException
System.Data.MetadataException
System.Data.ProviderIncompatibleException
UpdateException
The exception that is thrown when modifications to object instances cannot be persisted to the data source.
System.Object
System.Exception
System.SystemException
System.Data.DataException
System.Data.UpdateException
System.Data.OptimisticConcurrencyException
EntityException Class
http://msdn.microsoft.com/en-us/library/system.data.entityexception.aspx
ConstraintException Class
http://msdn.microsoft.com/en-us/library/system.data.constraintexception.aspx
UpdateException Class
http://msdn.microsoft.com/en-us/library/system.data.updateexception.aspx

QUESTION 106
Class Workflow-Has Workstepflow inside. Get workflow data as well as related workstepflow.

A.    context.CreateObjectSet<WorkFlow>(“WorkFlowSteps” .Where(i)WorkFlowSteps == workflow.WorkFlowSteps);
B.    context.LoadProperty(workFlow,”WorkFlow”)
C.    context.CreateObjectSet<WorkFlowSteps>(WorkFlow .Where(i)WorkFlow == workflow);
D.    context.LoadProperty(workflow Function(i)WorkFlowSteps)

Answer: B

QUESTION 107
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application. A file named books.xml contains the following XML.
<bib>
   <book title=”Programming in Unix” year=”1992″>
      <author>Author1</author>
      <author>Author2</author>
      <author> Author 3 </author>
   </book>
</bib>
The application must generate an XML result that contains an XML element named BookTitle for each book. The text content of the element must contain the title of the book. You need to create a query that generates the new XML result. What should you do?

A.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.Descendants()
where node.Name.LocalName == “book”
select new XElement(“BookTitle”, node.FirstAttribute.Value);
B.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.DescendantNodes()
where node.ToString() == “book”
select new XText(“BookTitle” + node.ToString());
C.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.Descendants()
where node.Name.LocalName == “book”
select new XElement(“BookTitle”).Value = node.FirstAttribute.Value;
D.    XDocument document = XDocument.Load(“books.xml”);
var query = from node in document.DescendantNodes()
where node.ToString() == “book”
select new XElement(“BookTitle”, node.ToString());

Answer: A

QUESTION 108
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The application has the entity model shown in the following diagram. The application must create a projection of the unique set of names and year-to-date sales for territories where at least one sales person had sales last year of more than $100,000. The projection must consist of properties named Sales and Name. You need to write a query that will generate the required projection. Which code segment should you use?

A.    (from person in model.SalesPersons
where (person.SalesLastYear > 100000)
select new {
Name = person.SalesTerritory.Name,
Sales = person.SalesTerritory.SalesYTD
}
).Distinct();
B.    (from person in model.SalesPersons
where (person.SalesLastYear > 100000)
select new {
Name = person.SalesTerritory.Name,
Sales = person.SalesTerritory.SalesYTD
}
);
C.    model.SalesTerritories.
Where( t => t.SalesPersons.Any( p => p.SalesLastYear > 100000))
.Select( t=> new  { t.Name, t.SalesYTD})
.Distinct();
D.    model.SalesTerritories.
Where( t=> t.SalesPersons.Any( p => p.SalesLastYear > 100000))
.Select( t=> new { t.Name, Sales = t.SalesYTD});

Answer: A

QUESTION 109
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database. You add the following stored procedure to the database:
CREATE PROCEDURE [dbo].[InsertTag]
@Name nvarchar (15)
AS
INSERT INTO [dbo].[Tags] (Name) VALUES(@Name)
RETURN @@ROWCOUNT
You need to invoke the stored procedure by using an open SqlConnection named conn. Which code segment should you use?

A.    SqlCommand cmd = new SqlCommand(“EXEC InsertTag”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();
B.    SqlCommand cmd = new SqlCommand(“EXEC InsertTag”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();
C.    SqlCommand cmd = new SqlCommand(“InsertTag”, conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();
D.    SqlCommand cmd = new SqlCommand(“InsertTag”, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(“@Name”, “New Tag 1”);
cmd.ExecuteNonQuery();

Answer: D
Explanation:
http://msdn.microsoft.com/en-us/library/yy6y35y8(v=vs.71).aspx

QUESTION 110
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database. The database contains a ClassStudent table that contains the StudentID for students who are enrolled in the classes. You add the following stored procedure to the database:
CREATE PROCEDURE [dbo].[GetNumEnrolled]
@ClassID INT,
@NumEnrolled INT OUTPUT
AS BEGIN
SET NOCOUNT ON
SELECT @NumEnrolled = COUNT(StudentID)
FROM ClassStudent
WHERE (ClassID = @ClassID)
END
You write the following code. (Line numbers are included for reference only.)
01 private int GetNumberEnrolled(string classID)
02 {
03    using (SqlConnection conn = new SqlConnection(GetConnectionString())
04    {
05       SqlCommand cmd = new SqlCommand(“GetNumEnrolled”, conn);
06       cmd.CommandType = CommandType.StoredProcedure;
07       SqlParameter parClass = cmd.Parameters.Add(“@ClassID”, SqlDbType.Int, 4, “classID”);
08       SqlParameter parNum = cmd.Parameters.Add(“@NumEnrolled”, SqlDbType.Int);
09       …
10       conn.Open()
11       …
12    }
13 }
You need to ensure that the GetNumberEnrolled method returns the number of students who are enrolled for a specific class. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Insert the following code at line 09.
parNum.Direction = ParameterDirection.Input;
B.    Insert the following code at line 09.
parNum.Direction = ParameterDirection.Output;
C.    Insert the following code at line 11.
int numEnrolled = 0;
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
numEnrolled = numEnrolled + (int)cmd.Parameters[“@NumEnrolled”].Value;
}
return numEnrolled;
D.    Insert the following code at line 11.
cmd.ExecuteNonQuery();
return (int)parNum.Value;

Answer: BD


http://www.passleader.com/70-516.html

QUESTION 111
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. You define a Category class by writing the following code segment. (Line numbers are included for reference only.)
01 public class Category
02 {
03    public int CategoryID { get; set; }
04    public string CategoryName { get; set; }
05    public string Description { get; set; }
06    public byte[] Picture { get; set; }
07    …
08 }
You need to add a collection named Products to the Category class. You also need to ensure that the collection supports deferred loading. Which code segment should you insert at line 07?

A.    public static List <Product> Products { get; set; }
B.    public virtual List <Product> Products { get; set; }
C.    public abstract List <Product> Products { get; set; }
D.    protected List <Product> Products { get; set; }

Answer: B
Explanation:
One of the requirements for lazy loading proxy creation is that the navigation properties must be declared virtual (Overridable in Visual Basic). If you want to disable lazy loading for only some navigation properties, then make those properties non-virtual.
Loading Related Objects (Entity Framework)
http://msdn.microsoft.com/en-us/library/gg715120(v=vs.103).aspx

QUESTION 112
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Forms application. You plan to deploy the application to several shared client computers. You write the following code segment. (Line numbers are included for reference only.)
01 Configuration config = ConfigurationManager.OpenExeConfiguration(exeConfigName);
02 …
03 config.Save();
04 …
You need to encrypt the connection string stored in the .config file. Which code segment should you insert at line 02?

A.    ConnectionStringsSection section =
config.GetSection(“connectionString”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“DataProtectionConfigurationProvider”);
B.    ConnectionStringsSection section =
config.GetSection(“connectionStrings”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“DataProtectionConfigurationProvider”);
C.    ConnectionStringsSection section =
config.GetSection(“connectionString”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“RsaProtectedConfigurationProvider”);
D.    ConnectionStringsSection section =
config.GetSection(“connectionStrings”)
as ConnectionStringsSection;
section.SectionInformation.ProtectSection
(“RsaProtectedConfigurationProvider”);

Answer: D

QUESTION 113
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the ADO.NET Entity Framework to model entities. The database includes objects based on the exhibit. The application includes the following code segment. (Line numbers are included for reference only.)
01 using (AdventureWorksEntities context = new AdventureWorksEntities()){
02    …
03    foreach (SalesOrderHeader order in customer.SalesOrderHeader){
04       Console.WriteLine(String.Format(“Order: {0} “, order.SalesOrderNumber));
05       foreach (SalesOrderDetail item in order.SalesOrderDetail){
06          Console.WriteLine(String.Format(“Quantity: {0} “, item.Quantity));
07          Console.WriteLine(String.Format(“Product: {0} “, item.Product.Name));
08       }
09    }
10 }
You want to list all the orders for a specified customer. You need to ensure that the list contains the following fields:
– Order number
– Quantity of products
– Product name
Which code segment should you insert at line 02?

A.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“@customerId”, customerId)).First();
B.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“customerId”, customerId)).First();
C.    context.ContextOptions.LazyLoadingEnabled = true;
Contact customer = (from contact in context.Contact include(“SalesOrderHeader.SalesOrderDetail”) select conatct).FirstOrDefault();
D.    Contact customer = (from contact in context.Contact include(“SalesOrderHeader”) select conatct).FirstOrDefault();

Answer: B

QUESTION 114
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model entities. You write the following code segment. (Line numbers are included for reference only.)
01 AdventureWorksEntities context = new AdventureWorksEntities(“http://localhost:1234/AdventureWorks.svc”);
02 …
03 var q = from c in context.Customers
04            where c.City == “London”
05            orderby c.CompanyName
06            select c;
You need to ensure that the application meets the following requirements:
– Compares the current values of unmodified properties with values returned from the data source.
– Marks the property as modified when the properties are not the same.
Which code segment should you insert at line 02?

A.    context.MergeOption = MergeOption.AppendOnly;
B.    context.MergeOption = MergeOption.PreserveChanges;
C.    context.MergeOption = MergeOption.OverwriteChanges;
D.    context.MergeOption = MergeOption.NoTracking;

Answer: B
Explanation:
PreserveChanges-Objects that do not exist in the object context are attached to the context. If the state of the entity is Unchanged, the current and original values in the entry are overwritten with data source values. The state of the entity remains Unchanged and no properties are marked as modified. If the state of the entity is Modified, the current values of modified properties are not overwritten with data source values. The original values of unmodified properties are overwritten with the values from the data source. In the .NET Framework version 4, the Entity Framework compares the current values of unmodified properties with the values that were returned from the data source. If the values are not the same, the property is marked as modified.
MergeOption Enumeration
http://msdn.microsoft.com/en-us/library/system.data.objects.mergeoption.aspx

QUESTION 115
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model entities. You write the following code segment. (Line numbers are included for reference only.)
01 public partial class SalesOrderDetail : EntityObject
02 {
03    partial void OnOrderQtyChanging(short value)
04    {
05       …
06       {
07          …
08       }
09    }
10 }
You need to find out whether the object has a valid ObjectStateEntry instance. Which code segment should you insert at line 05?

A.    if (this.EntityState != EntityState.Detached)
B.    if (this.EntityState != EntityState.Unchanged)
C.    if (this.EntityState != EntityState.Modified)
D.    if (this.EntityState != EntityState.Added)

Answer: A

QUESTION 116
You use Microsoft Visual Studio 2010, Microsoft Sync Framework, and Microsoft .NET Framework 4.0 to create an application. You have a ServerSyncProvider connected to a Microsoft SQL Server database. The database is hosted on a Web server. Users will use the Internet to access the Customer database through the ServerSyncProvider. You write the following code segment. (Line numbers are included for reference only.)
01 SyncTable customerSyncTable = new SyncTable(“Customer”);
02 customerSyncTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
03 …
04 customerSyncTable.SyncGroup = customerSyncGroup;
05 this.Configuration.SyncTables.Add(customerSyncTable);
You need to ensure that the application meets the following requirements:
– Users can modify data locally and receive changes from the server.
– Only changed rows are transferred during synchronization.
Which code segment should you insert at line 03?

A.    customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
B.    customerSyncTable.SyncDirection = SyncDirection.Snapshot;
C.    customerSyncTable.SyncDirection = SyncDirection.Bidirectional;
D.    customerSyncTable.SyncDirection = SyncDirection.UploadOnly;

Answer: C

QUESTION 117
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. The service connects to a Microsoft SQL Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 Web server. The application works correctly in the development environment. However, when you connect to the service on the production server, attempting to update or delete an entity results in an error. You need to ensure that you can update and delete entities on the production server. What should you do?

A.    Add the following line of code to the InitializeService method of the service:
config.SetEntitySetAccessRule (“*”, EntitySetRights.WriteDelete | EntitySetRights.WriteInsert);
B.    Add the following line of code to the InitializeService method of the service:
config.SetEntitySetAccessRule (“*”, EntitySetRights.WriteDelete | EntitySetRights.WriteMerge);
C.    Configure IIS to allow the PUT and DELETE verbs for the .svc Application Extension.
D.    Configure IIS to allow the POST and DELETE verbs for the .svc Application Extension.

Answer: C

QUESTION 118
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 database includes a table named dbo.Documents that contains a column with large binary data. You are creating the Data Access Layer (DAL). You add the following code segment to query the dbo.Documents table. (Line numbers are included for reference only.)
01 public void LoadDocuments(DbConnection cnx)
02 {
03    var cmd = cnx.CreateCommand();
04    cmd.CommandText = “SELECT * FROM dbo.Documents”;
05    …
06    cnx.Open();
07    …
08    ReadDocument(reader);
09 }
You need to ensure that data can be read as a stream. Which code segment should you insert at line 07?

A.    var reader = cmd.ExecuteReader(CommandBehavior.Default);
B.    var reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly);
C.    var reader = cmd.ExecuteReader(CommandBehavior.KeyInfo);
D.    var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);

Answer: D

QUESTION 119
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You create a DataSet object in the application. You add two DataTable objects named App_Products and App_Categories to the DataSet. You add the following code segment to populate the DataSet object. (Line numbers are included for reference only.)
01 public void Fill(SqlConnection cnx, DataSet ds)
02 {
03    var cmd = cnx.CreateCommand();
04    cmd.CommandText = “SELECT * FROM dbo.Products; ” + “SELECT * FROM dbo.Categories”;
05    var adapter = new SqlDataAdapter(cmd);
06    …
07 }
You need to ensure that App_Products and App_Categories are populated from the dbo.Products and dbo.Categories database tables. Which code segment should you insert at line 06?

A.    adapter.Fill(ds, “Products”);
adapter.Fill(ds, “Categories”);
B.    adapter.Fill(ds.Tables[“App_Products”]);
adapter.Fill(ds.Tables[“App_Categories”]);
C.    adapter.TableMappings.Add(“Table”, “App_Products”);
adapter.TableMappings.Add(“Table1”, “App_Categories”);
adapter.Fill(ds);
D.    adapter.TableMappings.Add(“Products”, “App_Products”);
adapter.TableMappings.Add(“Categories”, “App_Categories”);
adapter.Fill(ds);

Answer: D
Explanation:
Table Mapping in ADO.NET
http://msdn.microsoft.com/en-us/library/ms810286.aspx

QUESTION 120
You are calling a stored procedure in SQL Server 2008 that returns a UDT as an output parameter. This UDT, called MyCompanyType, was created by your company. The UDT has a method called GetDetails that you want to execute in your client application. What must you do to execute the method? (Each correct answer presents part of a complete solution. Choose three.)

A.    Set the SqlDbType of the parameter to SqlDbType.Udt.
B.    Set the UdtTypeName of the parameter to MyCompanyType.
C.    Call the ExecuteXmlReader method on the SqlCommand to serialize the UDT as XML.
D.    In the client application, set a reference to the assembly in which the UDT is.

Answer: ABD


http://www.passleader.com/70-516.html

[New Exam Dumps] Training PassLeader New 70-341 226q VCE and PDF Dumps To Pass Exam

$
0
0

New Updated 70-341 Exam Questions from PassLeader 70-341 PDF dumps! Welcome to download the newest PassLeader 70-341 VCE dumps: http://www.passleader.com/70-341.html (226 Q&As)

Keywords: 70-341 exam dumps, 70-341 exam questions, 70-341 VCE dumps, 70-341 PDF dumps, 70-341 practice tests, 70-341 study guide, 70-341 braindumps, Microsoft Core Solutions of Microsoft Exchange Server 2013 Exam

NEW QUESTION 220
You verify that one email message sent to one mailboxes on EX1 are delivered successfully. You also verify that all of mailbox databases on EX1 are mounted. Delete 20 GB of unnecessary data on EX1. You discover that the hard disk drive on EX1 has only 10 GB of free space. You delete 20 GB of unnecessary data on EX1. Users report that now they are receiving all of their email messages successfully to their mailbox. You need to ensure that EX1 will prevent the delivery of email messages to mailboxes only if less than 2 GB of hard disk space is available. What should you do?

A.    Modify the Organization transport settings.
B.    Disable the Safety Net feature.
C.    Modify the EdgeTransportexe.config file.
D.    Modify the mailbox database settings.

Answer: D

NEW QUESTION 221
Hotspot Question
You have an Exchange Server 2013 organization. Each data center contains several Exchange servers and connects directly to the Internet. Each office has a Send connector to the Internet. You configure each office as a separate site and you configure Main1 as a hub site. The company opens a branch office that contains a small data center. You deploy an Exchange Server 2013 server to the data center. The data center has a direct network link to Main1. All of the site link costs are set to the default values. In the table below identify through which office the email message will be transmitted first for each scenario.

Answer: See full version from http://www.passleader.com/70-341.html

NEW QUESTION 222
You have an Exchange Server 2013 organization that contains three Client Access servers named EX1, EX2, and EX3. The organization also contains eight Mailbox servers. All users have client computers that have Microsoft Outlook 2013 installed. You create a Network Load Balancing (NLB) cluster and add all of the Client Access servers as hosts in the cluster. The cluster has the following configurations:
– The default host is set to EX1.
– A port rule is configured for HTTPS traffic.
– The port rule has the affinity parameter set to Single.
– The port rule has the filtering mode set to Single host.
The port rule has the Handling priority set to the default option. You discover that Outlook always connects to EX1. You need to ensure that client connection are handled by all three Client Access servers. What should you modify?

A.    the filtering mode of the port rule.
B.    the affinity parameter of the port rule.
C.    the handling priority of the port rule.
D.    the default host of the cluster.

Answer: C

NEW QUESTION 223
……


Download the newest PassLeader 70-341 dumps from passleader.com now! 100% Pass Guarantee!

70-341 PDF dumps & 70-341 VCE dumps: http://www.passleader.com/70-341.html (226 Q&As)

[New Exam Dumps] PassLeader New 137q 642-997 Exam Questions with Free PDF Study Guide Download

$
0
0

New Updated 642-997 Exam Questions from PassLeader 642-997 PDF dumps! Welcome to download the newest PassLeader 642-997 VCE dumps: http://www.passleader.com/642-997.html (137 Q&As)

Keywords: 642-997 exam dumps, 642-997 exam questions, 642-997 VCE dumps, 642-997 PDF dumps, 642-997 practice tests, 642-997 study guide, 642-997 braindumps, Implementing Cisco Data Center Unified Fabric (DCUFI) Exam

NEW QUESTION 101
If you are using NAT in your data center, which load balancing would you be likely to use within your GLBP configuration?

A.    none
B.    round-robin
C.    host dependent
D.    weighted

Answer: C

NEW QUESTION 102
Which command specifies a load-balancing method based on the MAC address of a host where the same forwarder is always used for a particular host while the number of GLBP group members remains unchanged?

A.    load-balancing host-dependent
B.    load-balancing mac-pinning
C.    load-balancing round-robin
D.    load-balancing weighted

Answer: A

NEW QUESTION 103
Which feature allows routing protocols to remain in the data path during a supervisor failover?

A.    Cisco Nonstop Forwarding
B.    Cisco Stateful Switchover
C.    Cisco Express Forwarding
D.    Cisco Route Processor Redundancy

Answer: A

NEW QUESTION 104
Which two functions are enabled when you set up vPC+ at the FabricPath edge? (Choose two.)

A.    the ability to attach Cisco Fabric Extenders in FEX active/active mode
B.    the ability to stop all Layer 3 egress traffic
C.    the ability to attach servers to edge switches with port-channel teaming
D.    the ability to attach additional Classic Ethernet switches in vPC+ mode

Answer: AC

NEW QUESTION 105
How does addition of bandwidth between spine and leaf switches in a FabricPath architecture get utilized?

A.    Links between the same set of switches are automatically added to a port channel.
B.    Adding additional bandwidth is handled dynamically using the 802.1AX protocol.
C.    Traffic is load shared automatically across the available paths to the destination.
D.    FabricPath uses hardware bonding of physical interfaces to form higher-speed links.

Answer: C

NEW QUESTION 106
Which two advantages does FabricPath have over Spanning Tree in implementing a loop-free network topology design? (Choose two.)

A.    Blocked links can be brought in to service if active links fail.
B.    Convergence times are faster.
C.    Multipath forwarding is supported for unicast and multicast Layer 2 and Layer 3 traffic.
D.    Unknown unicast addresses are flooded in through the originating port.

Answer: BC

NEW QUESTION 107
Which four statements about reserved VLANs in Cisco NX-OS are true? (Choose four.)

A.    The range of reserved VLANs cannot be changed.
B.    The number of reserved VLANs is 96.
C.    A change to the range of reserved VLANs can be performed only in the VDC default.
D.    A write-erase procedure restores the default reserved VLAN range.
E.    The number of reserved VLANs is 128.
F.    A reload is needed for changes to take place.
G.    The configuration must be saved for changes to take place.

Answer: CEFG

NEW QUESTION 108
Which two RFCs are supported by Cisco NX-OS devices for OSPFv2? (Choose two.)

A.    RFC 2238
B.    RFC 1918
C.    RFC 1583
D.    RFC 2453
E.    RFC 2740

Answer: AC

NEW QUESTION 109
Which action limits the maximum number of routes that are allowed in the routing table?

A.    Use a filter BGP.
B.    Use only static routes.
C.    Use the maximum routes command inside address family.
D.    Use a route map to filter routes.

Answer: C

NEW QUESTION 110
Which three options of encryption are supported in PIM hello messages? (Choose three.)

A.    cleartext
B.    DES-SHA1
C.    DES-CBC3-SHA
D.    Cisco Type 7
E.    RC4-SHA
F.    3DES

Answer: ADF

NEW QUESTION 111
Which command is used to associate EID-to-RLOC for a LISP site?

A.    #feature lisp
B.    #ipv6 lisp itr
C.    #ip lisp database-mapping
D.    #ip lisp itr map-resolver

Answer: C

NEW QUESTION 112
In OTV, how are the VLANs split when a site has two edge devices?

A.    They are configured manually by user.
B.    They are split in half among each edge device.
C.    They are split as odd and even VLAN IDs on each edge device.
D.    It is not possible to have two edge devices in same site.

Answer: C

NEW QUESTION 113
Which statement about the MPLS feature set is true?

A.    It is not license dependent.
B.    It can be installed from any VDC.
C.    It can be enabled only in the default VDC.
D.    It must be installed from the default VDC.

Answer: D

NEW QUESTION 114
……


Download the newest PassLeader 642-997 dumps from passleader.com now! 100% Pass Guarantee!

642-997 PDF dumps & 642-997 VCE dumps: http://www.passleader.com/642-997.html (137 Q&As)

[New Exam Dumps] Do Not Miss 300-207 Exam Dumps Shared By PassLeader — 100% Exam Pass Guarantee

$
0
0

New Updated 300-207 Exam Questions from PassLeader 300-207 PDF dumps! Welcome to download the newest PassLeader 300-207 VCE dumps: http://www.passleader.com/300-207.html (209 Q&As)

Keywords: 300-207 exam dumps, 300-207 exam questions, 300-207 VCE dumps, 300-207 PDF dumps, 300-207 practice tests, 300-207 study guide, 300-207 braindumps, Implementing Cisco Threat Control Solutions Exam

NEW QUESTION 175
Which type of server is required to communicate with a third-party DLP solution?

A.    an HTTPS server
B.    an HTTP server
C.    an ICAP-capable proxy server
D.    a PKI certificate server

Answer: C

NEW QUESTION 176
Which feature does Acceptable Use Controls use to implement Cisco AVC?

A.    ISA
B.    Cisco Web Usage Controls
C.    Cisco WSA
D.    Cisco ESA

Answer: B

NEW QUESTION 177
You have configured a VLAN pair that is connected to a switch that is unable to pass traffic. If the IPS is configured correctly, which additional configuration must you perform to enable the switch to pass traffic?

A.    Configure access ports on the switch.
B.    Configure the trunk port on the switch.
C.    Enable IP routing on the switch.
D.    Enable ARP inspection on the switch.

Answer: A

NEW QUESTION 178
You ran the ssh generate-key command on the Cisco IPS and now administrators are unable to connect. Which action can be taken to correct the problem?

A.    Replace the old key with a new key on the client.
B.    Run the ssh host-key command.
C.    Add the administrator IP addresses to the trusted TLS host list on the IPS.
D.    Run the ssh authorized-keys command.

Answer: A

NEW QUESTION 179
Which piece of information is required to perform a policy trace for the Cisco WSA?

A.    the URL to trace
B.    the source IP address of the trace
C.    authentication credentials to make the request
D.    the destination IP address of the trace

Answer: A

NEW QUESTION 180
What is a valid search parameter for the Cisco ESA find event tool?

A.    Envelope Origination
B.    Envelope Type
C.    Message ID
D.    Download Type

Answer: C

……

NEW QUESTION 204
Lab Simulation


……


Download the newest PassLeader 300-207 dumps from passleader.com now! 100% Pass Guarantee!

300-207 PDF dumps & 300-207 VCE dumps: http://www.passleader.com/300-207.html (209 Q&As)

[New Exam Dumps] Free PassLeader 171q 1Y0-201 VCE Braindump with Free PDF Study Guide

$
0
0

New Updated 1Y0-201 Exam Questions from PassLeader 1Y0-201 PDF dumps! Welcome to download the newest PassLeader 1Y0-201 VCE dumps: http://www.passleader.com/1y0-201.html (171 Q&As)

Keywords: 1Y0-201 exam dumps, 1Y0-201 exam questions, 1Y0-201 VCE dumps, 1Y0-201 PDF dumps, 1Y0-201 practice tests, 1Y0-201 study guide, 1Y0-201 braindumps, Managing Citrix XenDesktop 7.6 Solutions Exam

NEW QUESTION 168
Simulation
Scenario:
A Citrix Administrator must modify the store configuration on a StoreFront server to provide users with access to desktop OS machines and server OS hosted applications. A Delivery Controller named Controller-1 needs to be added to the existing site. Controller- 1 will serve as the Secure Ticket Authority. The administrator has been instructed to ensure communication with the Delivery Controllers takes place over port 8080.
Tasks:
1. Modify the store named Apps and Desktops to provide users with access to desktop OS machines and server OS hosted applications using hostnames only. Do NOT assume the FQDN.
2. Ensure communication with the Delivery Controllers take place over port 8080.
3. Set up Controller-1 as the Secure Ticket Authority.

Answer:
Citrix StoreFront Configuration


1. When the wizard starts enter a store name.

2. Now we need to add the delivery controllers (Controller1) that StoreFront will interface with


……

6. Once the store is created it will give you the web browser URL that you can use to access it. Also take note that to access StoreFront from a web browser you must append “Web” to the store URL, as the URL shows below. Don’t try going to /Citrix/Store as that won’t work.

7. To change the StoreFront base URL you can go to the Server Group node and in the right pane select Change Base URL. Change URL to use HTTPS and port 8080

8. Back in the StoreFront console, after refreshing, you can see that the service is using HTTPS.

9. One quick tweak to make authentication easier is to set a default domain. This way the user doesn’t have to enter a domain when authenticating to the StoreFront web site. Locate the Authentication node, then in the right pane click on Configure Trusted Domains.

And that’s pretty much it to get an operational StoreFront. If you open your browser and go to the full web store URL you should get a green bubbly Citrix receiver page.

Creating a XenDesktop 7 Delivery Group
1. When a new Delivery Group is created it will list all of your machine catalogs. It lists the number of computers in that catalog and one can choose how many to assign to my delivery group. You need not put all of the computers into a single delivery group.

2. Next up choose what combination of desktops and applications you want to deliver. But here you could assign the same desktop VM to everyone, but have different delivery groups that customize the mix of XenApp applications they get delivered.

3. Now you have to define what users or groups are part of the delivery group.

4. An optional step at this point is to define the StoreFront server(s) which the Receiver inside of the desktop will be configured to use. A great feature if you are using XenApp, or perhaps have another XenDesktop farm for R&D that some users should have access to.


5. The final step is configuring a Delivery Group name, and a display name. The display name is something users will see, so keep it simple.

6. And that’s it! A few seconds later you will have a nice delivery group in your console. In the right hand column make sure your VMs show a Registered state. If not, then you may have some networking (DHCP, DNS) or other issues preventing the VDA from properly communicating with the desktop controller.

7. Once the delivery group is created, you can Edit it and find more options that weren’t presented during the simplified wizard. For example, you can allow a user to access more than one desktop from the pool, change the color depth, time zone, and secure the ICA protocol with some lightweight encryption.

NEW QUESTION 169
……


Download the newest PassLeader 1Y0-201 dumps from passleader.com now! 100% Pass Guarantee!

1Y0-201 PDF dumps & 1Y0-201 VCE dumps: http://www.passleader.com/1y0-201.html (171 Q&As)

[New Exam Dumps] Pass 210-065 Exam By Training PassLeader Free 210-065 Study Materials

$
0
0

New Updated 210-065 Exam Questions from PassLeader 210-065 PDF dumps! Welcome to download the newest PassLeader 210-065 VCE dumps: http://www.passleader.com/210-065.html (146 Q&As)

Keywords: 210-065 exam dumps, 210-065 exam questions, 210-065 VCE dumps, 210-065 PDF dumps, 210-065 practice tests, 210-065 study guide, 210-065 braindumps, Implementing Cisco Video Network Devices (CIVND) Exam

NEW QUESTION 112
Which video input port is available on a Cisco DX80?

A.    DVI-D
B.    DVI-A
C.    VGA
D.    HDMI

Answer: D

NEW QUESTION 113
The microphone on a Cisco TelePresence System 3000 is switching incorrectly to a camera that does not have an active speaker. What is the first step that an engineer should take to troubleshoot this issue?

A.    Check whether the microphone is properly plugged in.
B.    Run the microphone calibration procedure.
C.    Plug all microphones into the primary codec.
D.    Check whether the cable from the microphone is plugged into the correct receptor on the codec.

Answer: B

NEW QUESTION 114
A company wants to enable a mobile user to connect to the corporate network to access calls, messages, video conferencing, and web collaboration. Which product provides these features for the user?

A.    Cisco WebEx Connect
B.    Cisco Unified Presence
C.    Cisco TelePresence SX20
D.    Cisco Jabber

Answer: D

NEW QUESTION 115
An engineer is configuring mobile and remote access. Which three configuration tasks should the engineer perform? (Choose three.)

A.    Manually configure a Cisco Unified Communications Manager neighbor zone on the Cisco Expressway Core.
B.    Add the Cisco Unified Communications Manager root certificate to the Cisco Expressway Core CTL.
C.    Enable TLS verify mode for the traversal zone.
D.    Add the Cisco Unified Communications domain before enabling services on the Cisco Expressway Core.
E.    Enable H.323 on the Cisco Unified Communications Manager neighbor zone.
F.    Add the Cisco Expressway Edge root certificate to the Cisco Unified Communications Manager CTL.

Answer: BCD

NEW QUESTION 116
A customer is looking for a Cisco TelePresence Immersive System that is designed for at least seven participants. Which two products meet this customer’s requirements? (Choose two.)

A.    Cisco TelePresence CTS3022
B.    Cisco TelePresence TX9000
C.    Cisco TelePresence TX9200
D.    Cisco TelePresence IX5000
E.    Cisco TelePresence IX5200
F.    Cisco TelePresence TX1310-65

Answer: CE

NEW QUESTION 117
Cisco DX Series endpoints run on which operating system?

A.    TC
B.    Android
C.    CE
D.    Windows

Answer: B

NEW QUESTION 118
Which bridge solution requires Cisco TelePresence Conductor?

A.    Cisco TelePresence Server operating in remotely managed mode
B.    Cisco TelePresence Server operating in locally managed mode
C.    Cisco TelePresence MCU operating in remotely managed mode
D.    Cisco TelePresence MCU operating in locally managed mode

Answer: A

NEW QUESTION 119
Which two feature keys are valid for both Cisco TelePresence MCU and Cisco TelePresence Server? (Choose two.)

A.    video firewall
B.    web conferencing
C.    encryption
D.    cluster support
E.    third-party interoperability

Answer: CD

NEW QUESTION 120
Which codec represents video that is supported by Cisco TelePresence endpoints?

A.    H.263
B.    H.323
C.    H.264
D.    H.262

Answer: C

NEW QUESTION 121
Which three video endpoints can you set back to factory reset by using physical button presses? (Choose three.)

A.    Cisco TelePresence C40
B.    Cisco TelePresence EX90
C.    Cisco TelePresence C60
D.    Cisco TelePresence SX20
E.    Cisco TelePresence EX60
F.    Cisco TelePresence C90

Answer: BDE

NEW QUESTION 122
You want to output SIP messaging to the console of a Cisco TelePresence endpoint running Cisco TelePresence Conductor software. Which two commands can you enter into the CLI together to accomplish this goal? (Choose two.)

A.    log ctx SipPacket debug 9
B.    log output on
C.    log ctx output
D.    log SipPacket debug 9
E.    log output console

Answer: AB

NEW QUESTION 123
……


Download the newest PassLeader 210-065 dumps from passleader.com now! 100% Pass Guarantee!

210-065 PDF dumps & 210-065 VCE dumps: http://www.passleader.com/210-065.html (146 Q&As)

[New Exam Dumps] Valid 206q 640-875 Practice Test with Free PDF Study Guide Download

$
0
0

New Updated 640-875 Exam Questions from PassLeader 640-875 PDF dumps! Welcome to download the newest PassLeader 640-875 VCE dumps: http://www.passleader.com/640-875.html (206 Q&As)

Keywords: 640-875 exam dumps, 640-875 exam questions, 640-875 VCE dumps, 640-875 PDF dumps, 640-875 practice tests, 640-875 study guide, 640-875 braindumps, Building Cisco Service Provider Next-Generation Networks, Part 1 (SPNGN1) Exam

NEW QUESTION 144
At what layer of the OSI model is the Label Distribution Protocol present?

A.    data link
B.    transport
C.    application
D.    presentation
E.    session

Answer: A

NEW QUESTION 145
Which subnetwork mask should be used in a point-to-point link in order to use IPv4 address block more efficiently?

A.    209.165.201.0/32
B.    209.165.201.0/31
C.    209.165.201.0/30
D.    209.165.201.0/29
E.    209.165.201.0/24

Answer: B

NEW QUESTION 146
……

Download the newest PassLeader 640-875 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/640-875.html

NEW QUESTION 147
Which three are features present on both ICMPv4 and ICMPv6? (Choose three.)

A.    connectivity tests
B.    address assignment
C.    information error messaging
D.    address resolution
E.    mobile IPv4 support
F.    multicast group management
G.    mobile IPv6 support
H.    fragmentation needed notification

Answer: ACH

NEW QUESTION 148
Company policy only allows SSH for remote access into Cisco routers. Which configuration would only allow SSH?

A.    access-lists 101 deny tcp any eq telnet
B.    transport input SSH
C.    access-class 101 in
D.    access-class 101 out
E.    transport preferred SSH

Answer: B

NEW QUESTION 149
……

Download the newest PassLeader 640-875 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/640-875.html

NEW QUESTION 155
You plan to implement QoS on a network, using these four classes:
– A class for real-time applications
– A class for interactive applications
– A class for batch applications
– A scavenger class
Which two classes are interactive applications? (Choose two.)

A.    email
B.    SSH
C.    database updates
D.    IP telephony
E.    file transfers

Answer: BC

NEW QUESTION 156
Which command assigns an IP address to the Loopback1 interface on a Cisco IOS Router?

A.    ip address 192.168.41.111 255.255.255.240
B.    set ip 127.0.0.1/32
C.    ip address 127.0.0.1 255.255.255.0
D.    ip address 169.254.47.81 255.255.0.0

Answer: D

NEW QUESTION 157
You are configuring manual route summarization in EIGRP. Which two networks are summarized into 10.134.17.64/27? (Choose two.)

A.    10.134.17.64 255.255.255.240
B.    10.134.17.100/30
C.    10.134.17.0 255.255.255.128
D.    10.134.17.92/30

Answer: AD

NEW QUESTION 158
Which two IP addresses can be assigned to hosts? (Choose two.)

A.    192.168.1.255/23
B.    192.168.1.255/22
C.    172.16.28.7/29
D.    224.0.250.1/24
E.    10.192.225.225/27

Answer: BE

NEW QUESTION 159
Which three statements about Ethernet frames are true? (Choose three.)

A.    Every frame starts with a preamble.
B.    FCS is used to recover single-bit errors.
C.    The source address is positioned behind the destination address.
D.    If the data field is too short, it must be padded.
E.    The dot1q tag size is six bytes.
F.    The source and destination IP addresses are in the header.

Answer: ACD

NEW QUESTION 160
……

Download the newest PassLeader 640-875 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/640-875.html

NEW QUESTION 162
Two sites each have a different ASN. Which method do you use to share routing information between the sites?

A.    EIGRP
B.    IGP
C.    static routing
D.    OSPFv3
E.    BGP

Answer: E

NEW QUESTION 163
……


Download the newest PassLeader 640-875 dumps from passleader.com now! 100% Pass Guarantee!

640-875 PDF dumps & 640-875 VCE dumps: http://www.passleader.com/640-875.html (206 Q&As)


[New Exam Dumps] Free 140q 1Y0-301 Exam Questions From PassLeader For Free Download

$
0
0

New Updated 1Y0-301 Exam Questions from PassLeader 1Y0-301 PDF dumps! Welcome to download the newest PassLeader 1Y0-301 VCE dumps: http://www.passleader.com/1y0-301.html (140 Q&As)

Keywords: 1Y0-301 exam dumps, 1Y0-301 exam questions, 1Y0-301 VCE dumps, 1Y0-301 PDF dumps, 1Y0-301 practice tests, 1Y0-301 study guide, 1Y0-301 braindumps, Deploying Citrix XenDesktop 7.6 Solutions Exam

NEW QUESTION 140
Scenario:
Provisioning Services has been installed to facilitate the deployment of server OS and desktop OS machines. Currently, a pool of Windows 8 desktop OS machines is being used by the Imaging and Radiology team. A virtual machine OU named CCH Virtual Desktops has been created. However, users on the Imaging and Radiology team need to use their medical imaging applications that CANNOT be installed on their workstations due to insufficient resources. As the Citrix Engineer, you have been asked to provision desktop OS machines with sufficient resources to three Imaging and Radiology team members in order to allow them to use their new applications. All three of the desktop OS machines should be assigned the Win8 vDisk, and the desktop OS machines should maintain changes after reboot. Members of the Imaging and Radiology team need to be able to log into the CCH.com domain. The Windows 8 virtual machines were already created with the following information:

CCHWin801 – IR Desktop 1
•    IP Address: DHCP Assigned
•    MAC Address: 56:5b:b0:38:6a:54
•    NOT a member of Active Directory
•    CCHWin803 – IR Desktop 3
CCHWin802 – IR Desktop 2
•    IP Address: DHCP Assigned
•    MAC Address: be:c8:96:6e:89:c9
•    NOT a member of Active Directory
In order to save time, a copy of an existing Window 8 base image vDisk was created and named Win8 and is stored in the PVS StoreOI store. As the Citrix Engineer, use the existing site, store, and device collection to implement the tasks below.

Tasks:
1. Create and configure all 3 of the Windows 8 desktop OS machines as target devices to boot using the Win8 vDisk.
2. Name the target devices CCHWin801, CCHWin802, and CCHWin803.
3. Modify the vDisk as necessary to meet the requirements outlined in the scenario.

Answer:
XenDesktop 7 Machine Catalog

1. Create the VM in an existing catalog
2. Choose the OS type

3. We will be using VMs and Citrix Machine Creation Services, so the defaults are fine

4. Use the default

5. Choose the master image WIN8.vdisk

6. A great feature of XenDesktop is the ability to customize the catalog hardware at provisioning time, so you can offer different tiers of VMs from the exact same master image. No need to build up templates with the same OS and software stack, just to customize the vCPUs and memory specs

7.

8. After you kick off the provisioning process you get a nice status. MCS first makes a copy of your master VM, then does its magic to create copies


Download the newest PassLeader 1Y0-301 dumps from passleader.com now! 100% Pass Guarantee!

1Y0-301 PDF dumps & 1Y0-301 VCE dumps: http://www.passleader.com/1y0-301.html (140 Q&As)

[Pass Ensure VCE Dumps] Valid PassLeader 286q 70-516 Exam Questions With VCE and PDF Download (121-140)

$
0
0

Want To Pass The New 70-516 Exam Easily? DO NOT WORRY! PassLeader now is supplying the latest and 100 percent pass ensure 286q 70-516 PDF dumps and VCE dumps, the new updated 70-516 braindumps are the most accurate with all the new changed 70-516 exam questions, it will help you passing 70-516 exam easily and quickly. Now visit the our site passleader.com and get the valid 286q 70-516 VCE and PDF exam questions and FREE VCE PLAYER!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 121
You want to execute a SQL insert statement from your client application, so you set the CommandText property of the command object and open the connection. Which method will you execute on the command?

A.    ExecuteScalar
B.    ExecuteXmlReader
C.    ExecuteReader
D.    ExecuteNonQuery

Answer: D

QUESTION 122
In ADO.NET, which class can start an explicit transaction to update a SQL Server database?

A.    SqlCommand
B.    SqlConnection
C.    SqlParameter
D.    SqlException

Answer: B

QUESTION 123
You want to store the contents of a data set to an XML file so you can work on the data while disconnected from the database server. How should you store this data?

A.    As a SOAP file
B.    As a DataGram file
C.    As a WSDL file
D.    As an XML Schema file

Answer: B

QUESTION 124
To which of the following types can you add an extension method? (Each correct answer presents a complete solution. Choose five.)

A.    Class
B.    Structure (C# struct)
C.    Module (C# static class)
D.    Enum
E.    Interface
F.    Delegate

Answer: ABDEF

QUESTION 125
You want to page through an element sequence, displaying ten elements at a time, until you reach the end of the sequence. Which query extension method can you use to accomplish this? (Each correct answer presents part of a complete solution. Choose two.)

A.    Skip
B.    Except
C.    SelectMany
D.    Take

Answer: AD

QUESTION 126
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Data Model (EDM) to define a Customer entity. You need to add a new Customer to the data store without setting all the customer’s properties. What should you do?

A.    Call the Create method of the Customer object.
B.    Call the CreateObject method of the Customer object.
C.    Override the Create method for the Customer object.
D.    Override the SaveChanges method for the Customer object.

Answer: B
Explanation:
CreateObject<T> Creates and returns an instance of the requested type.

QUESTION 127
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 use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities. You need to ensure that the change-tracking information for the self-tracking entities can be used to update the database. Which ObjectContext method should you call after changes are made to the entities?

A.    Attach
B.    Refresh
C.    SaveChanges
D.    ApplyChanges

Answer: D
Explanation:
ApplyChanges takes the changes in a connected set of entities and applies them to an ObjectContext.
Starting with Microsoft Visual Studio 2010, the ADO.NET Self-Tracking Entity Generator template generates self-tracking entities.
This template item generates two .tt (text template) files: <model name>.tt and <model name>.Context.tt.
The <model name>.tt file generates the entity types and a helper class that contains the change-tracking logic that is used by self-tracking entities and the extension methods that allow setting state on self-tracking entities.
The <model name>.Context.tt file generates a typed ObjectContext and an extension class that contains ApplyChanges methods for the ObjectContext and ObjectSet classes. These methods examine the change-tracking information that is contained in the graph of self- tracking entities to infer the set of operations that must be performed to save the changes in the database.
Working with Self-Tracking Entities
http://msdn.microsoft.com/en-us/library/ff407090.aspx

QUESTION 128
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 manage Plain Old CLR Objects (POCO) entities. You create a new POCO class. You need to ensure that the class meets the following requirements:
– It can be used by an ObjectContext.
– It is enabled for change-tracking proxies.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Modify each mapped property to contain sealed and protected accessors.
B.    Modify each mapped property to contain non-sealed, public, and virtual accessors.
C.    Configure the navigation property to return a type that implements the ICollection interface.
D.    Configure the navigation property to return a type that implements the IQueryable interface.
E.    Configure the navigation property to return a type that implements the IEntityWithRelationships interface.

Answer: BC
Explanation:
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
Other POCO Considerations (page 412)

QUESTION 129
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 application allows users to make changes while disconnected from the data store. Changes are submitted to the data store by using the SubmitChanges method of the DataContext object. You receive an exception when you call the SubmitChanges method to submit entities that a user has changed in offline mode. You need to ensure that entities changed in offline mode can be successfully updated in the data store. What should you do?

A.    Set the ObjectTrackingEnabled property of DataContext to true.
B.    Set the DeferredLoadingEnabled property of DataContext to true.
C.    Call the SaveChanges method of DataContext with a value of false.
D.    Call the SubmitChanges method of DataContext with a value of System.Data.Linq.ConflictMode.ContinueOnConflict.

Answer: A
Explanation:
ObjectTrackingEnabled Instructs the framework to track the original value and object identity for this DataContext.
ObjectTrackingEnabled Property
http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.objecttrackingenabled.aspx

QUESTION 130
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the ADO.NET LINQ to SQL model to retrieve data from the database. The application will not modify retrieved data. You need to ensure that all the requested data is retrieved. You want to achieve this goal using the minimum amount of resources. What should you do?

A.    Set ObjectTrackingEnabled to true on the DataContext class.
B.    Set ObjectTrackingEnabled to false on the DataContext class.
C.    Set DeferredLoadingEnabled to true on the DataContext class.
D.    Set DeferredLoadingEnabled to false on the DataContext class.

Answer: B
Explanation:
Setting property ObjectTrackingEnabled to false improves performance at retrieval time, because there are fewer items to track.
DataContext.ObjectTrackingEnabled Property
http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.objecttrackingenabled.aspx


http://www.passleader.com/70-516.html

QUESTION 131
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model your entities. You use Plain Old CLR Objects (POCO) entities along with snapshot-based change tracking. The code accesses the POCO entities directly. You need to ensure that the state manager synchronizes when changes are made to the object graph. Which ObjectContext method should you call?

A.    Refresh
B.    SaveChanges
C.    DetectChanges
D.    ApplyPropertyChanges

Answer: C
Explanation:
When working with POCO, you must call the DetectChanges method on the ObjectContext to attach the POCO entity to the ObjectContext. Be sure to call DetectChanges prior to calling SaveChanges. ApplyPropertyChanges Obsolete. Applies property changes from a detached object to an object already attached to the object context.
CHAPTER 6 ADO.NET Entity Framework
Lesson 2: Querying and Updating with the Entity Framework Attaching Entities to an ObjectContext (page 438)

QUESTION 132
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 application includes a Customer entity along with a CustomerKey property of the Guid type as shown in the following exhibit. You discover that when the application adds a new instance of a Customer, calling the SaveChanges method results in the following error message:
“Server generated keys are only supported for identity columns.”
You need to ensure that the application can add new Customer entities. What should you do?

A.    Add a handler for the ObjectContext.SavingChanges event. In the event handler, set the CustomerKey value.
B.    Add a handler for the ObjectContext.ObjectMaterialized event. In the event handler, set the CustomerKey value.
C.    Call the ObjectContext.Attach method before saving a Customer entity.
D.    Call the ObjectContext.CreateEntityKey method before saving a Customer entity.

Answer: A
Explanation:
SavingChanges() Event Occurs when changes are saved to the data source. ObjectMaterialized() Event Occurs when a new entity object is created from data in the data source as part of a query or load operation. Attach() Method Attaches an object or object graph to the object context when the object has an entity key. CreateEntityKey() Creates the entity key for a specific object, or returns the entity key if it already exists.
ObjectContext Class
http://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext.aspx

QUESTION 133
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model entities. The application connects to a Microsoft SQL Server database named AdventureWorks. The application includes the following code segment. (Line numbers are included for reference only.)
01 using (AdventureWorksEntities context = new AdventureWorksEntities())
02 {
03 ObjectQuery <SalesOrderHeader> orders = context.SalesOrderHeader.
    Where(“it.CreditCardApprovalCode IS NULL”).Top(“100”);
04 foreach (SalesOrderHeader order in orders){
05 order.Status = 4;
06 }
07     try {
08         context.SaveChanges();
09     }
10     catch (OptimisticConcurrencyException){
11         …
12     }
13 }
You need to resolve any concurrency conflict that can occur. You also need to ensure that local changes are persisted to the database. Which code segment should you insert at line 11?

A.    context.Refresh(RefreshMode.ClientWins, orders);
context.AcceptAllChanges();
B.    context.Refresh(RefreshMode.ClientWins, orders);
context.SaveChanges();
C.    context.Refresh(RefreshMode.StoreWins, orders);
context.AcceptAllChanges();
D.    context.Refresh(RefreshMode.StoreWins, orders);
context.SaveChanges();

Answer: B
Explanation:
SaveChanges() Persists all updates to the data source and resets change tracking in the object context.
Refresh(RefreshMode, Object) Updates an object in the object context with data from the data source.
AcceptAllChanges() Accepts all changes made to objects in the object context. Refresh(RefreshMode refreshMode, Object entity) Method has the dual purpose of allowing an object to be refreshed with data from the data source and being the mechanism by which conflicts can be resolved.
ObjectContext.Refresh Method
http://msdn.microsoft.com/en-us/library/bb896255.aspx

QUESTION 134
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the following object query to load a product from the database. (Line numbers are included for reference only.)
01 using (AdventureWorksEntities advWorksContext = new AdventureWorksEntities())
02 {
03    ObjectQuery <Product> productQuery = advWorksContext.Product.Where(“it.ProductID = 900”);
04    …
05 }
You need to log the command that the query executes against the data source. Which code segment should you insert at line 04?

A.    Trace.WriteLine(productQuery.ToString());
B.    Trace.WriteLine(productQuery.ToTraceString());
C.    Trace.WriteLine(productQuery.CommandText);
D.    Trace.WriteLine(((IQueryable)productQuery).Expression);

Answer: B
Explanation:
CHAPTER 8 Developing Reliable Applications
Lesson 1: Monitoring and Collecting Performance Data Accessing SQL Generated by the Entity Framework (page 509)

QUESTION 135
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Forms application. The application connects to a Microsoft SQL Server database. You need to find out whether the application is explicitly closing or disposing SQL connections. Which code segment should you use?

A.    string instanceName = Assembly.GetEntryAssembly().FullName;
PerformanceCounter perf = new PerformanceCounter(“.NET Data Provider for SqlServer”, “NumberOfReclaimedConnections”, instanceName, true);
int leakedConnections = (int)perf.NextValue();
B.    string instanceName = Assembly.GetEntryAssembly().GetName().Name;
PerformanceCounter perf = new PerformanceCounter(“.NET Data Provider for SqlServer”, “NumberOfReclaimedConnections”, instanceName, true);
int leakedConnections = (int)perf.NextValue();
C.    string instanceName = Assembly.GetEntryAssembly().FullName;
PerformanceCounter perf = new PerformanceCounter(“.NET Data Provider for SqlServer”, “NumberOfNonPooledConnections”, instanceName, true);
int leakedConnections = (int)perf.NextValue();
D.    string instanceName = Assembly.GetEntryAssembly().GetName().Name;
PerformanceCounter perf = new PerformanceCounter(“.NET Data Provider for SqlServer”, “NumberOfNonPooledConnections”, instanceName, true);
int leakedConnections = (int)perf.NextValue();

Answer: A
Explanation:
NumberOfNonPooledConnections The number of active connections that are not pooled. NumberOfReclaimedConnections The number of connections that have been reclaimed through garbage collection where Close or Dispose was not called by the application. Not explicitly closing or disposing connections hurts performance.
Use of ADO.NET performance counters
http://msdn.microsoft.com/en-us/library/ms254503(v=vs.80).aspx
Assembly Class
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.aspx

QUESTION 136
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You write the following code segment that executes two commands against the database within a transaction. (Line numbers are included for reference only.)
01 using(SqlConnection connection = new SqlConnection(cnnStr)) {
02      connnection.Open();
03      SqlTransaction sqlTran = connection.BeginTransaction();
04      SqlCommand command = connection.CreateCommand();
05      command.Transaction = sqlTran;
06      try{
07         command.CommandText = “INSERT INTO Production.ScrapReason(Name) VALUES(‘Wrong size’)”;
08         command.ExecuteNonQuery();
09         command.CommandText = “INSERT INTO Production.ScrapReason(Name) VALUES(’Wrong color’)”;
10         command.ExecuteNonQuery();
11         …
12   }
You need to log error information if the transaction fails to commit or roll back. Which code segment should you insert at line 11?

A.           sqlTran.Commit();
}
catch (Exception ex) {
       sqlTran.Rollback();
       Trace.WriteLine(ex.Message);
}
B.           sqlTran.Commit();
}
catch (Exception ex) {
       Trace.WriteLine(ex.Message);
       try {
              sqlTran.Rollback();
       }
       catch (Exception exRollback) {
              Trace.WriteLine(exRollback.Message);
       }
}
C.    catch (Exception ex){
       Trace.WriteLine(ex.Message);
       try{
              sqlTran.Rollback();
       }
       catch (Exception exRollback){
              Trace.WriteLine(exRollback.Message);
       }
}
finaly {
       sqltran.commit( );
}
D.    catch (Exception ex) {
       sqlTran.Rollback();
       Trace.WriteLine(ex.Message);
}
finaly {
       try {
              sqltran.commit( );
       }
       catch (Exception exRollback) {
Trace.WriteLine(excommit.Message);
       }
}

Answer: B
Explanation:
A would work, but B is better since we are checking for possible errors during the rollback. C & D would try to do a rollback before a commit? The finally block is only executed when the application ends, which may not be the appropriate place to put this logic. Normally, a finally block would contain code to close a Database connection. The finally block executes even if an exception arises.

QUESTION 137
You use Microsoft Visual Studio 2010 and Microsoft.NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use the ADO.NET LINQ to Entity model to retrieve data from the database. You need to call a function that is defined in the conceptual model from within the LINQ to Entities queries. You create a common language runtime (CLR) method that maps to the function. What should you do next?

A.    Declare the method as static.
B.    Declare the method as abstract.
C.    Apply the EdmFunctionAttribute attribute to the method.
D.    Apply the EdmComplexTypeAttribute attribute to the method.

Answer: C
Explanation:
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
Model-Defined Functions (page 413-414)

QUESTION 138
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use Microsoft ADO.NET Entity Data Model (EDM) to model entities. You create an entity named Person with a schema defined by the following XML fragment.
<EntityType Name=”CPerson”>
<Key>
<PropertyRef Name=”PersonId” />
</Key>
<Property Name=”PersonId” Type=”Int32″ Nullable=”false” />
<Property Name=”CompanyName” Type=”String” />
<Property Name=”ContactName” Type=”String” />
<Property Name=”ContactTitle” Type=”String” />
<Property Name=”Address” Type=”String” />
</EntityType>
You need to ensure that entities within the application are able to add properties related to the city, region, and country of Person’s address. What should you do?

A.    Create a new complex type named CAddress that contains the properties for city, region, and country. Change the Type of the Address property in CPerson to “Self.CAddress”.
B.    Create a SubEntity named Address. Map the SubEntity to a stored procedure that retrieves city, region, and country.
C.    Create a new entity named Address. Add a person ID property to filter the results to display only the City, Region, and Country properties for a specific Person entity.
D.    Create a view named Name that returns city, region, and country along with person IDs. Add a WHERE clause to filter the results to display only the City, Region and Country properties for a specific Person entity.

Answer: A

QUESTION 139
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use the ADO.NET Entity Framework to model entities. You need to add a new type to your model that organizes scalar values within an entity. You also need to map stored procedures for managing instances of the type. What should you do?

A.    1.    Add the stored procedures in the SSDL file along with a Function attribute.
2.    Define a complex type in the CSDL file.
3.    Map the stored procedure in the MSL file with a ModificationFunctionElement.
B.    1.    Add the stored procedures in the SSDL file along with a Function attribute.
2.    Define a complex type in the CSDL file.
3.    Map the stored procedure in the MSL file with an AssociationEnd element.
C.    1.    Use the edmx designer to import the stored procedures.
2.    Derive an entity class from the existing entity as a complex type.
3.    Map the stored procedure in the MSL file with an AssociationEnd element.
D.    1.    Add the stored procedures in the SSDL file along with a Function attribute.
2.    Derive an entity class from the existing entity as a complex type.
3.    Map the stored procedure in the MSL file with a ModificationFunctionElement.

Answer: A
Explanation:
EndProperty Element (MSL)
http://msdn.microsoft.com/en-us/library/bb399578.aspx
AssosiationEnd Attribute
http://msdn.microsoft.com/en-us/library/cc716774.aspx

QUESTION 140
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Microsoft ASP.NET application. You want to connect the application to a Microsoft SQL Server Express 2008 database named MyDatabase. The primary database file is named MyDatabase.mdf and it is stored in the App_Data folder. You need to define the connection string. Which connection string should you add to the Web.config file?

A.    Data Source=localhost; Initial Catalog=MyDataBase; Integrated Security=SSPI; User Instance=True
B.    Data Source=.\SQLEXPRESS; Initial Catalog=MyDataBase; Integrated Security=True; User Instance=True
C.    Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\MyDatabase.mdf; Integrated Security=True; User Instance=True
D.    Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\App_Data\MyDatabase.mdf; Integrated Security=SSPI; User Instance=True

Answer: C
Explanation:
CHAPTER 2 ADO.NET Connected Classes
Lesson 1: Connecting to the Data Store
Attaching to a Local SQL Database File with SQL Express (page 73)


http://www.passleader.com/70-516.html

[Pass Ensure VCE Dumps] Professional 286q 70-516 Braindump For Free Download Now (141-160)

$
0
0

Want To Pass The New 70-516 Exam Easily? DO NOT WORRY! PassLeader now is supplying the latest and 100 percent pass ensure 286q 70-516 PDF dumps and VCE dumps, the new updated 70-516 braindumps are the most accurate with all the new changed 70-516 exam questions, it will help you passing 70-516 exam easily and quickly. Now visit the our site passleader.com and get the valid 286q 70-516 VCE and PDF exam questions and FREE VCE PLAYER!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 141
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. When a connection fails, the application logs connection information, including the full connection string. The information is stored as plain text in a .config file. You need to ensure that the database credentials are secure. Which connection string should you add to the .config file?

A.    Data Source=myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI;
Persist Security Info=false;
B.    Data Source=myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI;
Persist Security Info=true;
C.    Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername;
Password=myPassword; Persist Security Info=false;
D.    Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername;
Password=myPassword; Persist Security Info=true;

Answer: A
Explanation:
Persist Security Info
Default: ‘false’
When set to false or no (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password.
Recognized values are true, false, yes, and no.

QUESTION 142
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the ADO.NET Entity Framework to manage order data. The application makes a Web service call to obtain orders from an order-tracking system. You need to ensure that the orders are added to the local data store. Which method should you call on the ObjectContext?

A.    Attach
B.    AttachTo
C.    AddObject
D.    ApplyCurrentValues

Answer: C
Explanation:
ObjectContext.AddObject() Call AddObject on the ObjectContext to add the object to the object context.
Do this when the object is a new object that does not yet exist in the data source. ObjectContext.Attach() Call Attach on the ObjectContext to attach the object to the object context.
Do this when the object already exists in the data source but is currently not attached to the context.
If the object being attached has related objects, those objects will also be attached to the object context.
Objects are added to the object context in an unchanged state.
The object that is passed to the Attach method must have a valid EntityKey value. If the object does not have a valid EntityKey value, use the AttachTo method to specify the name of the entity set.
ObjectContext.AttachTo() Call AttachTo on the ObjectContext to attach the object to a specific entity set in the object context or if the object has a null (Nothing in Visual Basic) EntityKey value.
The object being attached is not required to have an EntityKey associated with it. If the object does not have an entity key, then entitySetName cannot be an empty string. ApplyCurrentValues<TEntity>() method is used to apply changes that were made to objects outside the ObjectContext, such as detached objects that are received by a Web service.
The method copies the scalar values from the supplied object into the object in the ObjectContext that has the same key.
You can use the EntityKey of the detached object to retrieve an instance of this object from the data source.

QUESTION 143
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create an Entity Data Model using model-first development. The database has the following requirements:
– each table must have a datetime column named time_modified
– each table requires a trigger that updates the value of the time_modified column when a row is inserted or updated
You need to ensure that the database script that is created by using the Generate Database From Model option meets the requirements. What should you do?

A.    Create a new T4 template, and set the DDL Generation template to the name of the new template.
B.    Create a new Windows Workflow Foundation workflow, and set Database Generation Workflow to the name of the new workflow.
C.    Add a DateTime property named time_modified to each entity in the model and set the property’s StoreGeneratedPattern to Computed.
D.    Add a new entity named time_modified to the model, and modify each existing entity so that it inherits from the new entity.

Answer: A
Explanation:
Model-First in the Entity Framework 4
http://msdn.microsoft.com/en-us/data/ff830362

QUESTION 144
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities as shown in the following diagram. You create an ObjectContext instance named objectContext1 and use it to create a SalesPerson instance named person1. You create an ObjectContext instance named objectContext2 and use it to create a SalesTerritory instance named territory1. You need to create and persist a relationship between person1 and terrotory1. What should you do?

A.    Detach person1 from objectContext1.
Attach person1 to objectContext2.
Set the SalesTerritory property of person1 to territory1.
Call SaveChanges on objectContext2.
B.    Attach person1 to objectContext2.
Attach territory1 to objectContext1.
Set the SalesTerritory property of person1 to territory1.
Call SaveChanges on both objectContext1 and objectContext2.
C.    Detach person1 from objectContext1.
Detach territory1 from objectContext2.
Set the SalesTerritory property of person1 to territory1.
Call Refresh on both objectContext1 and objectContext2.
D.    Attach person1 to objectContext2.
Detach territory1 from objectContext2.
Set the SalesTerritory property of person1 to territory1.
Call Refresh on objectContext1.

Answer: A

QUESTION 145
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. You create the following Entity Data Model. You add the following code fragment:
using(var context = new AdventureWorksLTEntities())
{
Customer cust = context.Customers.First();
cust.CompanyName = “Contoso”;
int count = 0;
}
The changes to the cust entity must be saved. If an exception is thrown, the application will attempt to save up to 3 times. If not, an exception is thrown. Which code segment should you use?

A.    while(count++ < 3)
{
try
{
context.SaveChanges();
break;
}
catch(Exception)
{
}
}
B.    while(cust.EntityState == EntityState.Modified)
{
    try
    {
        context.SaveChanges();
     }
    catch(Exception)
    {
if(count++ > 2 && context.Connection.State == ConnectionState.Broken
        {
              throw new Exception();
        }
    }
}
C.    while(true)
{
context.SavingChanges += delegate(System.Object o, System.EventArgs e)
    {
        if(count++ >2)
        {
            throw new Exception();
        }
        context.SaveChanges();
    }
}
D.    while(context.ObjextStateManager.GetObjectStateEntry(cust).
OriginalValues.IsDBNull(0))
{
    if(count++ >2)
    {
        break;
    }
    context.SaveChanges();
}

Answer: B

QUESTION 146
You have executed the Where query extension method on your collection, and it returned IEnumerable of Car, but you want to assign this to a variable whose type is List Of Car. How can you convert the IEnumerable of Car to List Of Car?

A.    Use CType (C# cast).
B.    It can’t be done.
C.    Use the ToList() query extension method.
D.    Just make the assignment

Answer: C

QUESTION 147
When working with LINQ to SQL, what is the main object that moves data to and from the database?

A.    DataSet
B.    SqlDataAdapter
C.    DataContext
D.    Entity

Answer: C

QUESTION 148
You want to use LINQ to SQL to run queries on a table that contains a column that stores large photos. Most of the time, you won’t need to view the photo, but occasionally you will need to see it. In the LINQ to SQL designer, which property can you set on the photo column to get the efficient loading of the data for most scenarios but still be able to retrieve the photo when needed?

A.    Skip
B.    Delay Loaded
C.    Take
D.    Auto Generated Value.

Answer: B

QUESTION 149
You retrieved a row of data into an entity object by using a LINQ to SQL DataContext object. You haven’t made any changes to the object, but you know that someone else has modified the data row in the database table, so you rerun your query, using the same LINQ to SQL DataContext object, to retrieve the updated data. What can be said about the result of the second query?

A.    It returns the updated data and you can use it immediately.
B.    The changes are thrown out and you use the cached data, so you don’t see the changes.
C.    An exception is thrown due to the difference in data.
D.    An exception is thrown because you already have the object, so you can’t re-query unless you create a new DataContext object.

Answer: B

QUESTION 150
You ran a LINQ to SQL query to retrieve the products that you are going to mark as discontinued. After running the query, you looped through the returned products and set their Discontinued property to true. What must you do to ensure that the changes go back to the database?

A.    Call the Update method on the DataContext object.
B.    Nothing; the changes are sent when you modify the object.
C.    Call the Dispose method on the DataContext object.
D.    Call the SubmitChanges method on the DataContext object.

Answer: D


http://www.passleader.com/70-516.html

QUESTION 151
You are working with an ObjectContext object that targets the mainframe and another ObjectContext object that targets SQL Server. When it’s time to save the changes, you want all changes to be sent to the mainframe and to SQL Server as one transaction. How can you accomplish this?

A.    Just save both ObjectContext objects because they automatically join the same transaction.
B.    Save to the mainframe and use an if statement to verify that the changes were successful. If successful, save to SQL Server.
C.    Wrap the saving of both ObjectContext objects within a TransactionScope object that is implemented in a using statement in which the last line executes the Complete method on the TransactionScope class.
D.    Use a Boolean flag to indicate the success of each save, which will tell you whether the save was successful.

Answer: C

QUESTION 152
The URI to your WCF data service is http://www.northwind.com/DataServices.svc. What can you add to the end of the URI to retrieve only a list of Order entities for the Customer entity whose CustomerID is `BONAP’?

A.    /Customers(`BONAP’)?$expand=Orders
B.    /Customers?$filter=CustomerID eq `BONAP’&$expand=Orders
C.    /Customers/Orders?$filter=CustomerID eq `BONAP’
D.    /Customers(`BONAP’)/Orders

Answer: D

QUESTION 153
You are writing a WCF data service that will be included in a large project that has many other WCF data services. Your WCF data service will provide access to a SQL server using the Entity Framework. The EDMX file already exists in the project and is used by other services. One of the tables exposed by your service is the Contacts table, which contains the list of employees and the list of external contacts, which are denoted by the IsEmployee column that can be set to 1 or 0. You want to configure your WCF data service to return the external contacts whenever someone queries the Contacts entity set through WCF Data Services. What is the best way to solve this problem?

A.    Modify the Contacts entity set in the EDMX file.
B.    Add a stored procedure to SQL Server and modify the EDMX file to create a function import that you can call.
C.    Add a method to your WCF data service class and adorn the method with a QueryInterceptorAttribute of Contacts. In the method, provide the filter.
D.    Add a lazy loader to the WCF data service that will filter out the employees.

Answer: C

QUESTION 154
What must you use to capture an exception that might occur when you are sending changes to the database server?

A.    A using block.
B.    A try/catch block.
C.    A while statement.
D.    You can’t capture exceptions.

Answer: B

QUESTION 155
Which of the following are valid encryption algorithms that can be selected when encrypting the connection strings in your .config files? (Each correct answer presents a complete solution. Choose two.)

A.    DpapiProtectedConfigurationProvider
B.    RNGCryptoServiceProvider
C.    SHA256Managed
D.    RsaProtectedConfigurationProvider
E.    RijndaelManaged

Answer: AD

QUESTION 156
Which of the following is a valid symmetric encryption algorithm?

A.    RNGCryptoServiceProvider
B.    RNGCryptoServiceProvider
C.    SHA256Managed
D.    RijndaelManaged

Answer: D

QUESTION 157
You want to synchronize data between your local SQL Server Compact tables and SQL Server 2008. You want the synchronization to send changes to SQL Server 2008, and you want to receive changes from SQL Server 2008. Which setting must you assign to the SyncDirection property of your sync agent’s tables?

A.    SyncDirection.Bidirectional
B.    SyncDirection.UploadOnly
C.    SyncDirection.Snapshot
D.    SyncDirection.DownloadOnly

Answer: A

QUESTION 158
You are adding a process to the application. The process performs the following actions:
1. Opens a ContosoEntities context object named context1.
2. Loads a Part object into a variable named part1.
3. Calls the Dispose() method on context1.
4. Updates the data in part1.
5. Updates the database by using a new ContosoEntities context object named context2.
You need to update the database with the changed data from part1. What should you do?

A.    Add the following code segment before calling SaveChanges() on context2:
context2.ApplyCurrentValues(“Parts”, part1);
B.    Add the following code segment before calling SaveChanges() on context2:
context2.Attach(part1);
context2.ApplyCurrentValues(“Parts”, part1);
C.    Add the following code segment before calling SaveChanges() on context2:
context2.Attach(part1);
context2.ObjectStateManager.ChangeObjectState(part1, System.Data.EntitySate.Modified);
D.    Add the following code segment before calling SaveChanges() on context2:
context2.ApplyOriginalValues(“Parts”, part1);

Answer: C
Explanation:
How to: Apply Changes Made to a Detached Object
http://msdn.microsoft.com/en-us/library/bb896248.aspx

QUESTION 159
The application must provide a component part list for any product. The component part list must give the quantity of each distinct part that is required to manufacture that product. You need to create a LINQ expression that delivers a a result of type IEnumerable<Tuple<int,Part>> to meet the requirements. Which expression should you use?

A.    IEnumerable<Tuple<int, Part>> result = part.Children.Distinct().GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));
B.    IEnumerable<Tuple<int, Part>> result = part.Descendants.GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));
C.    IEnumerable<Tuple<int, Part>> result = part.Descendants.ToDictionary(c => c).Select(d => Tuple.Create(d.Value.Children.Count(), d.Key));
D.    IEnumerable<Tuple<int, Part>> result = part.Children.GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));
E.    IEnumerable<Tuple<int, Part>> result = part.Descendants.Distinct().GroupBy(p => p).Select(g => Tuple.Create(g.Count(), g.Key));

Answer: B

QUESTION 160
You are developing a new feature that displays an auto-complete list to users as the type color names. You have an existing ContosoEntities context object named contex. To support the new feature you must develop code that will accept a string object named text containing a user’s partial input and will query the Colors database table to retrieve all color names that begin with that input. You need to create an Entity SQL (ESQL) query to meet the requirement. The query must not be vulnerable to a SQL injection attack. Which code segment should you use?

A.    var parameter = new ObjectParameter(“text”, text + “%”);
var result = context.CreateQuery<string>(“SELECT VALUE (c.Name) FROM Colors AS c WHERE c.Name LIKE ‘@text'”, parameter);
B.    var parameter = new ObjectParameter(“text”, text + “%”);
var result = context.CreateQuery<string>(“SELECT VALUE (c.Name) FROM Colors AS c WHERE c.Name LIKE @text”, parameter);
C.    var parameter = new ObjectParameter(“text”, text + “%”);
var result = context.CreateQuery<string>(“SELECT (c.Name) FROM Colors AS c WHERE c.Name LIKE @text”, parameter);
D.    var parameter = new ObjectParameter(“text”, HttpUtility.HtmlEncode(text) + “%”);
var result = context.CreateQuery<string>(“SELECT (c.Name) FROM Colors AS c WHERE c.Name LIKE ‘@text’@, parameter);

Answer: B
Explanation:
Entity SQL supports two variants of the SELECT clause. The first variant, row select, is identified by the SELECT keyword, and can be used to specify one or more values that should be projected out. Because a row wrapper is implicitly added around the values returned, the result of the query expression is always a multiset of rows. Each query expression in a row select must specify an alias. If no alias is specified,Entity SQL attempts to generate an alias by using the alias generation rules. The other variant of the SELECT clause, value select, is identified by the SELECT VALUE keyword. It allows only one value to be specified, and does not add a row wrapper. A row select is always expressible in terms of VALUE SELECT, as illustrated in the following example.
ESQL Select
http://msdn.microsoft.com/en-us/library/bb399554.aspx


http://www.passleader.com/70-516.html

[New Exam Dumps] PassLeader Premium 198q 300-209 Braindump For Free Share

$
0
0

New Updated 300-209 Exam Questions from PassLeader 300-209 PDF dumps! Welcome to download the newest PassLeader 300-209 VCE dumps: http://www.passleader.com/300-209.html (198 Q&As)

Keywords: 300-209 exam dumps, 300-209 exam questions, 300-209 VCE dumps, 300-209 PDF dumps, 300-209 practice tests, 300-209 study guide, 300-209 braindumps, Implementing Cisco Secure Mobility Solutions Exam

NEW QUESTION 161
Which option describes what address preservation with IPsec Tunnel Mode allows when GETVPN is used?

A.    stronger encryption methods
B.    Network Address Translation of encrypted traffic
C.    traffic management based on original source and destination addresses
D.    Tunnel Endpoint Discovery

Answer: C

NEW QUESTION 162
Which feature is available in IKEv1 but not IKEv2?

A.    Layer 3 roaming
B.    aggressive mode
C.    EAP variants
D.    sequencing

Answer: B

NEW QUESTION 163
Which feature is enabled by the use of NHRP in a DMVPN network?

A.    host routing with Reverse Route Injection
B.    BGP multiaccess
C.    host to NBMA resolution
D.    EIGRP redistribution

Answer: C

NEW QUESTION 164
Which statement about the hub in a DMVPN configuration with iBGP is true?

A.    It must be a route reflector client.
B.    It must redistribute EIGRP from the spokes.
C.    It must be in a different AS.
D.    It must be a route reflector.

Answer: D

NEW QUESTION 165
……

NEW QUESTION 166
Which command can you use to monitor the phase 1 establishment of a FlexVPN tunnel?

A.    show crypto ipsec sa
B.    show crypto isakmp sa
C.    show crypto ikev2 sa
D.    show ip nhrp

Answer: C

NEW QUESTION 167
Which interface is managed by the VPN Access Interface field in the Cisco ASDM IPsec Site-to- Site VPN Wizard?

A.    the local interface named "VPN_access"
B.    the local interface configured with crypto enable
C.    the local interface from which traffic originates
D.    the remote interface with security level 0

Answer: B

NEW QUESTION 168
You are troubleshooting a DMVPN NHRP registration failure. Which command can you use to view request counters?

A.    show ip nhrp nhs detail
B.    show ip nhrp tunnel
C.    show ip nhrp incomplete
D.    show ip nhrp incomplete tunnel tunnel_interface_number

Answer: A

NEW QUESTION 169
……

NEW QUESTION 170
Which three commands are included in the command show dmvpn detail? (Choose three.)

A.    show ip nhrp nhs
B.    show dmvpn
C.    show crypto session detail
D.    show crypto ipsec sa detail
E.    show crypto sockets
F.    show ip nhrp

Answer: ABC

NEW QUESTION 171
……

NEW QUESTION 172
Which option describes the purpose of the command show derived-config interface virtual-access 1?

A.    It verifies that the virtual access interface is cloned correctly with per-user attributes.
B.    It verifies that the virtual template created the tunnel interface.
C.    It verifies that the virtual access interface is of type Ethernet.
D.    It verifies that the virtual access interface is used to create the tunnel interface.

Answer: A

NEW QUESTION 173
Which two RADIUS attributes are needed for a VRF-aware FlexVPN hub? (Choose two.)

A.    ip:interface-config=ip unnumbered loobackn
B.    ip:interface-config=ip vrf forwarding ivrf
C.    ip:interface-config=ip src route
D.    ip:interface-config=ip next hop
E.    ip:interface-config=ip neighbor 0.0.0.0

Answer: AB

NEW QUESTION 174
Which functionality is provided by L2TPv3 over FlexVPN?

A.    the extension of a Layer 2 domain across the FlexVPN
B.    the extension of a Layer 3 domain across the FlexVPN
C.    secure communication between servers on the FlexVPN
D.    a secure backdoor for remote access users through the FlexVPN

Answer: A

NEW QUESTION 175
When you troubleshoot Cisco AnyConnect, which step does Cisco recommend before you open a TAC case?

A.    Show applet Lifecycle exceptions.
B.    Disable cookies.
C.    Enable the WebVPN cache.
D.    Collect a DART bundle.

Answer: D

NEW QUESTION 176
……


Download the newest PassLeader 300-209 dumps from passleader.com now! 100% Pass Guarantee!

300-209 PDF dumps & 300-209 VCE dumps: http://www.passleader.com/300-209.html (198 Q&As)

[New Exam Dumps] All People Wanted! PassLeader Valid 168q 70-461 Exam Questions For Free Download

$
0
0

New Updated 70-461 Exam Questions from PassLeader 70-461 PDF dumps! Welcome to download the newest PassLeader 70-461 VCE dumps: http://www.passleader.com/70-461.html (168 Q&As)

Keywords: 70-461 exam dumps, 70-461 exam questions, 70-461 VCE dumps, 70-461 PDF dumps, 70-461 practice tests, 70-461 study guide, 70-461 braindumps, Querying Microsoft SQL Server 2012 Exam

NEW QUESTION 158
You have a Microsoft SQL Server database that includes two tables named EmployeeBonus and BonusParameters. The tables are defined by using the following Transact-SQL statements:

The tables are used to compute a bonus for each employee. The EmployeeBonus table has a non- null value in either the Quarterly, HalfYearly or Yearly column. This value indicates which type of bonus an employee receives. The BonusParameters table contains one row for each calendar year that stores the amount of bonus money available and a company performance indicator for that year. You need to calculate a bonus for each employee at the end of a calendar year. Which Transact-SQL statement should you use?

A.    SELECT
CAST(CHOOSE((Quarterly * AvailableBonus * CompanyPerformance)/40, (HalfYearly * AvailableBonus * CompanyPerformance)/20, (Yearly * AvailableBonus * CompanyPerformance)/10) AS money) AS `Bonus’ FROM
EmployeeBonus, BonusParameters
B.    SELECT “Bonus” =
CASE EmployeeBonus
WHEN Quarterly=1 THEN (Quarterly * AvailableBonus * CompanyPerformance)/40 WHEN HalfYearly=1 THEN (HalfYearly * AvailableBonus * CompanyPerformance)/20 WHEN Yearly=1 THEN (Yearly * AvailableBonus * CompanyPerformance)/10 END
FROM EmployeeBonus,BonusParameters
C.    SELECT
CAST(COALESCE((Quarterly * AvailableBonus * CompanyPerformance)/40, (HalfYearly * AvailableBonus * CompanyPerformance)/20, (Yearly * AvailableBonus * CompanyPerformance)/10) AS money) AS `Bonus’ FROM
EmployeeBonus, BonusParameters
D.    SELECT
NULLIF(NULLIF((Quarterly * AvailableBonus * CompanyPerformance)/40,(HalfYearly * AvailableBonus * CompanyPerformance)/20),
(Yearly * AvailableBonus * CompanyPerformance)/10) AS `Bonus’ FROM
EmployeeBonus, BonusParameters

Answer: B

NEW QUESTION 159
You use Microsoft SQL Server 2012 to develop a database application. You need to create an object that meets the following requirements:

– Takes an input parameter
– Returns a table of values
– Can be referenced within a view

Which object should you use?

A.    inline table-valued function
B.    user-defined data type
C.    stored procedure
D.    scalar-valued function

Answer: A
Explanation:
Incorrect answers:
Not B: A user-defined data type would not be able to take an input parameter.
Not C: A stored procedure cannot be used within a view.
Not D: A scalar-valued would only be able to return a single simple value, not a table.

NEW QUESTION 160
……

Download the newest PassLeader 70-461 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/70-461.html

NEW QUESTION 162
You are developing a Microsoft SQL Server 2012 database for a company. The database contains a table that is defined by the following Transact-SQL statement:

You use the following Transact-SQL script to insert new employee data into the table. Line numbers are included for reference only.

If an error occurs, you must report the error message and line number at which the error occurred and continue processing errors. You need to complete the Transact-SQL script. Which Transact-SQL segment should you insert at line 06?

A.    SELECT ERROR_LINE(), ERROR_MESSAGE()
B.    DECLARE @message NVARCHAR(1000),@severity INT, @state INT; SELECT @message = ERROR_MESSAGE(), @severity = ERROR_SEVERITY(), @state = ERROR_STATE();
RAISERROR (@message, @severity, @state);
C.    DECLARE @message NVARCHAR(1000),@severity INT, @state INT; SELECT @message = ERROR_MESSAGE(), @severity = ERROR_SEVERITY(), @state = ERROR_STATE();
THROW (@message, @severity, @state);
D.    THROW;

Answer: B
Explanation:
When the code in the CATCH block finishes, control passes to the statement immediately after the END CATCH statement. Errors trapped by a CATCH block are not returned to the calling application. If any part of the error information must be returned to the application, the code in the CATCH block must do so by using mechanisms such as SELECT result sets or the RAISERROR and PRINT statements.
Reference: TRY…CATCH (Transact-SQL)
https://msdn.microsoft.com/en-us/library/ms175976.aspx

NEW QUESTION 164
You are maintaining a Microsoft SQL Server database. You run the following query:

You observe performance issues when you run the query. You capture the following query execution plan:

You need to ensure that the query performs returns the results as quickly as possible. Which action should you perform?

A.    Add a new index to the ID column of the Person table.
B.    Add a new index to the EndDate column of the History table.
C.    Create a materialized view that is based on joining data from the ActiveEmployee and History tables.
D.    Create a computed column that concatenates the GivenName and SurName columns.

Answer: A
Explanation:
Cost is 53% for the Table Scan on the Person (p) table. This table scan is on the ID column, so we should put an index on it.

NEW QUESTION 165
……

Download the newest PassLeader 70-461 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/70-461.html

NEW QUESTION 167
You are developing a database in SQL Server 2012 to store information about current employee project assignments. You are creating a view that uses data from the project assignment table. You need to ensure that the view does not become invalid if the schema of the project assignment table changes. What should you do?

A.    Create the view by using an account in the sysadmin role.
B.    Add a DDL trigger to the project assignment table to re-create the view after any schema change.
C.    Create the view in a new schema.
D.    Add a DDL trigger to the view to block any changes.

Answer: B
Explanation:
DDL triggers are a special kind of trigger that fire in response to Data Definition Language (DDL) statements. They can be used to perform administrative tasks in the database such as auditing and regulating database operations.
Reference: DDL Triggers
https://technet.microsoft.com/en-us/library/ms190989(v=sql.105).aspx

NEW QUESTION 168
You are maintaining a Microsoft SQL Server database that stores order information for an online store website. The database contains a table that is defined by the following Transact-SQL statement:

You need to ensure that purchase order numbers are used only for a single order. What should you do?

A.    Create a new CLUSTERED constraint on the PurchaseOrderNumber column.
B.    Create a new UNIQUE constraint on the PurchaseOrderNumber column.
C.    Create a new PRIMARY constraint on the PurchaseOrderNumber column.
D.    Create a new FOREIGN KEY constraint on the PurchaseOrderNumber column.

Answer: B
Explanation:
You can use UNIQUE constraints to make sure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key.
Reference: UNIQUE Constraints
https://technet.microsoft.com/en-us/library/ms191166(v=sql.105).aspx


Download the newest PassLeader 70-461 dumps from passleader.com now! 100% Pass Guarantee!

70-461 PDF dumps & 70-461 VCE dumps: http://www.passleader.com/70-461.html (168 Q&As)

[New Exam Dumps] Download Free 70-246 Study Guide With VCE Dumps Collection

$
0
0

New Updated 70-246 Exam Questions from PassLeader 70-246 PDF dumps! Welcome to download the newest PassLeader 70-246 VCE dumps: http://www.passleader.com/70-246.html (204 Q&As)

Keywords: 70-246 exam dumps, 70-246 exam questions, 70-246 VCE dumps, 70-246 PDF dumps, 70-246 practice tests, 70-246 study guide, 70-246 braindumps, Private Cloud Monitoring and Operations with System Center 2012 Exam

NEW QUESTION 183
You use System Center 2012 R2 Service Manager to manage incident requests. You need to create a service level objective (SLO). Which three items should you include in the SLO? Each correct answer presents part of the solution.

A.    an email notification subscription
B.    a queue
C.    a calendar
D.    an incident request template
E.    a metric
F.    an email notification template

Answer: BCE
Explanation:
In System Center 2012 ?Service Manager, you create a service level objective to create relationships between a queue and a service level, a calendar item and a time metric, and actions that occur before or after service level breaches. In order to create a service level objective, it is easier if you have already created or defined a calendar item and an SLA metric. Additionally, the service level objective that you create is linked to a queue.
Reference: How to Create a Service Level Objective
https://technet.microsoft.com/en-us/library/hh519603.aspx

NEW QUESTION 184
Hotspot Question
You manage a System Center 2012 R2 Operations Manager deployment. The deployment contains a server named Server1 that runs Windows Server 2012 R2. You discover an alert for Server1 generated by a monitor named Monitor1. Monitor1 does not implement on-demand detection. When you troubleshoot the cause of the alert, you discover that the issue causing the alert was resolved. You need to ensure that once you close the alert, an alert will be generated if the same issue reoccurs. What should you do before closing the alert? To answer, select the appropriate options in the answer area.

Answer:

Explanation:
Recalculate Health – this forces the monitor to recaclulate health, telling it not to wait until the next scheduled execution. State changes depending on the outcome of the health check. Using Health Explorer, you can reset the health state of an entity or recalculate the health of entity.
Incorrect answers:
Reset Health – if possible this will reset the monitor to healthy and close the alert. If the problem still exists the monitor will stay healthy until the next check. Only reset health for a monitor when you are sure that all issues have been resolved.

NEW QUESTION 185
Hotspot Question
You deploy System Center 2012 R2 Operations Manager to a server named Server1 that runs Windows Server 2012 R2. Your company has a public website that is hosted in Microsoft Internet Information Services (IIS). You need to use Operations Manager to monitor the availability of the public website from the United States, Europe, Asia, and Australia. What should you do on Server1? To answer, select the appropriate options in the answer area.


Explanation:
* Box 1, box 2: Run the GSM (Global Service Monitor) installer package from a machine which has System Center Operations Manager 2012 SP1: it will install GSM management packs. In order to receive full information regarding Visual Studio Web Test results, you need to import the Alert Attachment MP (available in the installation image for OpsMgr 2012 SP1) and enable file attachments for alerts.
* Box 3: Make sure Windows Identity Foundation is installed on your management server that is communicating with the cloud and everywhere the Operations Manager console is installed. Windows Identity Foundation is required.
Incorrect:
* Internet Information Services Hostable Web Core. This feature allows you to program an application to serve HTTP requests by using core IIS functionality.
* Simple TCP/IP Services supports the following TCP/IP services: Character Generator, Daytime, Discard, Echo and Quote of the Day. Simple TCP/IP Services is provided for backward compatibility and should not be installed unless it is required.
* Management OData IIS Extension
Management OData IIS Extension is a framework for easily exposing Windows PowerShell cmdlets through an ODATA-based web service that runs under IIS. to make the web service functional.
Reference: System Center Global Service Monitor: Getting Started
http://blogs.technet.com/b/momteam/archive/2013/01/14/system-center-global-service-monitor-getting-started.aspx

NEW QUESTION 186
Hotspot Question
You have a System Center 2012 R2 deployment that contains the servers configured as shown in the following table.

You deploy the Operations Manager agent to Server4. On Server1, you create a monitor and an alert view. You plan to create an automation workflow that will perform the following actions:
– Open an incident in Service Manager when Operations Manager raises an alert.
– After the incident is open, remediate the error that caused the alert.
– Resolve the alert.
– Close the incident.
You need to configure the System Center 2012 environment to support the implementation of the planned workflow. On which server should you perform each action? To answer, select the appropriate options in the answer area.

Answer:

Explanation:
Reference: How to Create a System Center Operations Manager Connector
https://technet.microsoft.com/en-us/library/hh524325.aspx

NEW QUESTION 187
You manage a System Center 2012 R2 deployment that contains the servers configured as shown in the following table.

You have a Microsoft Azure subscription. All three servers have the Azure PowerShell module installed. You need to ensure that you can run Azure PowerShell cmdlets from Runbook Tester. What should you do?

A.    From Server2, deploy the Integration Pack for Windows Azure to Server1.
B.    On Server1, add the Run.NET Script activity. Add the Import-Module Azure cmdlet to the first line of the script.
C.    On Server1, add the Run.NET Script activity. Invoke C:\Windows\System32\WindowsPowerShell\v1.0 \PowerShell.exe in the first line of the script.
D.    From Server2, deploy the integration pack for Representational State Transfer (REST) to Server1.

Answer: D
Explanation:
The Integration Pack for Windows Azure is an add-on for Orchestrator in System Center 2012 Service Pack 1 (SP1) that enables you to automate Windows Azure operations related to certificates, deployments, cloud services, storage, and virtual machines using the ‘2012-03-01’ version of the Windows Azure Service Management REST API.
Reference: Windows Azure Integration Pack for Orchestrator in System Center 2012 SP1
https://technet.microsoft.com/en-us/library/JJ721956.aspx

NEW QUESTION 188
Your network contains a single Active Directory domain. The domain contains the servers configured as shown in the following table.

The domain contains a user account named Account1. You plan to implement an update baseline in VMM. From the Virtual Machine Manager console, you plan to add Server2 as an update server. VMM will use Account2 to manage WSUS. You need to identify the group to which you must add Account1 on Server2. The solution must use the principle of least privilege. Which group should you identify?

A.    Administrators
B.    Power Users
C.    WSUS Administrators
D.    Distributed COM Users

Answer: C
Explanation:
Grant users permissions for WSUS console access. If users do not have appropriate permissions for the WSUS console, they receive an “access denied” message when trying to access the WSUS console. You must be a member of the Administrators group or the WSUS Administrators group on the server on which WSUS is installed in order to use the WSUS console.
Reference: Cannot access the WSUS console
https://technet.microsoft.com/en-us/library/cc720470(v=ws.10).aspx

NEW QUESTION 189
Hotspot Question
You have a System Center 2012 R2 Configuration Manager deployment and a System Center 2012 R2 Virtual Machine Manager (VMM) deployment. All servers are Configuration Manager clients. You have a Windows Server Update Service (WSUS) server. Configuration Manager is configured to use WSUS for software updates. You need to implement a Windows Update deployment for all of the servers. The deployment must meet the following requirements:
– Hyper-V hosts must be excluded from receiving software updates from Configuration Manager.
– VMM must apply software updates to all of the Hyper-V hosts.
– VMM must obtain updates from the WSUS server.
– Administrative effort must be minimized.
Which actions should you perform in VMM and which actions should you perform in Configuration Manager? To answer, select the appropriate options in the answer area.

Answer:

Explanation:
* To add a Windows Server Update Server to VMM
1. In the VMM console, open the Fabric workspace.
2. On the Home tab, in the Add group, click Add Resources, and then click Update Server.
The Add Windows Server Update Services Server dialog box opens.
* Baseline, assignment scope
VMM provides two sample built-in updates baselines that you can use to apply security updates and critical updates to the computers in your VMM environment. Before you can use a baseline, you must specify an assignment scope which contains the host groups, host clusters, individual managed computers, or (as of System Center 2012 R2) infrastructure servers that the baseline is applied to.
* Create collections in System Center 2012 Configuration Manager to represent logical groupings of users or devices.
Reference: How to Add an Update Server to VMM
https://technet.microsoft.com/en-us/library/gg675116.aspx
Reference: How to Configure Update Baselines in VMM
https://technet.microsoft.com/en-us/library/gg675110.aspx

NEW QUESTION 190
……


Download the newest PassLeader 70-246 dumps from passleader.com now! 100% Pass Guarantee!

70-246 PDF dumps & 70-246 VCE dumps: http://www.passleader.com/70-246.html (204 Q&As)

[New Exam Dumps] PassLeader Free New Update 70-247 Exam Questions Collection

$
0
0

New Updated 70-247 Exam Questions from PassLeader 70-247 PDF dumps! Welcome to download the newest PassLeader 70-247 VCE dumps: http://www.passleader.com/70-247.html (219 Q&As)

Keywords: 70-247 exam dumps, 70-247 exam questions, 70-247 VCE dumps, 70-247 PDF dumps, 70-247 practice tests, 70-247 study guide, 70-247 braindumps, Configuring and Deploying a Private Cloud with System Center 2012 Exam

Case Study 7 – Woodgrove Bank (New Question 207 – New Question 211)
Exist Environment
Active Directory Environment
The network contains a single Active Directory production forest named woodgrovebank.com. Currently, there is no trust relationship between the Active Directory forests of Woodgrove Bank and Contoso.
Network Environment
Woodgrove Bank has a perimeter network that hosts Internet-facing servers. Woodgrove Bank uses Hyper-V Network Virtualization to isolate its production, development, and test environments. Woodgrove Bank has a Microsoft Azure subscription.
System Center Environment
Woodgrove Bank deploys infrastructure servers that host the following System Center 2012 R2 components:
– Operations Manager
– Data Protection Manager (DPM)
– Virtual Machine Manager (VMM)
Woodgrove Bank plans to deploy Service Provider Foundation, System Center 2012 R2 Orchestrator, and System Center 2012 R2 Service Manager. All of the internal Hyper-V hosts and the file servers on the Woodgrove Bank network are registered with VMM. VMM and Windows Server Update Services (WSUS) are integrated. Woodgrove Bank has three VMM logical networks intended for clients, management and storage. Each VMM logical network is configured to use a host group of All Hosts. The Operations Manager agent is deployed to each server.

NEW QUESTION 207
You need to recommend a solution to deploy App1 to meet the application requirements. What should you include in the recommendation?

A.    Modify the Application Configuration settings of the App1 service template to include settings enclosed by @.
B.    Configure the custom properties of the App1 service template.
C.    Modify the App1 service template.
D.    Modify the Application Configuration settings of the App1 service template to include settings followed by #.

Answer: B
Explanation:

An application package can contain settings to be entered when you configure the service for deployment.
To format this type of setting, enter the parameter in the Value field, in this format: @<SettingLabel>@. For example, you might prompt for the instance name of a SQL Server for a SQL Server database tier application by using the parameter @SQLServerInstanceName@.
Scenario: Deploy five instances of a multi-tier application named App1 by using a VMM service template.
Each instance will have different deployment settings.
Reference: How to Create an Application Profile in a Service Deployment
https://technet.microsoft.com/en-us/library/hh427291.aspx

NEW QUESTION 208
Drag and Drop Question
You need to deploy a virtual machine to provide external connectivity for the virtual machine networks. The solution must meet the connectivity requirements. Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Answer:

Explanation:
Create a virtual machine template
(Step 2) You can add a virtual switch extension, such as a NVGRE gateway, by running the Add Network Service Wizard.
(Step 3-4) * After you have created the NVGRE gateway you can create a VMM template that uses the NVGRE gateway.
You can base the new template on an existing VMM template.
* Once you install Client Hyper-V, the first thing that you’ll need to do in preparation for creating a virtual machine is create a virtual switch in order for your virtual machines to connect to your network and the Internet. Once you have a virtual switch in place you can create your virtual machines and in the process connect them to your virtual switch.
Scenario: Woodgrove Bank connectivity requirements include:
* Provide external connectivity to the virtual machine networks that are isolated from the clients by using the Network Virtualization using Generic Routing Encapsulation (NVGRE) gateway.
Reference: Making a NVGRE Gateway with System Center 2012 R2 Virtual Machine Manager
https://mountainss.wordpress.com/2013/12/20/making-a-nvgre-gateway-with-system-center-2012-r2-virtual-machine-manager-scvmm-sysctr/

NEW QUESTION 209
……

Download the newest PassLeader 70-247 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/70-247.html

NEW QUESTION 210
You need to implement VMM IPAM to meet the manageability requirements. To which two groups should you add WOODGROVEBANK\vmmuser1?

A.    Remote Management Users on Server10
B.    IPAM ASM Administrators on Server10
C.    Remote Management Users on Server4
D.    IPAM MSM Administrators on Server10
E.    IPAM Administrators on Server10

Answer: AD
Explanation:
Before you can add an IPAM server to your configuration in VMM, you must perform the following actions:
1. (this has already been done here) On a server running Windows Server 2012 R2, install the IPAM feature by using Add Roles and Features (in Server Manager) or Windows PowerShell commands. Then configure the IPAM server as described in the relevant IPAM documentation.
2. Create or identify a domain account and, to avoid issues with expiration of the password, ensure that the account is set to never expire. Then, on the IPAM server, ensure that the account has at least the minimum necessary permissions by adding the account to the following two groups:
/ IPAM ASM Administrators: A local group that exists on all IPAM servers, and provides permissions for IP address space management (ASM).
/ Remote Management Users: A built-in group that provides access to WMI resources through management protocols, such as WS-Management through the Windows Remote Management service.
Scenario:
* Use a domain account named WOODGROVEBANK\vmmuser1 to view and modify the IP address space in IPAM.
* Server4 is a VMM running Windows Server 2012 R2
* Server10 is IP Address Management (IPAM)
Reference: How to Add an IPAM Server in VMM in System Center 2012 R2
https://technet.microsoft.com/en-us/library/dn249418.aspx

NEW QUESTION 211
……

Case Study 8 – A.Datum Corporation (New Question 212 – New Question 216)
Overview
A.Datum Corporation is a consulting company that has two offices. The offices are located in Seattle and Los Angeles.
Existing Environment
Active Directory
The network contains a single-domain Active Directory forest named adatum.com. All of the users in the research department are members of a group named Research.
Server Infrastructure
Each office has one data center. All of the servers in both of the data centers run Windows Server 2012 R2. Each office contains a private network and a perimeter network. The private network and the perimeter network are separated by a firewall. A. Datum has a pilot implementation of a private cloud in the Seattle office. The relevant servers in the Seattle office are configured as shown in the following table.

Server7 is a member of a workgroup. Server7 is located in the perimeter network of the Seattle office. Key management for VMM uses a local store. VMM and Operations Manager use Server3 as a database server.

NEW QUESTION 212
……

NEW QUESTION 213
You need to configure Server1 to meet the cloud infrastructure requirements. What should you do?

A.    Reinstall VMM.
B.    Create a mirrored volume.
C.    Install the Storage Replica feature.
D.    Create a storage space and use the mirror resiliency type.

Answer: C
Explanation:
Storage Replica (SR) is a new feature that enables storage-agnostic, block-level, synchronous replication between servers for disaster recovery, as well as stretching of a failover cluster for high availability. Synchronous replication enables mirroring of data in physical sites with crash-consistent volumes ensuring zero data loss at the file system level. Asynchronous replication allows site extension beyond metropolitan ranges with the possibility of data loss.
Scenario:
* Server1 is in a private cloud in the Seattle Office
* Infrastructrure requirements include:
Ensure that all of the private cloud components are highly available.
Reference: Getting started with Storage Replica in Windows Server Technical Preview
http://blogs.technet.com/b/craigf/archive/2014/10/04/getting-started-with-storage-replica-in-windows-server-technical-preview.aspx

NEW QUESTION 214
……

Download the newest PassLeader 70-247 dumps from passleader.com now! 100% Pass Guarantee! — http://www.passleader.com/70-247.html

NEW QUESTION 216
You need to meet the cloud infrastructure requirements for the servers in the perimeter network of the Seattle office. Which port should you allow on the firewall?

A.    443
B.    5723
C.    5986
D.    8531

Answer: B
Explanation:

Port 5723 is used by the Operation Manager Reporting server (and Management Server), which is used for Monitoring.
Scenario:
* Ensure that the servers in the perimeter network of the Seattle office can be monitored by using Operations Manager.
* Server7 is located in the perimeter network of the Seattle office.
Reference: System Requirements: System Center 2012 – Operations Manager
https://technet.microsoft.com/en-us/library/jj656649.aspx

NEW QUESTION 217
You have the servers configured as shown in the following table.

Users access the App Controller web-based self-service portal by using an URL of https:// server2.contoso.com. Users report that each time they access the portal, they receive a certificate error message. You install a certificate that is issued by a trusted third-party certification authority (CA). The certificate has a subject name of server2.contoso.com. You need to ensure that the users can access the portal by using the URL of https://server2.contoso.com. The solution must prevent the users from receiving certificate error messages. What should you configure for the App Controller web site?

A.    Basic Settings
B.    Bindings
C.    SSL Settings
D.    Advanced Settings

Answer: C
Explanation:
On the Configure website page of the App Controller, you can specify the SSL Certificate:
Select whether you want App Controller Setup to generate a self-signed certificate or use a previously imported certificate for SSL.
Reference: Installing App Controller
https://technet.microsoft.com/en-us/library/gg696046.aspx

NEW QUESTION 218
……


Download the newest PassLeader 70-247 dumps from passleader.com now! 100% Pass Guarantee!

70-247 PDF dumps & 70-247 VCE dumps: http://www.passleader.com/70-247.html (219 Q&As)


[Pass Ensure VCE Dumps] Download PassLeader 70-516 VCE Practice Test And PDF Study Guide Collection (161-180)

$
0
0

What are the new 70-516 exam questions? And Where to download the latest 70-516 exam dumps? Now, PassLeader have been publised the new version of 70-516 braindumps with new added 70-516 exam questions. PassLeader offer the latest 70-516 PDF and VCE dumps with New Version VCE Player for free download, and PassLeader’s new 286q 70-516 practice tests ensure your exam 100 percent pass. Visit www.passleader.com to get the 100 percent pass ensure 286q 70-516 exam questions!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 161
The database contains orphaned Color records that are no longer connected to Part records. You need to clean up the orphaned records. You have an existing ContosoEntities context object named context. Which code segment should you use?

A.    var unusedColors = context.Colors.
Where(c => !c.Parts.Any()).ToList();
foreach (var unused in unusedColors){
  context.DeleteObject(unused)
}
context.SaveChanges();
B.    context.Colors.TakeWhile(c => !c.Parts.Any());
context.SaveChanges();
C.    context.Colors.ToList().RemoveAll(c => !c.Parts.Any());
context.SaveChanges();
D.    var unusedColors = context.Colors.Where(c => !c.Parts.Any());
context.DeleteObject(unusedColors);
context.SaveChanges();

Answer: A

QUESTION 162
You need to write a LINQ query that can be used against a ContosoEntities context object named context to find all parts that have a duplicate name. Which of the following queries should you use? (Each correct answer presents a complete solution. Choose two).

A.    context.Parts.Any(p => context.Parts.Any(q => p.Name == q.Name));
B.    context.Parts.GroupBy(p => p.Name).Where(g => g.Count() > 1).
SelectMany(x => x);
C.    context.Parts.SelectMany(p => context.Parts.
Select(q => p.Name == q.Name && p.Id != q.Id));
D.    context.Parts.Where(p => context.Parts.Any(q =>
q.Name == p.Name && p.Id != q.Id);

Answer: BD

QUESTION 163
You add a table to the database to track changes to part names. The table stores the following row values:
– the username of the user who made the change a part ID
– the new part name a DateTime value
You need to ensure detection of unauthorized changes to the row values. You also need to ensure that database users can view the original row values.

A.    Add a column named signature.
Use System.Security.Cryptography.
RSA to create a signature for all of the row values.
Store the signature in the signature column.
Publish only the public key internally.
B.    Add a column named hash.
Use System.Security.Cryptography.MD5 to create an MD5 hash of the row values, and store in the hash column.
C.    Use System.Security.Cryptography.RSA to encrypt all the row values.
Publish only the key internally.
D.    Use System.Security.Cryptography.DES to encrypt all the row values using an encryption key held by the application.

Answer: A

QUESTION 164
Drag and Drop Question
The user interface requires that a paged view be displayed of all the products sorted in alphabetical order. The user interface supplies a current starting index and a page size in variables named startIndex and pageSize of type int. You need to construct a LINQ expression that will return the appropriate Parts from the database from an existing ContosoEntities context object named context. You begin by writing the following expression:
context.Parts
Which query parts should you use in sequence to complete the expression? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)

A.    .OrderBy(x => x.Name)
B.    .Skip(pageSize)
C.    .Skip(startIndex)
D.    .Take(pageSize);
E.    .Take(startIndex)

Answer: ACD

QUESTION 165
You are developing a new feature in the application to display a list of all bundled products. You need to write a LINQ query that will return a list of all bundled products. Which query expression should you use?

A.    context.Parts.Cast<Product>()
.Where(p => p.Descendants.Any(d => d is Product))
B.    context.Parts.OfType<Product>()
.Where(p => p.Descendants.Any(d => d is Product))
C.    context.Parts.Cast<Product>()
.ToList()
.Where(p => p.Descendants.Any(d => d is Product))
D.    context.Parts.OfType<Product>()
.ToList()
.Where(p => p.Descendants.Any(d => d is Product))

Answer: D
Explanation:
OfType() Filters the elements of an IEnumerable based on a specified type.
Enumerable.OfType<TResult> Method
http://msdn.microsoft.com/en-us/library/bb360913.aspx

QUESTION 166
You use Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The Product entity in the LINQ to SQL model contains a field named Productlmage. The Productlmage field holds a large amount of binary data. You need to ensure that the Productlmage field is retrieved from the database only when it is needed by the application. What should you do?

A.    Set the Update Check property on the Productlmage property of the Product entity to Never.
B.    Set the Auto-Sync property on the Productlmage property of the Product entity to Never.
C.    Set the Delay Loaded property on the Productlmage property of the Product entity to True.
D.    When the context is initialized, specify that the Productlmage property should not be retrieved by using DataLoadOptions

Answer: C
Explanation:
Lazy loading is configured in the LINQ to SQL designer by selecting an entity and then, in the Properties window, setting the Delay Loaded property to true.The Delay Loaded property indicates that you want lazy loading of the column.
CHAPTER 4 LINQ to SQL
Lesson 1: What Is LINQ to SQL?
Eager Loading vs. Lazy Loading (page 254)
http://geekswithblogs.net/AzamSharp/archive/2008/03/29/120847.aspx
http://weblogs.asp.net/scottgu/archive/2007/05/29/linq-to-sql-part-2-defining-our-data-model-classes.aspx

QUESTION 167
You use Microsoft .NET Framework 4.0 to develop an application that uses Entity Framework. The application includes the following Entity SQL (ESQL) query.
SELECT VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
You need to modify the query to support paging of the query results. Which query should you use?

A.    SELECT TOP Stop VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
SKIP @skip
B.    SELECT VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
SKIP @skip LIMIT @limit
C.    SELECT SKIP @skip VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice
LIMIT @limit
D.    SELECT SKIP @skip TOP Stop VALUE product
FROM AdventureWorksEntities.Products AS product
ORDER BY product.ListPrice

Answer: B
Explanation:
Entity SQL Reference
http://msdn.microsoft.com/en-us/library/bb387118.aspx
How to: Page Through Query Results
http://msdn.microsoft.com/en-us/library/bb738702.aspx

QUESTION 168
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create the following Entity Data Model. The application contains a class as shown in the following code segment. (Line numbers are included for reference only.)
01 public class MyBaseClass : EntityObject
02 {
03    ….
04 }
You need to ensure that all generated entities inherit from MyBaseClass. What should you do?

A.    Change MyBaseClass to inherit from ObjectContext.
B.    Create a new ObjectQuery that uses MyBaseClass as the type parameter.
C.    Modify the generated code file so that all entities inherit from MyBaseClass.
D.    Use the ADO.NET EntityObject Generator template to configure all entities to inherit from MyBaseClass.

Answer: D
Explanation:
You can use the Text Template Transformation Toolkit (T4) to generate your entity classes, and Visual Studio .
NET provides the T4 EntityObject Generator template by which you can control the entity object generation.
Visual Studio .NET also provides the T4 SelfTracking Entity Generator template by which you can create and control the Add an EntityObject Generator to your project and add the new modification to the text template.self-tracking entity classes. Add an EntityObject Generator to your project and add the new modification to the text template.
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
The EntityObject Generator (page 403-404)
http://blogs.msdn.com/b/efdesign/archive/2009/01/22/customizing-entity-classes-with-t4.aspx

QUESTION 169
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application defines the following Entity Data Model. Within the .edmx file, the following function is defined:
<Function Name=”Round” ReturnType=”Decimal”>
   <Parameter Name=”val” Type=”Decimal” />
   <DefiningExpression>
         CAST(val as Edm.Int32)
   </DefiningExpression>
</Function>
The application includes the following LINQ query.
var query = from detail in context.SalesOrderDetails
            select detail.LineTotal.Round();
You need to ensure that the Round function executes on the database server when the query is executed. Which code segment should you use?

A.    public static class DecimalHelper
{
   [EdmFunction(“SqlServer”, “Round”)]
   public static Decimal Round(this Decimal Amt)
   {
      throw new NotSupportedException();
   }
}
B.    public static class DecimalHelper
{
   [EdmFunction(“Edm”, “Round”)]
   public static Decimal Round(this Decimal Amt)
   {
      throw new NotSupportedException();
   }
}
C.    public static class DecimalHelper
{
   public static SqlDecimal Round(this Decimal input)
   {
      return SqlDecimal.Round(input, 0);
   }
}
D.    public static class DecimalHelper
{
   public static Decimal Round(this Decimal input)
   {
      return (Decimal)(Int32)input;
   }
}

Answer: B
Explanation:
EdmFunctionAttribute Class
http://msdn.microsoft.com/en-us/library/system.data.objects.dataclasses.edmfunctionattribute.aspx
How to: Call Model-Defined Functions in Queries
http://msdn.microsoft.com/en-us/library/dd456857.aspx
The model-defined function has been created in the conceptual model, but you still need a way to connect your code to it. To do so, add a function into your C# code, which will have to be annotated with the EdmFunctionAttribute attribute. This function can be another instance method of the class itself, but best practice is to create a separate class and define this method as static.

QUESTION 170
You use Microsoft .NET Framework 4.0 to develop an application. You write the following code to update data in a Microsoft SQL Server 2008 database. (Line numbers are included for reference only.)
01 private void ExecuteUpdate(SqlCommand cmd, string connString, string updateStmt)
02 {
03     …
04 }
You need to ensure that the update statement executes and that the application avoids connection leaks. Which code segment should you insert at line 03?

A.    SqlConnection conn = new SqlConnection(connString);
conn.Open();
cmd.Connection = conn;
cmd.CommandText = updateStmt;
cmd.ExecuteNonQuery();
cmd.Connection.Close() ;
B.    using (SqlConnection conn = new SqlConnection(connString))
{
   cmd.Connection = conn;
   cmd.CommandText = updateStmt;
   cmd.ExecuteNonQuery();
   cmd.Connection.Close();
}
C.    using (SqlConnection conn = new SqlConnection(connString))
{
   conn.Open() ;
   cmd.Connection = conn;
   cmd.CommandText = updateStmt;
   cmd.ExecuteNonQuery() ;
}
D.    SqlConnection conn = new SqlConnection(connString);
conn.Open();
cmd.Connection = conn;
cmd.CommandText = updateStmt;
cmd.ExecuteNonQuery();

Answer: C
Explanation:
http://stackoverflow.com/questions/376068/does-end-using-close-an-open-sql-connection
http://www.w3enterprises.com/articles/using.aspx
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx


http://www.passleader.com/70-516.html

QUESTION 171
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create an Entity Data Model (EDM). You need to create a database creation script for the EDM. What should you do?

A.    Use a new Self-Tracking Entities template.
B.    Drag entities to Server Explorer.
C.    Run the Generate Database command.
D.    Select Run Custom Tool from the solution menu.

Answer: C
Explanation:
You can generate the database from the conceptual model: Right-click the Entity Framework designer surface and then choose Generate Database From Model. The script has been created and saved to a file, but it has not been executed.
Model First
http://blogs.msdn.com/b/efdesign/archive/2008/09/10/model-first.aspx

QUESTION 172
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You need to ensure that the application connects to the database server by using SQL Server authentication. Which connection string should you use?

A.    SERVER=MyServer; DATABASE=AdventureWorks;
Integrated Security=SSPI; UID=sa; PWD=secret;
B.    SERVER=MyServer; DATABASE=AdventureWorks;
UID=sa; PWD=secret;
C.    SERVER=MyServer; DATABASE=AdventureWorks;
Integrated Security=false;
D.    SERVER=MyServer; DATABASE=AdventureWorks;
Trusted Connection=true;

Answer: B
Explanation:
SQL Server autentification using the passed-in user name and password.
User ID, Uid, User, Password, Pwd Connection String Syntax (ADO.NET)
http://msdn.microsoft.com/en-us/library/ms254500.aspx

QUESTION 173
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You add the following stored procedure to the database.
CREATE PROCEDURE dbo.GetClassAndStudents
AS
BEGIN
SELECT * FROM dbo.Class
SELECT * FROM dbo.Student
END
You create a SqIConnection named conn that connects to the database. You need to fill a DataSet from the result that is returned by the stored procedure. The first result set must be added to a DataTable named Class, and the second result set must be added to a DataTable named Student. Which code segment should you use?

A.    DataSet ds = new DataSet();
SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);
ds.Tables.Add(“Class”);
ds.Tables.Add(“Student”);
ad.Fill(ds);
B.    DataSet ds = new DataSet();
SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);
ad.TableMappings.Add(“Table”, “Class”);
ad.TableMappings.Add(“Table1”, “Student”) ;
ad.Fill(ds) ;
C.    DataSet ds = new DataSet();
SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);
ad.MissingMappingAction = MissingMappingAction.Ignore;
ad.Fill(ds, “Class”);
ad.Fill(ds, “Student”);
D.    DataSet ds = new DataSet();
SqlDataAdapter ad = new SqlDataAdapter(“GetClassAndStudents”, conn);
ad.Fill(ds);

Answer: B
Explanation:
http://msdn.microsoft.com/en-us/library/ms810286.aspx

QUESTION 174
You use Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application defines the following Entity SQL (ESQL) query, which must be executed against the mode.
string prodQuery = “select value p from Products as p where p.ProductCategory.Name = @p0″;
You need to execute the query. Which code segment should you use?

A.    var prods = ctx.CreateQuery<Product>(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();
B.    var prods = ctx.ExecuteStoreCommand(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();
C.    var prods = ctx.ExecuteFunction<Product>(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();
D.    var prods = ctx.ExecuteStoreQuery<Product>(prodQuery,
new ObjectParameter(“p0″, “Road Bikes”)).ToList();

Answer: A
Explanation:
CreateQuery<T>-Creates an ObjectQuery<T> in the current object context by using the specified query string.
ExecuteStoreCommand-Executes an arbitrary command directly against the data source using the existing connection.
ExecuteFunction(String, ObjectParameter[])-Executes a stored procedure or function that is defined in the data source and expressed in the conceptual model; discards any results returned from the function; and returns the number of rows affected by the execution. ExecuteStoreQuery<TElement>(String, Object[])-Executes a query directly against the data source that returns a sequence of typed results.
ObjectContext.CreateQuery<T> Method
http://msdn.microsoft.com/en-us/library/bb339670.aspx

QUESTION 175
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. The application uses nested transaction scopes. An inner transaction scope contains code that inserts records into the database. You need to ensure that the inner transaction can successfully commit even if the outer transaction rolls back. What are two possible TransactionScope constructors that you can use for the inner transaction to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A.    TransactionScope(TransactionScopeOption.Required)
B.    TransactionScope()
C.    TransactionScope(TransactionScopeOption.RequiresNew)
D.    TransactionScope(TransactionScopeOption.Suppress)

Answer: CD
Explanation:
Required-A transaction is required by the scope.
It uses an ambient transaction if one already exists.
Otherwise, it creates a new transaction before entering the scope.
This is the default value.
RequiresNew-A new transaction is always created for the scope.
Suppress-The ambient transaction context is suppressed when creating the scope.
All operations within the scope are done without an ambient transaction context.
TransactionScopeOption Numeration
http://msdn.microsoft.com/en-us/library/system.transactions.transactionscopeoption.aspx

QUESTION 176
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 database includes a table that contains information about all the employees. The database table has a field named EmployeeType that identifies whether an employee is a Contractor or a Permanent employee. You declare the Employee entity base type. You create a new Association entity named Contractor that inherits the Employee base type. You need to ensure that all Contractors are bound to the Contractor class. What should you do?

A.    Modify the .edmx file to include the following line of code:
<NavigationProperty Name=”Type” FromRole=”EmployeeType” ToRole=”Contractor” />
B.    Modify the .edmx file to include the following line of code:
<Condition ColumnName=”EmployeeType” Value=”Contractor” />
C.    Use the Entity Data Model Designer to set up an association between the Contractor class and EmployeeType.
D.    Use the Entity Data Model Designer to set up a referential constraint between the primary key of the Contractor class and EmployeeType.

Answer: B
Explanation:
<Association Name=”FK_OrderDetails_Orders1″>
<End Role=”Orders” Type=”StoreDB.Store.Orders” Multiplicity=”1″>
<OnDelete Action=”Cascade” />
</End>
<End Role=”OrderDetails” Type=”StoreDB.Store.OrderDetails” Multiplicity=”*” /> <ReferentialConstraint>
<Principal Role=”Orders”>
<PropertyRef Name=”ID” />
</Principal>
<Dependent Role=”OrderDetails”>
<PropertyRef Name=”OrderId” />
</Dependent>
</ReferentialConstraint>
</Association>

QUESTION 177
You use Microsoft Visual Studio 2010 and Microsoft ADO.NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET LINQ to SQL model to retrieve data from the database. You use stored procedures to return multiple result sets. You need to ensure that the result sets are returned as strongly typed values. What should you do?

A.    Apply the FunctionAttribute and ResultTypeAttribute to the stored procedure function.
Use the GetResult<TElement> method to obtain an enumerator of the correct type.
B.    Apply the FunctionAttribute and ParameterAttribute to the stored procedure function and directly access the strongly typed object from the results collection.
C.    Apply the ResultTypeAttribute to the stored procedure function and directly access the strongly typed object from the results collection.
D.    Apply the ParameterAttribute to the stored procedure function.
Use the GetResult<TElement> method to obtain an enumerator of the correct type.

Answer: A
Explanation:
You must use the IMultipleResults.GetResult<TElement> Method pattern to obtain an enumerator of the correct type, based on your knowledge of the stored procedure.
FunctionAttribute Associates a method with a stored procedure or user-defined function in the database.
IMultipleResults.GetResult<TElement> Method
http://msdn.microsoft.com/en-us/library/bb534218.aspx

QUESTION 178
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You create stored procedures by using the following signatures:
CREATE procedure [dbo].[Product_Insert](@name varchar(50),@price float)
CREATE procedure [dbo].[Product_Update](@id int, @name varchar(50), @price float)
CREATE procedure [dbo].[Product_Delete](@id int)
CREATE procedure [dbo].[Order_Insert](@productId int, @quantity int)
CREATE procedure [dbo].[Order_Update](@id int, @quantity int,@originalTimestamp timestamp)
CREATE procedure [dbo].[Order_Delete](@id int)
You create a Microsoft ADO.NET Entity Data Model (EDM) by using the Product and Order entities as shown in the exhibit. You need to map the Product and Order entities to the stored procedures. To which two procedures should you add the @productId parameter? (Each correct answer presents part of the solution. Choose two.)

A.    Product_Delete
B.    Product_Update
C.    Order_Delete
D.    Order_Update

Answer: CD

QUESTION 179
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use Plain Old CLR objects (POCO) to model your entities. The application communicates with a Windows Communication Foundation (WCF) Data Services service. You need to ensure that entities can be sent to the service as XML. What should you do?

A.    Apply the virtual keyword to the entity properties.
B.    Apply the [Serializable] attribute to the entities.
C.    Apply the [DataContract(IsReference = true)] attribute to the entities.
D.    Apply the [DataContract(IsReference = false)] attribute to the entities.

Answer: C
Explanation:
DataContractAttribute Specifies that the type defines or implements a data contract and is serializable by a serializer, such as the DataContractSerializer. To make their type serializable, type authors must define a data contract for their type. IsReference Gets or sets a value that indicates whether to preserve object reference data.

QUESTION 180
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. You need to create a database from your model. What should you do?

A.    Run the edmgen.exe tool in FullGeneration mode.
B.    Run the edmgen.exe tool in FromSSDLGeneration mode.
C.    Use the Update Model Wizard in Visual Studio.
D.    Use the Generate Database Wizard in Visual Studio. Run the resulting script against a Microsoft SQL Server database.

Answer: D
Explanation:
To update the database, right-click the Entity Framework designer surface and choose Generate Database From Model. The Generate Database Wizard produces a SQL script file that you can edit and execute.


http://www.passleader.com/70-516.html

[Pass Ensure VCE Dumps] Share PassLeader New 286q 70-516 Exam Questions (181-200)

$
0
0

What are the new 70-516 exam questions? And Where to download the latest 70-516 exam dumps? Now, PassLeader have been publised the new version of 70-516 braindumps with new added 70-516 exam questions. PassLeader offer the latest 70-516 PDF and VCE dumps with New Version VCE Player for free download, and PassLeader’s new 286q 70-516 practice tests ensure your exam 100 percent pass. Visit www.passleader.com to get the 100 percent pass ensure 286q 70-516 exam questions!

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 181
You use Microsoft Visual Studio 2010 and Microsoft. NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use Entity SQL of the ADO.NET Entity Framework to retrieve data from the database. You need to define a custom function in the conceptual model. You also need to ensure that the function calculates a value based on properties of the object. Which two XML element types should you use? (Each correct answer presents part of the solution. Choose two.)

A.    Function
B.    FunctionImport
C.    Dependent
D.    Association
E.    DefiningExpression

Answer: AE

QUESTION 182
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You deploy a Windows Communication Foundation (WCF) Data Service to a production server. The application is hosted by Internet Information Services (IIS). After deployment, applications that connect to the service receive the following error message:
“The server encountered an error processing the request. See server logs for more details.”
You need to ensure that the actual exception data is provided to client computers. What should you do?

A.    Modify the application’s Web.config file. Set the value for the customErrors element to Off.
B.    Modify the application’s Web.config file. Set the value for the customErrors element to RemoteOnly.
C.    Add the FaultContract attribute to the class that implements the data service.
D.    Add the ServiceBehavior attribute to the class that implements the data service.

Answer: D

QUESTION 183
The application populates a DataSet object by using a SqlDataAdapter object. You use the DataSet object to update the Categories database table in the database. You write the following code segment. (Line numbers are included for reference only.)
01 SqlDataAdapter dataAdpater = new SqlDataAdapter(“SELECT CategoryID, CategoryName FROM Categories”, connection);
02 SqlCommandBuilder builder = new SqlCommandBuilder(dataAdpater);
03 DataSet ds = new DataSet();
04 dataAdpater.Fill(ds);
05 foreach (DataRow categoryRow in ds.Tables[0].Rows)
06 {
07      if (string.Compare(categoryRow[“CategoryName”].ToString(), searchValue, true) == 0)
08      {
09         …
10      }
11 }
12 dataAdpater.Update(ds);
You need to remove all the records from the Categories database table that match the value of the searchValue variable. Which line of code should you insert at line 09?

A.    categoryRow.Delete();
B.    ds.Tables[0].Rows.RemoveAt(0);
C.    ds.Tables[0].Rows.Remove(categoryRow);
D.    ds.Tables[0].Rows[categoryRow.GetHashCode()].Delete();

Answer: A
Explanation:
DataRow Class
http://msdn.microsoft.com/en-us/library/system.data.datarow.aspx
DataRow.Delete() Deletes the DataRow.

QUESTION 184
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the ADO.NET Entity Framework to model entities. The database includes objects based on the exhibit. (Click the Exhibit button.) The application includes the following code segment. (Line numbers are included for reference only.)
01 using (AdventureWorksEntities advWorksContext = new AdventureWorksEntities()){
02   …
03 }
You need to retrieve a list of all Products from todays sales orders for a specified customer. You also need to ensure that the application uses the minimum amount of memory when retrieving the list. Which code segment should you insert at line 02?

A.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“customerId”, customerId)).First();
customer.SalesOrderHeader.Load();
foreach (SalesOrderHeader order in customer.SalesOrderHeader)
{
  order.SalesOrderDetail.Load();
  if (order.OrderDate.Date == DateTime.Today.Date)
  {
    foreach (SalesOrderDetail item in order.SalesOrderDetail)
    {
Console.WriteLine(String.Format(“Product: {0} “, item.ProductID));
    }
  }
}
B.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“customerId”, customerId)).First();
customer.SalesOrderHeader.Load();
foreach (SalesOrderHeader order in customer.SalesOrderHeader)
{
  if (order.OrderDate.Date == DateTime.Today.Date)
  {
    order.SalesOrderDetail.Load();
    foreach (SalesOrderDetail item in order.SalesOrderDetail)
    {
Console.WriteLine(String.Format(“Product: {0} “, item.ProductID));
    }
  }
}
C.    Contact customer = (from contact in context.Contact.Include(“SalesOrderHeader”) select contact).FirstOrDefault();
foreach (SalesOrderHeader order in customer.SalesOrderHeader)
{
  order.SalesOrderDetail.Load();
  if (order.OrderDate.Date == DateTime.Today.Date)
  {
    foreach (SalesOrderDetail item in order.SalesOrderDetail)
    {
Console.WriteLine(String.Format(“Product: {0} “, item.ProductID));
    }
  }
}
D.    Contact customer = (from contact in context.Contact.Include(“SalesOrderHeader.SalesOrderDetail”) select contact).FirstOrDefault();
foreach (SalesOrderHeader order in customer.SalesOrderHeader)
{
  if (order.OrderDate.Date == DateTime.Today.Date)
  {
    foreach (SalesOrderDetail item in order.SalesOrderDetail)
    {
Console.WriteLine(String.Format(“Product: {0} “, item.ProductID));
    }
  }
}

Answer: B
Explanation:
A & C check the Order date after Order Detail, so we are retrieving more Order details than necessary. D is calling a Function (using eager loading) for the First Contact record only, so does not meet the requirements.

QUESTION 185
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application contains the following code segment. (Line numbers are included for reference only.)
01 class DataAccessLayer
02 {
03   private static string connString;
04   …
05   …
06   public static DataTable GetDataTable(string command){
07   …
08   …
09   }
10 }
You need to define the connection life cycle of the DataAccessLayer class. You also need to ensure that the application uses the minimum number of connections to the database. What should you do?

A.    Insert the following code segment at line 04.
private static SqlConnection conn = new SqlConnection(connString);
public static void Open()
{
   conn.Open();
}
public static void Close()
{
   conn.Close();
}
B.    Insert the following code segment at line 04.
private SqlConnection conn = new SqlConnection(connString);
public void Open()
{
   conn.Open();
}
public void Close()
{
   conn.Close();
}
C.    Replace line 01 with the following code segment.
class DataAccessLayer : IDisposable
Insert the following code segment to line 04.
private SqlConnection conn = new SqlConnection(connString);
public void Open()
{
   conn.Open();
}
public void Dispose()
{
   conn.Close();
}
D.    Insert the following code segment at line 07:
using (SqlConnection conn = new SqlConnection(connString))
{
   conn.Open();
}

Answer: D
Explanation:
One thing you should always do is to make sure your connections are always opened within a using statement. Using statements will ensure that even if your application raises an exception while the connection is open, it will always be closed (returned to the pool) before your request is complete. This is very important, otherwise there could be connection leaks.

QUESTION 186
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 contains two SqlCommand objects named cmd1 and cmd2. You need to measure the time required to execute each command. Which code segment should you use?

A.    Stopwatch w1 = new Stopwatch();
w1.Start();
cmd1.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
w1.Start();
cmd2.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
B.    Stopwatch w1 = new Stopwatch();
w1.Start();
cmd1.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
w1.Reset();
cmd2.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
C.    Stopwatch w1 = Stopwatch.StartNew();
cmd1.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
w1.Start();
cmd2.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
D.    Stopwatch w1 = Stopwatch.StartNew();
cmd1.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);
w1 = Stopwatch.StartNew();
cmd2.ExecuteNonQuery();
w1.Stop();
Trace.WriteLine(w1.ElapsedMilliseconds);

Answer: D
Explanation:
A & C do not reset the stopwatch before running cmd2. B does not start the stopwatch after resetting the stopwatch Start() does not reset the stopwatch, whereas StartNew() will create a new instance of the Stop watch and initialise the elapsed time to Zero.
Stopwatch Class
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx

QUESTION 187
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?

A.    Insert the following code segment at line 02.
TransactionScope(TransactionScopeOption.Suppress)
Insert the following code segment at line 08.
using (SqlConnection cn2 = new SqlConnection(sql2))
{
   try
   {
      cn2.Open();
      …
      cn1.Open();
      …
   }
   catch (Exception ex){}
}
B.    Insert the following code segment at line 02.
TransactionScope(TransactionScopeOption.Suppress)
Insert the following code segment at line 08.
cn1.Open();

using (SqlConnection cn2 = new SqlConnection(sql2))
{
  try
  {
      cn2.Open();
      …
  }
  catch (Exception ex){}
}
C.    Insert the following code segment at line 02.
TransactionScope(TransactionScopeOption.RequiresNew)
Insert the following code segment at line 08.
using (SqlConnection cn2 = new SqlConnection(sql2))
{
   try{
      cn2.Open();
      …
      cn1.Open();
      …
   }
   catch (Exception ex){}
}
D.    Insert the following code segment at line 02.
TransactionScope(TransactionScopeOption.RequiresNew)
Insert the following code segment at line 08.
cn1.Open();

using (SqlConnection cn2 = new SqlConnection(sql2))
{
   try
   {
      cn2.Open();
      …
   }
   catch (Exception ex){}
}

Answer: B

QUESTION 188
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?

A.    int FldIdx = 0;
EntityKey key = record.GetValue(FldIdx) as EntityKey;
foreach (EntityKeyMember keyMember in key.EntityKeyValues)
{
return keyMember.Key + ” : ” + keyMember.Value;
}
B.    IExtendedDataRecord record = rdr[“EmailPhone”]as IExtendedDataRecord;
int FldIdx = 0;
return record.GetValue(FldIdx);
C.    DbDataRecord nestedRecord = rdr[“EmailPhoneComplexProperty”]
as DbDataRecord;
return nestedRecord;
D.    int fieldCount = rdr[“EmailPhone”].DataRecordInfo.FieldMetadata.Count;
for (int FldIdx = 0; FldIdx < fieldCount; FldIdx++)
{
  rdr.GetName(FldIdx);
  if (rdr.IsDBNull(FldIdx) == false)
  {
    return rdr[“EmailPhone”].GetValue(FldIdx).ToString();
}
}

Answer: C

QUESTION 189
You use Microsoft Visual Studio 2010 and Microsoft Entity Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use the ADO.NET LINQ to SQL model to retrieve data from the database. The applications contains the Category and Product entities as shown in the following exhibit. You need to ensure that LINO to SQL executes only a single SQL statement against the database. You also need to ensure that the query returns the list of categories and the list of products. Which code segment should you use?

A.    using (NorthwindDataContext dc = new NorthwindDataContext()) {
   dc.ObjectTrackingEnabled = false;
   var categories = from c in dc.Categories
                           select c;
   foreach (var category in categories) {
      Console.WriteLine(“{0} has {1} products”,
category.CategoryName, category.Products.Count);
   }
}
B.    using (NorthwindDataContext dc = new NorthwindDataContext()) {
   dc.DeferredLoadingEnabled = false;
   DataLoadOptions dlOptions = new DataLoadOptions();
   dlOptions.LoadWith<Category>(c => c.Products);
   dc.LoadOptions = dlOptions;
   var categories = from c in dc.Categories
                           select c;
   foreach (var category in categories) {
      Console.WriteLine(“{0} has {1} products”,
category.CategoryName, category.Products.Count);
   }
}
C.    using (NorthwindDataContext dc = new NorthwindDataContext()) {
   dc.DeferredLoadingEnabled = false;
   var categories = from c in dc.Categories
                           select c;
   foreach (var category in categories) {
      Console.WriteLine(“{0} has {1} products”,
category.CategoryName, category.Products.Count);
   }
}
D.    using (NorthwindDataContext dc = new NorthwindDataContext()) {
   dc.DeferredLoadingEnabled = false;
   DataLoadOptions dlOptions = new DataLoadOptions();
   dlOptions.AssociateWith<Category>(c => c.Products);
   dc.LoadOptions = dlOptions;
   var categories = from c in dc.Categories
                           select c;
   foreach (var category in categories) {
      Console.WriteLine(“{0} has {1} products”,
category.CategoryName, category.Products.Count);
   }
}

Answer: B
Explanation:
DataLoadOptions Class Provides for immediate loading and filtering of related data. DataLoadOptions.LoadWith(LambdaExpression)
Retrieves specified data related to the main target by using a lambda expression.
You can retrieve many objects in one query by using LoadWith. DataLoadOptions.AssociateWith(LambdaExpression)
Filters the objects retrieved for a particular relationship.
Use the AssociateWith method to specify sub-queries to limit the amount of retrieved data.
DataLoadOptions Class
http://msdn.microsoft.com/en-us/library/system.data.linq.dataloadoptions.aspx
How to: Retrieve Many Objects At Once (LINQ to SQL)
http://msdn.microsoft.com/en-us/library/Bb386917(v=vs.90).aspx
How to: Filter Related Data (LINQ to SQL)
http://msdn.microsoft.com/en-us/library/Bb882678(v=vs.100).aspx

QUESTION 190
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?

A.    string connectionString = ConfigurationSettings.AppSettings[“connectionString”];
B.    string connectionString = ConfigurationManager.AppSettings[“connectionString”];
C.    string connectionString = ApplicationManager.ConnectionStrings[“connectionString”];
D.    string connectionString = ConfigurationManager.ConnectionStrings[“connectionString”].ConnectionString;

Answer: D


http://www.passleader.com/70-516.html

QUESTION 191
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?

A.    ReadUncommited
B.    ReadCommited
C.    RepeatableRead
D.    Serializable

Answer: A

QUESTION 192
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model your entities. The application connects to a Microsoft SQL Server 2008 database named AdventureWorks by using Windows Authentication. Information about the required Entity Data Model (EDM) is stored in the following files:
– model.csdl
– model.ssdl
– model.msl
These files are embedded as resources in the MyCompanyData.dll file. You need to define the connection string that is used by the application. Which connection string should you add to the app.config file?

A.    <add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Data,
Culture=neutral,PublicKeyToken=null/model.csdIlres://MyCompany.Data,Culture=neutral,
PublicKeyToken=null/model.ssdl|res://MyCompany.Data,Culture=neutral,
PublicKeyToken=null/model.msl;
provider=System.Data.EntityClient;
provider connection string=’DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=True;
multipleactivesuitsets=true’”providerName=”System.Data.SqlClient”/>
B.    <add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Data,Culture=neutral,
PublicKeyToken=null/model.csdIlres://MyCompany.Data,Culture=neutral,
PublicKeyToken=null/model.ssdl|res://MyCompany.Data,Culture=neutral,
PublicKeyToken=null/model.msl;
provider=System.Data.SqlClient;
provider connection string=’DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=True;
multipleactivesuitsets=true’”providerName=”System.Data.EntityClient”/>
C.    <add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Datamodel.csdl|res://MyCompany.Data.model.ssdl|res://MyCompany.Data.model.msl;
provider=System.Data.SqlClient;
provider connection string=’DataSource=localhost;
Initial Catalog=AdventureWorks;lntegrated Security=SSPI;
multipleactivesuitsets=true’”providerName=”System.Data.EntityClient”/>
D.    <add name=”AdventureWorksEntities”
connectionString=”metadata=res://MyComparny.Data,Culture=neutral,
PublicKeyToken=null/model.csdIlres://MyComparny.Data,Culture=neutral,
PublicKeyToken=null/model.ssdIlres://MyComparny.Data,Culture=neutral,
PublicKeyToken=null/model.msl;
provider=System.Data.OleDBClient;
provider connection string=’Provider=sqloledb;DataSource=localhost;
Initial Catalog=AdventureWorks;
lntegrated Security=SSPI;multipleactivesuitsets=true’”providerName=”System.Data.EntityClient”/>

Answer: B
Explanation:
Answering this question pay attention to fact that Entity Framework is used, so settings provider=”System.Data.SqlClient” and providerName=”System.Data.EntityClient” shold be set.
Connection Strings
http://msdn.microsoft.com/en-us/library/cc716756.aspx

QUESTION 193
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The Data Definition Language (DDL) script of the database contains the following code segment:
CREATE TABLE [Sales].[SalesOrderHeader](
   [SalesOrderID] [int] IDENTITY(1,1) NOT NULL,
   [BillToAddressID] [int] NOT NULL,
   …
   CONSTRAINT [PK_SalesOrderHeader_SalesOrderID]
   PRIMARY KEY CLUSTERED ([SalesOrderID] ASC)
)
ALTER TABLE [Sales].[SalesOrderHeader]
   WITH CHECK ADD CONSTRAINT [FK_SalesOrderHeader_Address]
   FOREIGN KEY([BilIToAddressID])
   REFERENCES [Person].[Address]([AddressID])
You create an ADO.NET Entity Framework model. You need to ensure that the entities of the model correctly map to the DDL of the database. What should your model contain?

A.   
B.   
C.   
D.   

Answer: A

QUESTION 194
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You create a Database Access Layer (DAL) that is database-independent. The DAL includes the following code segment. (Line numbers are included for reference only.)
01 static void ExecuteDbCommand(DbConnection connection)
02 {
03    if (connection != null){
04       using (connection){
05          try{
06                connection.Open();
07                DbCommand command = connection.CreateCommand();
08                command.CommandText = “INSERT INTO Categories (CategoryName) VALUES (‘Low Carb’)”;
09                command.ExecuteNonQuery();
10          }
11          …
12          catch (Exception ex){
13                Trace.WriteLine(“Exception.Message: ” + ex.Message);
14          }
15       }
16    }
17 }
You need to log information about any error that occurs during data access. You also need to log the data provider that accesses the database. Which code segment should you insert at line 11?

A.    catch (OleDbException ex){
   Trace.WriteLine(“ExceptionType: ” + ex.Source);
   Trace.WriteLine(“Message: ” + ex.Message);
}
B.    catch (OleDbException ex){
   Trace.WriteLine(“ExceptionType: ” + ex.InnerException.Source);
   Trace.WriteLine(“Message: ” + ex.InnerException.Message);
}
C.    catch (DbException ex){
   Trace.WriteLine(“ExceptionType: ” + ex.Source);
   Trace.WriteLine(“Message: ” + ex.Message);
}
D.    catch (DbException ex){
   Trace.WriteLine(“ExceptionType: ” + ex.InnerException.Source);
   Trace.WriteLine(“Message: ” + ex.InnerException.Message);
}

Answer: C
Explanation:
Exception.InnerException Gets the Exception instance that caused the current exception. Message Gets a message that describes the current exception. Exception.Source Gets or sets the name of the application or the object that causes the error. OleDbException catches the exception that is thrown only when the underlying provider returns a warning or error for an OLE DB data source. DbException catches the common exception while accessing data base.

QUESTION 195
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application has an entity model that contains a SalesOrderHeader entity. The entity includes an OrderDate property of type DateTime. You need to retrieve the 10 oldest SalesOrderHeaders according to the OrderDate property. Which code segment should you use?

A.    var model = new AdventureWorksEntities();
var sales = model.SalesOrderHeaders.Take(10).OrderByDescending(soh => soh.OrderDate);
B.    var model = new AdventureWorksEntities();
var sales = model.SalesOrderHeaders.OrderByDescending(soh => soh.OrderDate).Take(10);
C.    var model = new AdventureWorksEntities();
var sales = model.SalesOrderHeaders.OrderBy(soh => soh.OrderDate).Take(10);
D.    var model = new AdventureWorksEntities();
var sales = model.SalesOrderHeaders.Take(10).OrderBy(soh => soh.OrderDate);

Answer: C
Explanation:
OrderBy() Sorts the elements of a sequence in ascending order according to a key. OrderByDescending() Sorts the elements of a sequence in descending order according to a key.
Enumerable.OrderBy<TSource, TKey> Method (IEnumerable<TSource>, Func<TSource, TKey>)
http://msdn.microsoft.com/en-us/library/bb534966.aspx

QUESTION 196
You use Microsoft .NET Framework 4.0 to develop an application that connects to two separate Microsoft SQL Server 2008 databases. The Customers database stores all the customer information, and the Orders database stores all the order information. The application includes the following code. (Line numbers are included for reference only.)
01   try
02   {
03       conn.Open();
04       tran = conn.BeginTransaction(“Order”);
05       SqlCommand cmd = new SqlCommand();
06       cmd.Connection = conn;
07       cmd.Transaction = tran;
08       tran.Save(“save1”);
09       cmd.CommandText = “INSERT INTO [Cust].dbo.Customer ”  + “(Name, PhoneNumber) VALUES (‘Paul Jones’, ” + “‘404-555-1212’)”;
10       cmd.ExecuteNonQuery();
11       tran.Save(“save2”);
12       cmd.CommandText = “INSERT INTO [Orders].dbo.Order ” + “(CustomerID) VALUES (1234)”;
13       cmd.ExecuteNonQuery();
14       tran.Save(“save3”);
15       cmd.CommandText = “INSERT INTO [Orders].dbo.” + “OrderDetail (OrderlD, ProductNumber) VALUES” + “(5678, ‘DC-6721’)”;
16       cmd.ExecuteNonQuery();
17       tran.Commit();
18   }
19   catch (Exception ex)
20   {
21       …
22   }
You run the program, and a timeout expired error occurs at line 16. You need to ensure that the customer information is saved in the database. If an error occurs while the order is being saved, you must roll back all of the order information and save the customer information. Which line of code should you insert at line 21?

A.    tran.Rollback();
B.    tran.Rollback(“save2”);
tran.Commit();
C.    tran.Rollback();
tran.Commit();
D.    tran.Rollback(“save2”);

Answer: B
Explanation:
Reference:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction.save.aspx
http://msdn.microsoft.com/en-us/library/4ws6y4dy.aspx

QUESTION 197
You use Microsoft .NET Framework 4.0 to develop an application. You use the XmlReader class to load XML from a location that you do not control. You need to ensure that loading the XML will not load external resources that are referenced in the XML. Which code segment should you use?

A.    XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.None;
XmlReader reader = XmlReader.Create(“data.xml”, settings);
B.    XmlReaderSettings settings = new XmlReaderSettings();
settings.CheckCharacters = true;
XmlReader reader = XmlReader.Create(“data.xml”, settings);
C.    XmlReaderSettings settings = new XmlReaderSettings();
settings.XmlResolver = null;
XmlReader reader = XmlReader.Create(“data.xml”, settings);
D.    XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Auto;
XmlReader reader = XmlReader.Create(“data.xml”, settings);

Answer: C
Explanation:
CheckCharacters Gets or sets a value indicating whether to do character checking. ConformanceLevel Gets or sets the level of conformance which the XmlReader will comply. ValidationType Gets or sets a value indicating whether the XmlReader will perform validation or type assignment when reading. XmlResolver Sets the XmlResolver used to access external documents.
XmlReaderSettings Class
http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.aspx
http://stackoverflow.com/questions/215854/prevent-dtd-download-when-parsing-xml
http://msdn.microsoft.com/en-us/library/x1h1125x.aspx

QUESTION 198
You use Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You add the following table to the database.
CREATE TABLE Orders(
ID numeric(18, 0) NOT NULL,
OrderName varchar(50) NULL,
OrderTime time(7) NULL,
OrderDate date NULL)
You write the following code to retrieve data from the OrderTime column. (Line numbers are included for reference only.)
01 SqlConnection conn = new SqlConnection(“…”);
02 conn.Open();
03 SqlCommand cmd = new SqlCommand(“SELECT ID, OrderTime FROM Orders”, conn);
04 SqlDataReader rdr = cmd.ExecuteReader();
05 ….
06 while(rdr.Read())
07 {
08     ….
09 }
You need to retrieve the OrderTime data from the database. Which code segment should you insert at line 08?

A.    TimeSpan time = (TimeSpan)rdr[1];
B.    Timer time = (Timer)rdr[1];
C.    string time = (string)rdr[1];
D.    DateTime time = (DateTime)rdr[1];

Answer: A
Explanation:
Pay attention to the fact that it goes about Microsoft SQL Server 2008 in the question. Types date and time are not supported in Microsoft SQL Server Express.
time (Transact SQL)
http://msdn.microsoft.com/en-us/library/bb677243.aspx
Using date and time data
http://msdn.microsoft.com/en-us/library/ms180878.aspx
Date and time functions
http://msdn.microsoft.com/en-us/library/ms186724.aspx
SQL Server Data Type Mappings (ADO.NET)
http://msdn.microsoft.com/en-us/library/cc716729.aspx

QUESTION 199
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the ADO.NET Entity Framework Designer to model entities. The model contains an entity type named Product. You need to ensure that a stored procedure will be invoked when the ObjectContext.SaveChanges method is executed after an attached Product has changed. What should you do in the ADO.NET Entity Framework Designer?

A.    Add a new entity that has a base class of Product that is mapped to the stored procedure.
B.    Add a stored procedure mapping for the Product entity type.
C.    Add a complex type named Product that is mapped to the stored procedure.
D.    Add a function import for the Product entity type.

Answer: B
Explanation:
The ObjectContext class exposes a SaveChanges method that triggers updates to the underlying database.
By default, these updates use SQL statements that are automatically generated, but the updates can use stored procedures that you specify.
The good news is that the application code you use to create, update, and delete entities is the same whether or not you use stored procedures to update the database.
To map stored procedures to entities, in the Entity Framework designer, right-click the entity and choose Stored Procedure Mapping.
In the Mapping Details window assign a stored procedure for insert, update, and delete.
CHAPTER 6 ADO.NET Entity Framework
Lesson 1: What Is the ADO.NET Entity Framework?
Mapping Stored Procedures(page 387-388)
Stored Procedures in the Entity Framework
http://msdn.microsoft.com/en-us/data/gg699321

QUESTION 200
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. You deploy the data service to the following URL: http://contoso.com/Northwind.svc. You add the following code segment. (Line numbers are included for reference only.)
01 var uri = new Uri(@”http://contoso.com/Northwind.svc/”);
02 var ctx = new NorthwindEntities(uri);
03 var categories = from c in ctx.Categories select c;
04 foreach (var category in categories) {
05    PrintCategory(category);
06    …
07    foreach (var product in category.Products) {
08       …
09       PrintProduct(product);
10    }
11 }
You need to ensure that the Product data for each Category object is lazy-loaded. What should you do?

A.    Add the following code segment at line 06:
ctx.LoadProperty(category, “Products”);
B.    Add the following code segment at line 08:
ctx.LoadProperty(product, “*”);
C.    Add the following code segment at line 06:
var strPrdUri = string.Format(“Categories({0})?$expand=Products”, category.CategoryID);
var productUri = new Uri(strPrdUri, UriKind.Relative);
ctx.Execute<Product>(productUri);
D.    Add the following code segment at line 08:
var strprdUri= string.format(“Products?$filter=CategoryID eq {0}”, category.CategoryID);
var prodcutUri = new Uri(strPrd, UriKind.Relative);
ctx.Execute<Product>(productUri);

Answer: A
Explanation:
LoadProperty(Object, String) Explicitly loads an object related to the supplied object by the specified navigation property and using the default merge option.
UriKind Enumeration
http://msdn.microsoft.com/en-us/library/system.urikind.aspx
RelativeOrAbsolute The kind of the Uri is indeterminate.
Absolute The Uri is an absolute Uri.
Relative The Uri is a relative Uri.


http://www.passleader.com/70-516.html

[Pass Ensure VCE Dumps] Learning PassLeader Free 286q 70-516 Exam Questions To Pass Exam with Great Ease (201-220)

$
0
0

How to pass 70-516 exam at the first time? PassLeader now is offering the free new version of 70-516 exam dumps. The new 286q 70-516 exam questions cover all the new added questions, which will help you to get well prepared for the exam 70-516, our premium 70-516 PDF dumps and VCE dumps are the best study materials for preparing the 70-516 exam. Come to passleader.com to get the valid 286q 70-516 braindumps with free version VCE Player, you will get success in the real 70-516 exam for your first try.

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 201
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You load records from the Customers table into a DataSet object named dataset. You need to retrieve the value of the City field from the first and last records in the Customers table. Which code segment should you use?

A.    DataTable dt = dataset.Tables[“Customers”];
string first = dt.Rows[0][“City”].ToString();
string last = dt.Rows[dt.Rows.Count – 1][“City”].ToString();
B.    DataTable dt = dataset.Tables[“Customers”];
string first = dt.Rows[0][“City”].ToString();
string last = dt.Rows[dt.Rows.Count][“City”].ToString();
C.    DataRelation relationFirst = dataset.Relations[0];
DataRelation relationLast = dataset.Relations[dataset.Relations.Count – 1];
string first = relationFirst.childTable.Columns[“City”].ToString();
string last = relationLast.childTable.Columns[“City”].ToString()
D.    DataRelation relationFirst = dataset.Relations[0];
DataRelation relationLast = dataset.Relations[dataset.Relations.Count];
string first = relationFirst.childTable.Columns[“City”].ToString();
string last = relationLast.childTable.Columns[“City”].ToString();

Answer: A

QUESTION 202
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application has two DataTable objects that reference the Customers and Orders tables in the database. The application contains the following code segment. (Line numbers are included for reference only.)
01 DataSet customerOrders = new DataSet();
02 customerOrders.EnforceConstraints = true;
03 ForeignKeyConstraint ordersFK = new ForeignKeyConstraint(“ordersFK”,
04                                    customerOrders.Tables[“Customers”].Columns[“CustomerID”],
05                                    customerOrders.Tables[“Orders”].Columns[“CustomerID”]);
06 …
07 customerOrders.Tables[“Orders”].Constraints.Add(ordersFK);
You need to ensure that an exception is thrown when you attempt to delete Customer records that have related Order records. Which code segment should you insert at line 06?

A.    ordersFK.DeleteRule = Rule.SetDefault;
B.    ordersFK.DeleteRule = Rule.None;
C.    ordersFK.DeleteRule = Rule.SetNull;
D.    ordersFK.DeleteRule = Rule.Cascade;

Answer: B
Explanation:
None No action taken on related rows, but exceptions are generated.
Cascade Delete or update related rows. This is the default.
SetNull Set values in related rows to DBNull.
SetDefault Set values in related rows to the value contained in the DefaultValue property. SetDefault specifies that all child column values be set to the default value.
CHAPTER 1 ADO.NET Disconnected Classes
Lesson 1: Working with the DataTable and DataSet Classes
Cascading Deletes and Cascading Updates (page 26)

QUESTION 203
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses a DataTable named OrderDetailTable that has the following columns:
– ID
– OrderID
– ProductID
– Quantity
– LineTotal
Some records contain a null value in the LineTotal field and 0 in the Quantity field. You write the following code segment. (Line numbers are included for reference only.)
01 DataColumn column = new DataColumn(“UnitPrice”, typeof(double));
02 …
03 OrderDetailTable.Columns.Add(column);
You need to add a calculated DataColumn named UnitPrice to the OrderDetailTable object. You also need to ensure that UnitPrice is set to 0 when it cannot be calculated. Which code segment should you insert at line 02?

A.    column.Expression = “LineTotal/Quantity”;
B.    column.Expression = “LineTotal/ISNULL(Quantity, 1)”;
C.    column.Expression = “if(Quantity > 0, LineTotal/Quantity, 0)”;
D.    column.Expression = “iif(Quantity > 0, LineTotal/Quantity, 0)”;

Answer: D
Explanation:
IIF ( boolean_expression, true_value, false_value )

QUESTION 204
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database and contains a LINQ to SQL data model. The data model contains a function named createCustomer that calls a stored procedure. The stored procedure is also named createCustomer. The createCustomer function has the following signature.
createCustomer (Guid customerID, String customerName, String address1)
The application contains the following code segment. (Line numbers are included for reference only.)
01 CustomDataContext context = new CustomDataContext();
02 Guid userID = Guid.NewGuid();
03 String address1 = “1 Main Steet”;
04 String name = “Marc”;
05 …
You need to use the createCustomer stored procedure to add a customer to the database. Which code segment should you insert at line 05?

A.    context.createCustomer(userID, customer1, address1);
B.    context.ExecuteCommand(“createCustomer”, userID, customer1, address1);
Customer customer = new Customer() { ID = userID, Address1 = address1, Name = customer1, };
C.    context.ExecuteCommand(“createCustomer”, customer);
Customer customer = new Customer() { ID = userID, Address1 = address1, Name = customer1, };
D.    context.ExecuteQuery(typeof(Customer), “createCustomer”, customer);

Answer: A

QUESTION 205
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. You use the ADO.NET Entity Framework to manage persistence-ignorant entities. You create an ObjectContext instance named context. Then, you directly modify properties on several entities. You need to save the modified entity values to the database. Which code segment should you use?

A.    context.SaveChanges(SaveOptions.AcceptAllChangesAfterSave);
B.    context.SaveChanges(SaveOptions.DetectChangesBeforeSave);
C.    context.SaveChanges(SaveOptions.None);
D.    context.SaveChanges();

Answer: B
Explanation:
None Changes are saved without the DetectChanges or the AcceptAllChangesAfterSave() methods being called.
AcceptAllChangesAfterSave After changes are saved, the AcceptAllChangesAfterSave() method is called, which resets change tracking in the ObjectStateManager.
DetectChangesBeforeSave Before changes are saved, the DetectChanges method is called to synchronize the property values of objects that are attached to the object context with data in the ObjectStateManager.
SaveOptions Enumeration
http://msdn.microsoft.com/en-us/library/system.data.objects.saveoptions.aspx

QUESTION 206
You develop a Microsoft .NET application that uses Entity Framework to store entities in a Microsft SQL Server 2008 database. While the application is disconnected from the database, entities that are modified, are serialized to a local file. The next time the application connects to the database, it retrieves the identity from the database by using an object context named context and stores the entity in a variable named remoteCustomer. The application then serializes the Customer entity from the local file and stores the entity in a variable named localCustomer. The remoteCustomer and the localCustomer variables have the same entity key. You need to ensure that the offline changes to the Customer entity is persisted in the database when the ObjectContext.SaveChanges() method is called. Which line of code should you use?

A.    context.ApplyOriginalValues(“Customers”, remoteCustomer);
B.    context.ApplyOriginalValues(“Customers”, localCustomer);
C.    context.ApplyCurrentValues(“Customers”, remoteCustomer);
D.    context.ApplyCurrentValues(“Customers”, localCustomer);

Answer: D
Explanation:
Reference:
http://msdn.microsoft.com/en-us/library/dd487246.aspx

QUESTION 207
You use Microsoft .NET framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database named AdventureWorksLT. The database resides on an instance named INSTA on a server named SQL01. You need to configure the application to connect to the database. Which connection string should you add to the .config file?

A.    Data Source=SQL01;
Initial Catalog=INSTA;
Integrated Security=true;
Application Name=AdventureWorksLT;
B.    Data Source=SQL01;
Initial Catalog=AdventureWorksLT;
Integrated Security=true;
Application Name=INSTA;
C.    Data Source=SQL01\INSTA;
Initial Catalog=AdventureWorksLT;
Integrated Security=true;
D.    Data Source=AdventureWorksLT;
Initial Catalog=SQL01\INSTA;
Integrated Security=true;

Answer: C

QUESTION 208
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the ADO.NET Entity Framework to model entities. The database includes objects based on the exhibit (click the Exhibit button). The application includes the following code segment. (Line numbers are included for reference only.)
01 using(AdventureWorksEntities context = new AdventureWorksEntities())
02 {
03    …
04    foreach (SalesOrderHeader order in customer.SalesOrderHeader)
05    {
06        Console.WriteLine(String.Format(“Order: {0} “, order.SalesOrderNumber));
07        foreach (SalesOrderDetail item in order.SalesOrderDetail)
08        {
09           Console.WriteLine(String.Format(“Quantity: {0} “, item.Quantity));
10           Console.WriteLine(String.Format(“Product: {0} “, item.Product.Name));
11        }
12    }
13 }
You want to list all the orders for a specific customer. You need to ensure that the list contains following fields:
– Order number
– Quantity of products
– Product name
Which code segment should you insert in line 03?

A.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“customerId”, customerId)).First();
B.    Contact customer = context.Contact.Where(“it.ContactID = @customerId”, new ObjectParameter(“@customerId”, customerId)).First();
C.    Contact customer = (from contact in context.Contact.Include(“SalesOrderHeader.SalesOrderDetail”)select contact).FirstOrDefault();
D.    Contact customer = (from contact in context.Contact.Include(“SalesOrderHeader”)select contact).FirstOrDefault();

Answer: A

QUESTION 209
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You are creating the data layer of the application. You write the following code segment. (Line numbers are included for reference only.)
01 public static SqlDataReader GetDataReader(string sql)
02 {
03    SqlDataReader dr = null;
04    …
05    return dr;
06 }
You need to ensure that the following requirements are met:
– The SqlDataReader returned by the GetDataReader method can be used to retreive rows from the database.
– SQL connections opened within the GetDataReader method will close when the SqlDataReader is closed.
Which code segment should you insert at the line 04?

A.    using(SqlConnection cnn = new SqlConnection(strCnn))
{
try
{
SqlCommand cmd = new SqlCommand(sql, cnn);
cnn.Open();
dr = cmd.ExecuteReader();
}
catch
{
throw;
}
}
B.    SqlConnection cnn = new SqlConnection(strCnn);
SqlCommand cmd = new SqlCommand(sql, cnn);
cnn.Open();
{
try
{
dr = cmd.ExecuteReader();
}
finally
{
cnn.Close();
}
}
C.    SqlConnection cnn = new SqlConnection(strCnn);
SqlCommand cmd = new SqlCommand(sql, cnn);
cnn.Open();
{
try
{
dr = cmd.ExecuteReader();
cnn.Close();
}
catch
{
throw;
}
}
D.    SqlConnection cnn = new SqlConnection(strCnn);
SqlCommand cmd = new SqlCommand(sql, cnn);
cnn.Open();
{
try
{
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch
{
cnn.Close();
throw;
}
}

Answer: D
Explanation:
CommandBehavior.CloseConnection When the command is executed, the associated Connection object is closed when the associated DataReader object is closed.
CommandBehavior Enumeration
http://msdn.microsoft.com/en-us/library/system.data.commandbehavior.aspx
SqlCommand.ExecuteReader Method (CommandBehavior)
http://msdn.microsoft.com/en-us/library/y6wy5a0f.aspx

QUESTION 210
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application has an entity model that includes SalesTerritory and SalesPerson entities as shown in the following diagram. You need to calculate the total bonus for all sales people in each sales territory. Which code segment should you use?

A.    from person in model.SalesPersons
group person by person.SalesTerritory
into territoryByPerson
select new
{
   SalesTerritory = territoryByPerson.Key,
   TotalBonus = territoryByPerson.Sum(person => person.Bonus)
};
B.    from territory in model.SalesTerritories
group territory by territory.SalesPerson
into personByTerritories
select new
{
   SalesTerritory = personByTerritories.Key,
   TotalBonus = personByTerritories.Key.Sum(person => person.Bonus)
};
C.    model.SalesPersons
.GroupBy(person => person.SalesTerritory)
.SelectMany(group => group.Key.SalesPersons)
.Sum(person => person.Bonus);
D.    model.SalesTerritories
.GroupBy(territory => territory.SalesPersons)
.SelectMany(group => group.Key)
.Sum(person => person.Bonus);

Answer: A


http://www.passleader.com/70-516.html

QUESTION 211
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 add the following store procedure to the database.
CREATE PROCEDURE GetSalesPeople
AS
BEGIN
SELECT FirstName, LastName, Suffix, Email, Phone
FROM SalesPeople
END
You write the following code segment. (Line numbers are included for reference only.)
01 SqlConnection connection = new SqlConnection(“…”);
02 SqlCommand command = new SqlCommand(“GetSalesPeople”, connection);
03 command.CommandType = CommandType.StoredProcedure;
04 …
You need to retreive all of the results from the stored procedure. Which code segment should you insert at line 04?

A.    var res = command.ExecuteReader();
B.    var res = command.ExecuteScalar();
C.    var res = command.ExecuteNonQuery();
D.    var res = command.ExecuteXmlReader();

Answer: A
Explanation:
ExecuteReader Sends the CommandText to the Connection and builds a SqlDataReader.
SqlCommand Class
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx

QUESTION 212
The Entity Data Model file (.edmx file) must be updated to support inheritance mapping for Products and Componets. You need to add the following code to the \Model\Model.edmx file:
– the code in line EX243 that maps the Product type
– the code in line EX250 that maps the Component type
What should you do?

A.    Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”false” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”false” />
B.    Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”true” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”true” />
C.    Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”false” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”true” />
D.    Insert the following code at line EX243:
<Condition ColumnName=”ProductType” IsNull=”true” />
Insert the following code at line EX250:
<Condition ColumnName=”PartType” IsNull=”false” />

Answer: A

QUESTION 213
A performance issue exists in the application. The following code segment is causing a performance bottleneck:
var colors = context.Parts.GetColors();
You need to improve application performance by reducing the number of database calls. Which code segment should you use?

A.    var colors = context.Parts.OfType<Product>().
Include(“Colors”).GetColors();
B.    var colors = context.Parts.OfType<Product>().
Include(“Product.Color”).GetColors();
C.    var colors = context.Parts.OfType<Product>().
Include(“Parts.Color”).GetColors();
D.    var colors = context.Parts.OfType<Product>().
Include(“Color”).GetColors();

Answer: D

QUESTION 214
The application must be configured to run on a new development computer. You need to configure the connection string to point to the existing named instance. Which connection string fragment should you use?

A.    Data Source=INST01\SQL01
B.    Initial Catalog= SQL01\INST01
C.    Data Source=SQL01\INST01
D.    Initial Catalog= INST01\SQL01

Answer: C

QUESTION 215
You have an existing ContosoEntities context object named context. Calling the SaveChanges() method on the context object generates an exception that has the following inner exception:
System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object ‘dbo.Colors’ with unique index ‘IX_Colors’.
You need to ensure that a call to SaveChanges() on the context object does not generate this exception. What should you do?

A.    Examine the code to see how Color objects are allocated. Replace any instance of the new Color() method with a call to the ContosoEntities.LoadOrCreate() method.
B.    Add a try/catch statement around every call to the SaveChanges() method.
C.    Remove the unique constraint on the Name column in the Colors table.
D.    Override the SaveChanges() method on the ContosoEntities class, call the ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added) method, and call the AcceptChanges() method on each ObjectStateEntry object it returns

Answer: A

QUESTION 216
Refer to the following lines in the case study:
PA40 in \Model\Part.cs, PR16 in\Model\Product.cs, and CT14 in \Model\Component.cs
The application must create XML files that detail the part structure for any product. The XML files must use the following format:
<?xml version=”1.0″ encoding=”utf-8″?>
<product name=”Brush” description=”Brush product” productType=”1″>
<component name=”Handle” description=”Handle” partType=”2″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Wood”  description=”Wooden shaft” partType=”45″>
</component>
<component name=”Head” description=”Head” partType=”5″>
<component name=”Screw” description=”Screw” partType=”3″>
<component name=”Bristles”  description=”Bristles” partType=”4″>
</component>
</product>
You need to update the application to support the creation of an XElement object having a structure that will serialize to the format shown above. What should you do? (Each correct answer presents part of the solution. Choose two.)

A.    Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XAttribute(“name”, this.Name), new XElement(“description”, this.Description), new XElement(“productType”, this.ProductType));
B.    Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XElement(“name”, this.Name), new XElement(“description”, this.Description), new XElement(“partType”, this.PartType));
C.    Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XElement(“name”, this.Name), new XElement(“description”, this.Description), new XElement(“productType”, this.ProductType));
D.    Insert the following code segment at line PR16 in \Model\Product.cs:
return new XElement(“product, new XAttribute(“name”, this.Name), new XAttribute(“description”, this.Description), new XAttribute(“productType”, this.ProductType));
E.    Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XAttribute(“name”, this.Name), new XElement(“description”, this.Description), new XElement(“partType”, this.PartType));
F.    Insert the following code segment at line CT14 in \Model\Component.cs:
return new XElement(“component, new XAttribute(“name”, this.Name), new XAttribute(“description”, this.Description), new XAttribute(“partType”, this.PartType));

Answer: DF

QUESTION 217
You need to ensure that an exception is thrown when color names are set to less than two characters. What should you do?

A.    Add the following method to the Color partial class in Model\Color.cs:
protected overrride void OnPropertyChanged(string property)
{
if (property == “Name” && this.Name.Length < 2)
throw new ArgumentOutOfRangeException
(“Name must be at least two characters”);
}
B.    Add the following code segment to the ContosoEntities partial class in Model\ContosoEntities.cs:
public override in SaveChanges(System.Data.Objects.SaveOptions options)
{
var changes = this.ObjectStateManager.GetObjectSateEntries
(System.Data.EntityState.Added);
foreach (var change in changes)
{
if (change.Entity is Color)
if (((Color)change.Entity.Name.Length < 2)
throw new ArgumentException(“Name too short”);
}
return base.SaveChanges(options);
}
C.    Add the following attribute to the Name property of the Color class in the entity designer file:
[StringLength(256, MinimumLength = 2)]
D.    Add the following method to the Color partial class in Model\Color.cs:
protected overrride void OnPropertyChanging(string property)
{
if (property == “Name” && this.Name.Length < 2)
throw new ArgumentOutOfRangeException
(“Name must be at least two characters”);
}

Answer: A

QUESTION 218
Drag and Drop Question
You are developing an application that updates entries in a Microsoft SQL Server table named Orders. You need to ensure that you can update the rows in the Orders table by using optimistic concurrency. What code should you use? (To answer, drag the appropriate properties to the correct locations. Each property may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

Answer:

QUESTION 219
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that uses the Entity Framework. The appl cat on has an entity model that contains a SalesOrderHeader entity. The entity includes an OrderDate property of type DateTime. You need to retrieve the 10 oldest SalesOrderHeaders according to the OrderDate property. Which code segment should you use?

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: D

QUESTION 220
You are developing a Microsoft .NET Framework 4 application. You need to collect performance data to the event log after the application is deployed to the production environment. Which two components should you include in the project? (Each correct answer presents part of the solution. Choose two.)

A.    A trace listener
B.    A debug listener
C.    Debug.Asset() statements
D.    Debug.WriteLine() statements
E.    Trace.WriteLine() statements

Answer: BC


http://www.passleader.com/70-516.html

[Pass Ensure VCE Dumps] New Update PassLeader 70-515 Exam VCE And PDF Dumps (1-20)

$
0
0

The latest 70-515 exam was updated with a lot of new exam questions, old version 70-515 exam dumps are not valid at all, you should get the newest 299q 70-515 practice tests or braindumps to prepare it. Now, PassLeader just published the new 70-515 exam questions with PDF dumps and VCE test software, which have been corrected with many new questions and will help you passing 70-515 exam easily. Visit www.passleader.com now and get the premium 299q 70-515 exam dumps with new version VCE Player for free download.

keywords: 70-515 exam,299q 70-515 exam dumps,299q 70-515 exam questions,70-515 pdf dumps,70-515 practice test,70-515 vce dumps,70-515 study guide,70-515 braindumps,TS: Web Applications Development with Microsoft .NET Framework 4 Exam

QUESTION 1
You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages. You add JavaScript code to periodically update specific types of data items in these GridView controls. You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one pa to another. What should you do?

A.    Replace the GridView control with a ListView control.
B.    Set the ClientIDMode attribute to Predictable in the web.config file.
C.    Set the ClientIDRowSuffix attribute of each unique GridView control to a different value.
D.    Set the @ OutputCache directive’s VaryByControl attribute to the ID of the GridView control.

Answer: C

QUESTION 2
You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master. You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName.
protected void Page_Load(object sender, EventArgs e)
{
string s = Master.CityName;
}
You need to ensure that TestPage.aspx can access the CityName property. What should you do?

A.    Add the following directive to TestPage.aspx.
<%@ MasterType VirtualPath=”~/TestMaster.master” %>
B.    Add the following directive to TestPage.aspx.
<%@ PreviousPageType VirtualPath=”~/TestMaster.master” %>
C.    Set the Strict attribute in the @ Master directive of the TestMaster.master page to true.
D.    Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true.

Answer: A

QUESTION 3
You are implementing an ASP.NET page. You add asp:Button controls for Help and for Detail. You add an ASP.NET skin file named default.skin to a theme. You need to create and use a separate style for the Help button, and you must use the default style for the Detail button. What should you do?

A.    Add the following markup to the default.skin file.
<asp:Button ID=”Help”></asp:Button>
<asp:Button ID=”Default”></asp:Button>
Use the following markup for the buttons in the ASP.NET page.
<asp:Button SkinID=”Help”>Help</asp:Button>
<asp:Button SkinID=”Default”>Detail</asp:Button>
B.    Add the following markup to the default.skin file.
<asp:Button SkinID=”Help”></asp:Button>
<asp:Button ID=”Default”></asp:Button>
Use the following markup for the buttons in the ASP.NET page.
<asp:Button SkinID=”Help”>Help</asp:Button>
<asp:Button SkinID=”Default”>Detail</asp:Button>
C.    Add the following code segment to default.skin.
<asp:Button SkinID=”Help”></asp:Button>
<asp:Button></asp:Button>
Use the following markup for the buttons in the ASP.NET page.
<asp:Button SkinID=”Help”></asp:Button>
<asp:Button SkinID=”Default”>Detail</asp:Button>
D.    Add the following markup to default.skin.
<asp:Button SkinID=”Help”></asp:Button>
<asp:Button></asp:Button>
Use the following markup for the buttons in the ASP.NET page.
<asp:Button SkinID=”Help”>Help</asp:Button>
<asp:Button>Detail</asp:Button>

Answer: D

QUESTION 4
You are creating an ASP.NET Web site. The site has a master page named Custom.master. The code-behind file for Custom.master contains the following code segment.
public partial class CustomMaster : MasterPage
{
public string Region
{
get; set;
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
You create a new ASP.NET page and specify Custom.master as its master page. You add a Label control named lblRegion to the new page. You need to display the value of the master page’s Region property in lblRegion. What should you do?

A.    Add the following code segment to the Page_Load method of the page code-behind file.
CustomMaster custom = this.Parent as CustomMaster;
lblRegion.Text = custom.Region;
B.    Add the following code segment to the Page_Load method of the page code-behind file.
CustomMaster custom = this.Master as CustomMaster;
lblRegion.Text = custom.Region;
C.    Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file.
Label lblRegion = Page.FindControl(“lblRegion”) as Label;
lblRegion.Text = this.Region;
D.    Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file.
Label lblRegion = Master.FindControl(“lblRegion”) as Label;
lblRegion.Text = this.Region;

Answer: B

QUESTION 5
You are implementing an ASP.NET Web site. The site allows users to explicitly choose the display language for the site’s Web pages. You create a Web page that contains a DropDownList named ddlLanguage, as shown in the following code segment.
<asp:DropDownList ID=”ddlLanguage” runat=”server” AutoPostBack=”True” ClientIDMode=”Static” OnSelectedIndexChanged=”SelectedLanguageChanged”>
<asp:ListItem Value=”en”>English</asp:ListItem>
<asp:ListItem Value=”es”>Spanish</asp:ListItem>
<asp:ListItem Value=”fr”>French</asp:ListItem>
<asp:ListItem Value=”de”>German</asp:ListItem>
</asp:DropDownList>
The site contains localized resources for all page content that must be translated into the language that is selected by the user. You need to add code to ensure that the page displays content in the selected language if the user selects a language in the drop-down list. Which code segment should you use?

A.    protected void SelectedLanguageChanged(object sender, EventArgs e)
{
Page.UICulture = ddlLanguage.SelectedValue;
}
B.    protected override void InitializeCulture()
{
Page.UICulture = Request.Form[“ddlLanguage”];
}
C.    protected void Page_Load(object sender, EventArgs e)
{
Page.Culture = Request.Form[“ddlLanguage”];
}
D.    protected override void InitializeCulture()
{
Page.Culture = ddlLanguage.SelectedValue;
}

Answer: B

QUESTION 6
You are implementing an ASP.NET application that includes the following requirements. Retrieve the number of active bugs from the cache, if the number is present. If the number is not found in the cache, call a method named GetActiveBugs, and save the result under the ActiveBugs cache key. Ensure that cached data expires after 30 seconds. You need to add code to fulfill the requirements. Which code segment should you add?

A.    int? numOfActiveBugs = (int?)Cache[“ActiveBugs”];
if (!numOfActiveBugs.HasValue)
{
int result = GetActiveBugs();
Cache.Insert(“ActiveBugs”, result, null,
DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration);
numOfActiveBugs = result;
}
ActiveBugs = numOfActiveBugs.Value;
B.    int numOfActiveBugs = (int) Cache.Get(“ActiveBugs”);
if (numOfActiveBugs != 0)
{
int result = GetActiveBugs();
Cache.Insert(“ActiveBugs”, result, null,
DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration);
numOfActiveBugs = result;
}
ActiveBugs = numOfActiveBugs;
C.    int numOfActiveBugs = 0;
if (Cache[“ActiveBugs”] == null)
{
int result = GetActiveBugs();
Cache.Add(“ActiveBugs”, result, null, DateTime.Now.AddSeconds(30),
Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
numOfActiveBugs = result;
}
ActiveBugs = numOfActiveBugs;
D.    int numOfActiveBugs = (int?)Cache[“ActiveBugs”];
if (!numOfActiveBugs.HasValue)
{
int result = GetActiveBugs();
Cache.Insert(“ActiveBugs”, result, null,
Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(30));
numOfActiveBugs = result;
}
ActiveBugs = numOfActiveBugs.Value;

Answer: A

QUESTION 7
You are implementing a method in an ASP.NET application that includes the following requirements.
– Store the number of active bugs in the cache.
– The value should remain in the cache when there are calls more often than every 15 seconds.
– The value should be removed from the cache after 60 seconds.
You need to add code to meet the requirements. Which code segment should you add?

A.    Cache.Insert(“ActiveBugs”, result, null,
DateTime.Now.AddSeconds(60),
TimeSpan.FromSeconds(15));
B.    Cache.Insert(“Trigger”, DateTime.Now, null,
DateTime.Now.AddSeconds(60),
Cache.NoSlidingExpiration);
CacheDependency cd = new CacheDependency(null, new string[]
{ “Trigger” });
Cache.Insert(“ActiveBugs”, result, cd,
Cache.NoAbsoluteExpiration,
TimeSpan.FromSeconds(15));
C.    Cache.Insert(“ActiveBugs”, result, null,
Cache.NoAbsoluteExpiration,
TimeSpan.FromSeconds(15));
CacheDependency cd = new CacheDependency(null, new string[]
{ “ActiveBugs” });
Cache.Insert(“Trigger”, DateTime.Now, cd,
DateTime.Now.AddSeconds(60),
Cache.NoSlidingExpiration);
D.    CacheDependency cd = new CacheDependency(null,
new string[] { “Trigger” });
Cache.Insert(“Trigger”, DateTime.Now, null,
DateTime.Now.AddSeconds(60),
Cache.NoSlidingExpiration);
Cache.Insert(“ActiveBugs”, result, cd,
Cache.NoAbsoluteExpiration,
TimeSpan.FromSeconds(15));

Answer: B

QUESTION 8
You are implementing an ASP.NET application that will use session state in out-of-proc mode. You add the following code.
public class Person
{
public string FirstName { get; set;}
public string LastName { get; set;}
}
You need to add an attribute to the Person class to ensure that you can save an instance to session state. Which attribute should you use?

A.    Bindable
B.    DataObject
C.    Serializable
D.    DataContract

Answer: C

QUESTION 9
You create a Web page named TestPage.aspx and a user control named contained in a file named TestUserControl.ascx. You need to dynamically add TestUserControl.ascx to TestPage.aspx. Which code segment should you use?

A.    protected void Page_Load(object sender, EventArgs e)
{
Control userControl = Page.LoadControl(“TestUserControl.ascx”);
Page.Form.Controls.Add(userControl);
}
B.    protected void Page_Load(object sender, EventArgs e)
{
Control userControl = Page.FindControl(“TestUserControl.ascx”);
Page.Form.Controls.Load(userControl);
}
C.    protected void Page_PreInit(object sender, EventArgs e)
{
Control userControl = Page.LoadControl(“TestUserControl.ascx”);
Page.Form.Controls.Add(userControl);
}
D.    protected void Page_PreInit(object sender, EventArgs e)
{
Control userControl = Page.FindControl(“TestUserControl.ascx”);
Page.Form.Controls.Load(userControl);
}

Answer: C

QUESTION 10
You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code.
<uc:TestUserControl ID=”testControl” runat=”server”/>
On TestUserControl.ascx, you need to add a read-only member named CityName to return the value “New York”. You also must add code to TestPage.aspx to read this value. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Add the following line of code to the TestUserControl.ascx.cs code-behind file.
public string CityName
{
get { return “New York”; }
}
B.    Add the following line of code to the TestUserControl.ascx.cs code-behind file.
protected readonly string CityName = “New York”;
C.    Add the following code segment to the TestPage.aspx.cs code-behind file.
protected void Page_Load(object sender, EventArgs e)
{
string s = testControl.CityName;
}
D.    Add the following code segment to the TestPage.aspx.cs code-behind file.
protected void Page_Load(object sender, EventArgs e)
{
string s = testControl.Attributes[“CityName”];
}

Answer: AC


http://www.passleader.com/70-515.html

QUESTION 11
You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx.
<uc:TestUserControl ID=”testControl” runat=”server”/>
You add the following code to the code-behind file of TestPage.aspx.
private void TestMethod()
{

}
You define the following delegate.
public delegate void MyEventHandler();
You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the page’s TestMethod method to the event. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Add the following line of code to TestUserControl.ascx.cs.
public event MyEventHandler MyEvent;
B.    Add the following line of code to TestUserControl.ascx.cs.
public MyEventHandler MyEvent;
C.    Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration.
<uc:TestUserControl ID=”testControl” runat=”server” OnMyEvent=”TestMethod”/>
D.    Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration.
<uc:TestUserControl ID=”testControl” runat=”server” MyEvent=”TestMethod”/>

Answer: AC

QUESTION 12
You create a custom server control named Task that contains the following code segment. (Line numbers are included for reference only.)
01 namespace DevControls
02 {
03 public class Task : WebControl
04 {
05 [DefaultValue(“”)]
06 public string Title { … }
07
08 protected override void RenderContents(HtmlTextWriter output)
09 {
10 output.Write(Title);
11 }
12 }
13 }
You need to ensure that adding a Task control from the Toolbox creates markup in the following format.
<Dev:Task ID=”Task1″ runat=”server” Title=”New Task” />
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Add the following code segment to the project’s AssemblyInfo.cs file.
[assembly: TagPrefix(“DevControls”, “Dev”)]
B.    Replace line 05 with the following code segment.
[DefaultValue(“New Task”)]
C.    Insert the following code segment immediately before line 03.
[ToolboxData(“<{0}:Task runat=\”server\” Title=\”New Task\” />”)]
D.    Replace line 10 with the following code segment.
output.Write(“<Dev:Task runat=\”server\” Title=\”New Task\” />”);

Answer: AC

QUESTION 13
You are implementing an ASP.NET page that includes the following drop-down list.
<asp:PlaceHolder ID=”dynamicControls” runat=”server”>
<asp:DropDownList ID=”MyDropDown” runat=”server”>
<asp:ListItem Text=”abc” value=”abc” />
<asp:ListItem Text=”def” value=”def” />
</asp:DropDownList>
</asp:PlaceHolder>
You need to dynamically add values to the end of the drop-down list. What should you do?

A.    Add the following OnPreRender event handler to the asp:DropDownList
protected void MyDropDown_PreRender(object sender, EventArgs e)
{
DropDownList ddl = sender as DropDownList;
Label lbl = new Label();
lbl.Text = “Option”;
lbl.ID = “Option”;
ddl.Controls.Add(lbl);
}
B.    Add the following OnPreRender event handler to the asp:DropDownList
protected void MyDropDown_PreRender(object sender, EventArgs e)
{
DropDownList ddl = sender as DropDownList;
ddl.Items.Add(“Option”);
}
C.    Add the following event handler to the page code-behind.
protected void Page_LoadComplete(object sender, EventArgs e)
{
DropDownList ddl = Page.FindControl(“MyDropDown”) as DropDownList;
Label lbl = new Label();
lbl.Text = “Option”;
lbl.ID = “Option”;
ddl.Controls.Add(lbl);
}
D.    Add the following event handler to the page code-behind.
protected void Page_LoadComplete(object sender, EventArgs e)
{
DropDownList ddl = Page.FindControl(“MyDropDown”) as DropDownList;
ddl.Items.Add(“Option”);
}

Answer: B

QUESTION 14
You create an ASP.NET page that contains the following tag.
<h1 id=”hdr1″ runat=”server”>Page Name</h1>
You need to write code that will change the contents of the tag dynamically when the page is loaded. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A.    this.hdr1.InnerHtml = “Text”;
B.    (hdr1.Parent as HtmlGenericControl).InnerText = “Text”;
C.    HtmlGenericControl h1 = this.FindControl(“hdr1”) as
HtmlGenericControl;
h1.InnerText = “Text”;
D.    HtmlGenericControl h1 = Parent.FindControl(“hdr1”) as
HtmlGenericControl;
h1.InnerText = “Text”;

Answer: AC

QUESTION 15
You are implementing custom ASP.NET server controls. You have a base class named RotaryGaugeControl and two subclasses named CompassGaugeControl and SpeedGaugeControl. Each control requires its own client JavaScript code in order to function properly. The JavaScript includes functions that are used to create the proper HTML elements for the control. You need to ensure that the JavaScript for each of these controls that is used in an ASP.NET page is included in the generated HTML page only once, even if the ASP.NET page uses multiple instances of the given control. What should you do?

A.    Place the JavaScript in a file named controls.js and add the following code line to the Page_Load method of each control.
Page.ClientScript.RegisterClientScriptInclude(this.GetType(), “script”, “controls.js”);
B.    Add the following code line to the Page_Load method of each control, where strJavascript contains the JavaScript code for the control.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), “script”, strJavascript);
C.    Add the following code line to the Page_Load method of each control, where CLASSNAME is the name of the control class and strJavascript contains the JavaScript code for the control.
Page.ClientScript.RegisterStartupScript(typeof(CLASSNAME), “script”, strJavascript);
D.    Add the following code line to the Page_Load method of each control, where CLASSNAME is the name of the control class and strJavascript contains the JavaScript code for the control.
Page.ClientScript.RegisterClientScriptBlock(typeof(CLASSNAME), “script”, strJavascript);

Answer: D

QUESTION 16
You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role named Administrators. Which code segment should you use?

A.    bool isMember = Roles.GetUsersInRole(“Administrators”).Any();
B.    bool isMember = Membership.ValidateUser(User.Identity.Name, “Administrators”);
C.    bool isMember = Roles.GetRolesForUser(“Administrators”).Any();
D.    bool isMember = User.IsInRole(“Administrators”);

Answer: D

QUESTION 17
You are creating an ASP.NET Web site. You create a HTTP module named CustomModule, and you register the module in the web.config file. The CustomModule class contains the following code.
public class CustomModule : IHttpModule
{
string footerContent = “<div>Footer Content</div>”;
public void Dispose() {}
}
You need to add code to CustomModule to append the footer content to each processed ASP.NET page. Which code segment should you use?

A.    public CustomModule(HttpApplication app)
{
app.EndRequest += new EventHandler(app_EndRequest);
void app_EndRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
app.Response.Write(footerContent);
}
B.    public void Init(HttpApplication app)
{
app.EndRequest += new EventHandler(app_EndRequest);
void app_EndRequest(object sender, EventArgs e)
{
HttpApplication app = new HttpApplication();
app.Response.Write(footerContent);
}
C.    public customModule();
{
HttpApplication app = new HttpApplication();
app.EndRequest += new EventHandler(app_EndRequest);
}
void app_EndRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
app.Response.Write(footerContent);
}
D.    public void Init(HttpApplication app)
{
app.EndRequest += new EventHandler(app_EndRequest);
}
void app_EndRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
app.Response.Write(footerContent);
}

Answer: D

QUESTION 18
You are implementing an ASP.NET Web site. The root directory of the site contains a page named Error.aspx. You need to display the Error.aspx page if an unhandled error occurs on any page within the site. You also must ensure that the original URL in the browser is not changed. What should you do?

A.    Add the following configuration to the web.config file.
<system.web>
<customErrors mode=”On”>
<error statusCode=”500″ redirect=”~/Error.aspx” />
</customErrors>
</system.web>
B.    Add the following configuration to the web.config file.
<system.web>
<customErrors redirectMode=”ResponseRewrite” mode=”On” defaultRedirect=”~/Error.aspx” />
</system.web>
C.    Add the following code segment to the Global.asax file.
void Application_Error(object sender, EventArgs e)
{
Response.Redirect(“~/Error.aspx”);
}
D.    Add the following code segment to the Global.asax file.
void Page_Error(object sender, EventArgs e)
{
Server.Transfer(“~/Error.aspx”);
}

Answer: B

QUESTION 19
You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages. You create a static method named SiteHelper.Configure that configures the component. You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested. Which code segment should you use?

A.    void Application_Start(object sender, EventArgs e)
{
SiteHelper.Configure();
}
B.    void Application_Init(object sender, EventArgs e)
{
SiteHelper.Configure();
}
C.    void Application_BeginRequest(object sender, EventArgs e)
{
SiteHelper.Configure();
}
D.    Object lockObject = new Object();
void Application_BeginRequest(object sender, EventArgs e)
{
lock(lockObject())
{
SiteHelper.Configure();
}
}

Answer: A

QUESTION 20
You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project. The service includes a method named GetPeople that takes no arguments and returns an array of Person objects. The ASP.NET application uses a proxy class to access the service. You use the Add Service Reference wizard to generate the class. After you create the proxy, you move the service endpoint to a different port. You need to configure the client to use the new service address. In addition, you must change the implementation so that calls to the client proxy will return a List<Person> instead of an array. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    In the context menu for the service reference in the ASP.NET project, select the Configure Service Reference command, and set the collection type to System.Collections.Generic.List.
B.    In the context menu for the service reference in the ASP.NET project, select the Update Service Reference command to retrieve the new service configuration.
C.    Change the service interface and implementation to return a List<Person>
D.    Edit the address property of the endpoint element in the web.config file to use the new service address.

Answer: AD


http://www.passleader.com/70-515.html

[Pass Ensure VCE Dumps] PassLeader Free 70-515 PDF Study Guide and VCE Dumps (21-40)

$
0
0

The latest 70-515 exam was updated with a lot of new exam questions, old version 70-515 exam dumps are not valid at all, you should get the newest 299q 70-515 practice tests or braindumps to prepare it. Now, PassLeader just published the new 70-515 exam questions with PDF dumps and VCE test software, which have been corrected with many new questions and will help you passing 70-515 exam easily. Visit www.passleader.com now and get the premium 299q 70-515 exam dumps with new version VCE Player for free download.

keywords: 70-515 exam,299q 70-515 exam dumps,299q 70-515 exam questions,70-515 pdf dumps,70-515 practice test,70-515 vce dumps,70-515 study guide,70-515 braindumps,TS: Web Applications Development with Microsoft .NET Framework 4 Exam

QUESTION 21
You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations. Each location will specify its SMTP configuration settings in a separate file named smtp.config in the root folder of the Web site. You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the Web site. Which configuration should you use in web.config?

A.    <configuration>
<system.net>
<mailSettings>
<smtp configSource=”smtp.config” allowOverride=”true”>
<network host=”127.0.0.1″ port=”25″/>
</smtp>
</mailSettings>
</system.net>
</configuration>

B.    <configuration>
<system.net>
<mailSettings>
<smtp configSource=”smtp.config” />
</mailSettings>
</system.net>
</configuration>
C.    <configuration xmlns:xdt=
“http://schemas.microsoft.com/XML-Document-Transform”>
<location path=”smtp.config” xdt:Transform=”Replace”
xdt:Locator=”Match(path)”>
<system.net />
</location>
</configuration>
D.    <configuration>
<location path=”smtp.config”>
<system.net>
<mailSettings>
<smtp Devilery Method=”Network” >
<Network Host = “127.0.0.1” Port=”25″/>
</smtp>
</mailSettings>
</system.net>
</location>
</configuration>

Answer: B

QUESTION 22
You deploy an ASP.NET application to an IIS server. You need to log health-monitoring events with severity level of error to the Windows application event log. What should you do?

A.    Run the aspnet_regiis.exe command.
B.    Set the Treat warnings as errors option to All in the project properties and recompile.
C.    Add the following rule to the <healthMonitoring/> section of the web.config file.
<rules>
<add name=”Failures” eventName=”Failure Audits”
provider=”EventLogProvider” />
</rules>
D.    Add the following rule to the <healthMonitoring/> section of the web.config file.
<rules>
<add name=”Errors” eventName=”All Errors”
provider=”EventLogProvider” />
</rules>

Answer: D

QUESTION 23
You are developing an ASP.Net web application. The application includes a master page named CustomerMaster.master that contains a public string property name EmployeeName application also includes a second master page named NestedMaster.master that is defined by the following directive.
<%@ Master Language=”C#”
MasterPageFile=”~/CustomMaster.Master”
CodeBehind=”NestedMaster.Master.cs”
Inherits=”MyApp.NestedMaster”%>
You add a content page that uses the NestedMaster.master page file. The content page contains a label control named lblEmployeeName. You need to acces the EmployeeName value and display the value within the lblEmployeeName label. What should you do?

A.    Add the following code segment to the code-behind file of the content page.
public void Page_load(object s, EventArgs e)
{
lblEmployeeName.text=((MyApp.CustomMaster)Page.Master.Parent).EmployeeName;
}
B.    Add the following directive to the content page.
<%@ MasterTypeVirtualPAth=”~/CustomMaster.master” %>
Add the following code segment to the code-behind file of the content page.
public void Page_load(object s, EventArgs e)
{
lblEmployeeName.text=this.Master.EmployeeName;
}
C.    Add the following code segment to the code-behind file of the content page.
public void Page_load(object s, EventArgs e)
{
lblEmployeeName.text=((MyApp.CustomerMaster)Page.Master.Master).EmployeeName;
}
D.    Add the following code segment to the code-behind file of the content page.
public void Page_load(object s, EventArgs e)
{
lblEmployeeName.text=((MyApp.CustomerMaster)Page.Master.Master).FindControl(“EmployeeName”).toString();
}

Answer: A

QUESTION 24
You´re developing an ASP web page. The pages requires access to types that are defined in an assembly named Contoso.businessobjects.dll. You need to ensure that the page can access these types.

A.    <%@ assembly ID=
“Contoso.bussinessobjects” %>
B.    <%@ assembly target name=
“Contoso.bussinessobjects” %>
C.    <%@ assembly name= “Contoso.bussinessobjects” %>
D.    <%@ assenbly Virtual Path= “Contoso.bussinessobjects” %>

Answer: C

QUESTION 25
You are developing an ASP.NET web page. The page includes functionality to make a web request and to display the responde in a specified HTML element. You need to add a client-side function to write the response to the specified HTML element. Which function should you add?

A.    function loadData(url,element){
$(element).ajaxStart(function(){
$(this).text(url);
});
}
B.    function loadData(url,element){
$(element).ajaxSend(function(){
$(this).text(url);
});
}
C.    function loadData(url,element){
$.post(element,function(url){
$(element).text(url);
});
}
D.    function loadData(url,element){
$.get(url,function(data){
$(element).text(data);
});
}

Answer: D

QUESTION 26
You are perfoming security testing on an existing asp.net web page. You notice that you are able to issue unauthorized postback requests to the page. You need to prevent unauthorized post back requests. which page directive you use?

A.    <%@Page strict = “true” %>
B.    <%@Page enableViewStateMac = “true” %>
C.    <%@Page EnableEventValidation = “true” %>
D.    <%@Page Aspcompact = “true” %>

Answer: C

QUESTION 27
You are developing an ASP.NET web application. Your designer creates a theme named General for general use in the application. The designer also makes page-specific changes to the default properties of certain controls. You need to apply the General theme to all pages, and you must ensure that the page-specific customizations are preserved. What should you do?

A.    Add the following configuration to the web.config file.
<configuration>
<system.web>
<pages theme=”General”/>
</system.web>
</configuration>
Set the following page directive on pages that have customizations.
<%@ Page EnableTheming=”true” %>
B.    Add the following configuration to the web.config file.
<configuration>
<system.web>
<pages styleSheetTheme=”General”/>
</system.web>
</configuration>
C.    Add the following configuration to the web.config file.
<configuration>
<system.web>
<pages theme=”General”/>
</system.web>
</configuration>
Set the following page directive on pages that have customizations.
<%@ Page StyleSheetTheme=”General” %>
D.    Add the following configuration to the web.config file.
<configuration>
<system.web>
<pages theme=”General”/>
</system.web>
</configuration>
Set the following page directive on pages that have customizations.
<%@ Page EnableTheming=”false” %>

Answer: D

QUESTION 28
You are implementing an ASP.NET application. You add the following code segment.
public List<Person> GetNonSecretUsers()
{
string[] secretUsers = {“@secretUser”, “@admin”, “@root”};
List<Person> allpeople = GetAllPeople();

}
You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list. The resulting list must not contain duplicates. Which code segment should you use?

A.    var secretPeople = (from p in allPeople
from u in secretUsers
where p.UserId == u
select p).Distinct();
return allPeople.Except(secretPeople);
B.    return from p in allPeople
from u in secretUsers
where p.UserId != u
select p;
C.    return (from p in allPeople
from u in secretUsers
where p.UserId != u
select p).Distinct();
D.    List<Person> people = new List<Person>(
from p in allPeople
from u in secretUsers
where p.UserId != u
select p);
return people.Distinct();

Answer: A

QUESTION 29
You are implementing an ASP.NET Web site. The Web site contains a Web service named CustomerService. The code-behind file for the CustomerService class contains the following code segment.
public class ProductService : System.Web.Services.WebService
{
public List<Product> GetProducts(int categoryID)
{
return GetProductsFromDatabase(categoryID);
}
}
You need to ensure that the GetProducts method can be called by using AJAX. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Apply the WebService attribute to the ProductService class.
B.    Apply the ScriptService attribute to the ProductService class.
C.    Apply the WebMethod attribute to the GetProducts method.
D.    Apply the ScriptMethod attribute to the GetProducts method.

Answer: BC

QUESTION 30
You are implementing a WCF service library. You add a new code file that contains the following code segment.
namespace ContosoWCF
{
[ServiceContract]
public interface IRateService
{
[OperationContract]
decimal GetCurrentRate();
}
public partial class RateService : IRateService
{
public decimal GetCurrentRate()
{
decimal currentRate = GetRateFromDatabase();
return currentRate;
}
}
}
You build the service library and deploy its assembly to an IIS application. You need to ensure that the GetCurrentRate method can be called from JavaScript. What should you do?

A.    Add a file named Service.svc to the IIS application.
Add the following code segment to the file.
<%@ ServiceHost Service=”ContosoWCF.IRateService”
Factory=”System.ServiceModel.
Activation.WebScriptServiceHostFactory” %>
B.    Add a file named Service.svc to the IIS application.
Add the following code segment to the file.
<%@ ServiceHost Service=”ContosoWCF.RateService”
Factory=”System.ServiceModel.
Activation.WebScriptServiceHostFactory” %>
C.    Apply the script service attribute to rate serice class Rebulid the WCF servicelibrary, and redploy the assembly to the IIS application.
D.    Apply the Web get attibute to the Get Currant rate interface Method.Rebuild the WCF servicelibrary, and redploy the assembly to the IIS application.

Answer: B


http://www.passleader.com/70-515.html

QUESTION 31
You are implementing an ASP.NET Web site. The site contains the following class.
public class Address
{
public int AddressType;
public string Line1;
public string Line2;
public string City;
public string ZipPostalCode;
}
The Web site interacts with an external data service that requires Address instances to be given in the following XML format.
<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<ZipCode>60603</ZipCode>
</Address>
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format requirements of the external data service. Which two actions should you perform (Each correct answer presents part of the solution. Choose two.)

A.    Add the following attribute to the AddressType field.
[XmlAttribute]
B.    Add the following attribute to the Line2 field.
[XmlElement(IsNullable=true)]
C.    Add the following attribute to the ZipPostalCode field.
[XmlAttribute(“ZipCode”)]
D.    Add the following attribute to the ZipPostalCode field.
[XmlElement(“ZipCode”)]

Answer: AD

QUESTION 32
You are implementing an ASP.NET Dynamic Data Web site. The Web site includes a data context that enables automatic scaffolding for all tables in the data model. The Global.asax.cs file contains the following code segment.
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.List,
ViewName = “ListDetails”,
Model = DefaultModel
});
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.Details,
ViewName = “ListDetails”,
Model = DefaultModel
});
}
You need to display the items in a table named Products by using a custom layout. What should you do?

A.    Add a new Web page named Products.aspx to the Dynamic Data\PageTemplates folder of the Web site.
B.    Add a new folder named Products to the Dynamic Data\CustomPages folder of the Web site. Add a new Web page named ListDetails.aspx to the Products folder.
C.    Add a new Web user control named Products.ascx to the Dynamic Data\Filters folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.QueryableFilterUserControl.
D.    Add a new Web user control named Products_ListDetails.ascx to the Dynamic Data\EntityTemplates folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.EntityTemplateUserControl.

Answer: B

QUESTION 33
You are implementing a new Dynamic Data Web site. The Web site includes a Web page that has an ObjectDataSource control named ObjectDataSource1. ObjectDataSource1 interacts with a Web service that exposes methods for listing and editing instances of a class named Product. You add a GridView control named GridView1 to the page, and you specify that GridView1 should use ObjectDataSource1 as its data source. You then configure GridView1 to auto-generate fields and to enable editing. You need to add Dynamic Data behavior to GridView1. You also must ensure that users can use GridView1 to update Product instances. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Add a DynamicDataManager control to the Web page.
B.    Disable the auto-generated fields on GridView1.
Add a DynamicField control for each field of the Product class.
C.    Add the following code segment to the Application_Start method in the Global.asax.cs file.
DefaultModel.RegisterContext(typeof(System.Web.UI.WebControls.ObjectDataSource), new ContextConfiguration() {ScaffoldAllTables = true});
D.    Add the following code segment to the Page_Init method of the Web page.
GridView1.EnableDynamicData(typeof(Product));

Answer: BD

QUESTION 34
You create a new ASP.NET MVC 2 Web application. The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
05 routes.MapRoute(“Default”, “{controller}/{action}/{id}”, new {controller = “Home”, action = “Index”, id = “”});
06 }
You implement a controller named HomeController that includes methods with the following signatures.
public ActionResult About()
public ActionResult Index()
public ActionResult Details(int id)
You need to ensure that the About action is invoked when the root URL of the site is accessed. What should you do?

A.    At line 04 in the Global.asax.cs file, add the following line of code.routes.MapRoute(“Default4Empty”, “/”, new {controller = “Home”, action = “About”});
B.    At line 04 in the Global.asax.cs file, add the following line of code.routes.MapRoute(“Default”, “”, new {controller = “Home”, action = “About”});
C.    Replace line 05 in the Global.asax.cs file with the following line of code.routes.MapRoute(“Default4Empty”, “{controller}/{action}/{id}”, new {controller = “Home”, action = “About”, id = “”});
D.    Replace line 05 in the Global.asax.cs file with the following line of code.routes.MapRoute(“Default”, “{controller}/{action}”, new {controller = “Home”, action = “About”});

Answer: C

QUESTION 35
You create a new ASP.NET MVC 2 Web application. The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03     routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
05     routes.MapRoute(“Default”, “{controller}/{action}/{id}”, new {controller = “Home”, action = “Index”, id = “”});
06 }
You implement a controller named HomeController that includes methods with the following signatures.
public ActionResult Index()
public ActionResult Details(int id)
public ActionResult DetailsByUsername(string username)
You need to add a route to meet the following requirements.
– The details for a user must to be displayed when a user name is entered as the path by invoking the DetailsByUsername action.
– User names can contain alphanumeric characters and underscores, and can be between 3 and 20 characters long.
What should you do?

A.    Replace line 05 with the following code segment.
routes.MapRoute(“Default”, “{controller}/{action}/{id}”, new {controller = “Home”, action = “DetailsByUsername”, id = “”});
B.    Replace line 05 with the following code segment.
routes.MapRoute(“Default”, “{controller}/{action}/{username}”, new {controller = “Home”, action = “DetailsByUsername”, username = “”}, new {username = @”\w{3,20}”});
C.    At line 04, add the following code segment.
routes.MapRoute(“Details by Username”, “{username}”, new {controller = “Home”, action = “DetailsByUsername”}, new {username = @”\w{3,20}”});
D.    At line 04, add the following code segment.
routes.MapRoute(“Details by Username”, “{id}”, new {controller = “Home”, action = “DetailsByUsername”}, new {id = @”\w{3,20}”});

Answer: C

QUESTION 36
You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contain an unrecognized country value will not be processed by the Details action of HomeController. What should you do?

A.    Add the ValidateAntiForgeryToken attribute to the Details action method.
B.    Add the Bind attribute to the country parameter of the Details action method. Set the attribute’s Prefix property to Country.
C.    Create a class that implements the IRouteConstraint interface. Configure the default route to use this class.
D.    Create a class that implements the IRouteHandler interface. Configure the default route to use this class.

Answer: C

QUESTION 37
You are implementing an ASP.NET MVC 2 Web application that allows users to view and edit data. You need to ensure that only logged-in users can access the Edit action of the controller. What are two possible attributes that you can add to the Edit action to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A.    [Authorize(Users = “”)]
B.    [Authorize(Roles = “”)]
C.    [Authorize(Users = “*”)]
D.    [Authorize(Roles = “*”)]

Answer: AB

QUESTION 38
You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code.
public ActionResult Edit(int id)
{
    return View(SelectUserToEdit(id));
}
public ActionResult Edit(Person person)
{
    UpdateUser(person);
    return RedirectToAction(“Index”);
}
The first Edit action displays the user whose details are to be edited, and the second Edit action is called when the Save button on the editing form is clicked to update the user details. An exception is thrown at run time stating that the request for action Edit is ambiguous. You need to correct this error and ensure that the controller functions as expected. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A.    Add the following attribute to the first Edit action.
[AcceptVerbs(HttpVerbs.Head)]
B.    Add the following attribute to the first Edit action.
[HttpGet]
C.    Add the following attribute to the second Edit action.
[HttpPost]
D.    Add the following attribute to the second Edit action.
[HttpPut]

Answer: BC

QUESTION 39
You are implementing an ASP. NET MVC 2 Web application. You add a controller named CompanyController. You need to modify the application to handle the URL path /company/info. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Add the following method to the CompanyController class.
public ActionResult info()
{
return View();
}
B.    Add the following method to the CompanyController class.
public ActionResult Company_Info()
{
return View();
}
C.    Right-click the Views folder, and select View from the Add submenu to create the view for the action.
D.    Right-click inside the action method in the CompanyController class, and select Add View to create a view for the action.

Answer: AD

QUESTION 40
You create an ASP.NET MVC 2 Web application. You implement a single project area in the application. In the Areas folder, you add a subfolder named Test. You add files named TestController.cs and Details.aspx to the appropriate subfolders. You register the area’s route, setting the route name to test_default and the area name to test. You create a view named Info.aspx that is outside the test area. You need to add a link to Info.aspx that points to Details.aspx. Which code segment should you use?

A.    <%= Html.RouteLink(“Test”, “test_default”, new {area = “test”}, null) %>
B.    <%= Html.ActionLink(“Test”, “Details”, “Test”, new {area = “test”}, null) %>
C.    <a href=”<%= Html.RouteLink(“Test”, “test_default”, new {area = “test”}, null) %>”>Test</a>
D.    <a href=”<%= Html.ActionLink(“Test”, “Details”, “Test”, new {area = “test”}, null) %>”>Test</a>

Answer: B


http://www.passleader.com/70-515.html

Viewing all 1919 articles
Browse latest View live